From fc8f48906ae21a8657af261f84b613baba4e261c Mon Sep 17 00:00:00 2001 From: finxol Date: Mon, 6 Jul 2026 11:15:33 +0200 Subject: [PATCH] fixes --- apps/dashboard/src/app/onboarding/_steps/step-1.tsx | 6 +++--- .../src/components/onboarding/use-stream-checks.ts | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/dashboard/src/app/onboarding/_steps/step-1.tsx b/apps/dashboard/src/app/onboarding/_steps/step-1.tsx index c9374b0b7..b49abe25e 100644 --- a/apps/dashboard/src/app/onboarding/_steps/step-1.tsx +++ b/apps/dashboard/src/app/onboarding/_steps/step-1.tsx @@ -115,12 +115,12 @@ export function Step1({ {isLocked ? ( ) : ( diff --git a/apps/dashboard/src/components/onboarding/use-stream-checks.ts b/apps/dashboard/src/components/onboarding/use-stream-checks.ts index 2bf75b4b3..574653173 100644 --- a/apps/dashboard/src/components/onboarding/use-stream-checks.ts +++ b/apps/dashboard/src/components/onboarding/use-stream-checks.ts @@ -4,6 +4,10 @@ import type { CheckResult } from "@openstatus/services/monitor"; import { useCallback, useEffect, useRef, useState } from "react"; import { toast } from "sonner"; +// Bound the run so a stalled stream (hung fetch/prime) can never leave the +// step-1 gate disabled. Comfortably above the server's 10s per-region cap. +const STREAM_TIMEOUT_MS = 20_000; + export function useStreamChecks() { const [results, setResults] = useState([]); const [isStreaming, setIsStreaming] = useState(false); @@ -32,6 +36,7 @@ export function useStreamChecks() { setError(null); setIsComplete(false); setIsStreaming(true); + const timeout = setTimeout(() => controller.abort(), STREAM_TIMEOUT_MS); try { const res = await fetch("/api/onboarding/checks", { @@ -85,6 +90,7 @@ export function useStreamChecks() { if ((err as Error)?.name === "AbortError") return; fail(err instanceof Error ? err.message : "Stream failed"); } finally { + clearTimeout(timeout); setIsStreaming(false); setIsComplete(true); abortRef.current = null; -- 2.51.2