Skip to content

fix(dashboard): stop swallowing build-page load errors as 'not found' - #605

Merged
Hydralerne merged 1 commit into
oblien:mainfrom
santhiprakash:fix/build-page-load-error-state
Aug 17, 2026
Merged

fix(dashboard): stop swallowing build-page load errors as 'not found'#605
Hydralerne merged 1 commit into
oblien:mainfrom
santhiprakash:fix/build-page-load-error-state

Conversation

@santhiprakash

Copy link
Copy Markdown
Contributor

Why

On /build/:id, a successful deployment can render the ResourceNotFound screen (#604). The route is fine — the page's own notFound state is reached because loadBuildSession collapses every failure into { success: false }, and the page has exactly one branch for that. So any client-side exception during hydration (the reporter's 3-service projectType: "services" deploy, or any other throw inside the ~200-line restore) presents an existing, ready deployment as "not found".

That defeats an invariant the API deliberately establishes (deployment.controller.ts): a genuine miss is a 404 and everything else is surfaced as a 500 precisely so it doesn't get swallowed as a UI "not found" — and the client then swallows its own exceptions into exactly that UI.

What changed

  • loadBuildSession now distinguishes the two failure modes. A soft-failed status response or an HTTP 404 returns notFound: true (genuine miss); a hydration exception, a 5xx, or a network failure returns notFound: false with the error message. Classification lives in a new pure helper (classifyBuildSessionFailure) so it's unit-testable.
  • The build page renders the non-not-found arm as an error state with a retry (reusing the existing chrome.error.* copy and the shared ResourceNotFound panel), instead of "Deployment not found". A retry re-runs the load for the same deployment id.
  • An empty composeServices array no longer blanks an already-loaded service list. The API ships composeServices: [] for services-type deployments that report their services through services/serviceStatuses instead; the old Array.isArray(...) guard replaced the loaded list with []. Empty now falls back to what's already loaded, same as the absent case always did (hydrateSnapshotServices).

Verification

Test that fails without the change (load-session.test.ts, 9 new tests):

cd apps/dashboard && bun run test src/context/deployment/load-session.test.ts
  • hydrateSnapshotServices([], loaded) keeps the loaded list — with the previous inline code, the empty array produced [] (the reported blanking).
  • classifyBuildSessionFailure marks only ApiError(404) as not-found; a 500, a hydration TypeError, and a network failure all classify as load errors.

Full local verification on upstream main (00326a2e):

bun install --frozen-lockfile
cd apps/dashboard
bun run test    # 80 files, 977 tests passed (includes the 9 new)
bun run lint    # tsc --noEmit, clean

bun format was run on the touched files; the two pre-existing formatting-drift hunks in files this PR doesn't restructure were left untouched.

Fixes #604

A client-side exception while hydrating a successful build-status response
rendered the ResourceNotFound screen for a deployment that exists and finished
cleanly (oblien#604). loadBuildSession collapsed every failure into success:false and
the page had exactly one branch for it — undoing the 404-vs-500 care the
deployment controller takes on the API side.

- loadBuildSession now reports notFound only for a soft-failed status response
  or an HTTP 404; hydration exceptions, 5xx, and network failures return a load
  error instead.
- The build page renders that as an error state with a retry (existing
  chrome.error copy), keeping the deployment one click away rather than
  presenting it as deleted.
- An empty composeServices snapshot array no longer blanks an already-loaded
  service list (a services-type deploy ships composeServices: []).

Fixes oblien#604
@Hydralerne
Hydralerne merged commit eab0429 into oblien:main Aug 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Successful deployment renders as "not found" on /build/:id — the client swallows hydration exceptions into ResourceNotFound (v0.6.6)

2 participants