fix: add DNS propagation delay and frontend error feedback for tunnel recreation
- apps/api/src/services/tunnel.py: add 2-second sleep after discovering the tunnel URL to allow Cloudflare DNS edge propagation before returning - apps/web/src/hooks/use-instance-actions.ts: show alert() with the backend error message when recreate tunnel fails, instead of silently swallowing errors Quality gates: ruff clean, tsc clean
This commit is contained in:
@@ -169,6 +169,9 @@ def start_tunnel(
|
|||||||
f"Exit code: {exit_code}. Logs:\n{combined_logs[-3000:]}"
|
f"Exit code: {exit_code}. Logs:\n{combined_logs[-3000:]}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Wait a moment for Cloudflare DNS edge to propagate the new tunnel subdomain
|
||||||
|
__import__("time").sleep(2)
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
"Tunnel %s started for %s → %s (%s)",
|
"Tunnel %s started for %s → %s (%s)",
|
||||||
tunnel_name,
|
tunnel_name,
|
||||||
|
|||||||
@@ -127,10 +127,17 @@ export function useInstanceActions(
|
|||||||
if (loadingSessionId === session.id) return;
|
if (loadingSessionId === session.id) return;
|
||||||
setLoadingSessionId(session.id);
|
setLoadingSessionId(session.id);
|
||||||
try {
|
try {
|
||||||
await recreateInstanceTunnel(session.project_id, session.repository_id, session.id);
|
await recreateInstanceTunnel(
|
||||||
|
session.project_id,
|
||||||
|
session.repository_id,
|
||||||
|
session.id
|
||||||
|
);
|
||||||
await onRefresh();
|
await onRefresh();
|
||||||
} catch {
|
} catch (err) {
|
||||||
// ignore
|
const message =
|
||||||
|
(err as { response?: { data?: { detail?: string } } })?.response?.data
|
||||||
|
?.detail || "Failed to recreate tunnel";
|
||||||
|
alert(message);
|
||||||
} finally {
|
} finally {
|
||||||
setLoadingSessionId(null);
|
setLoadingSessionId(null);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user