Skip to content

fix: explore preview shows 404 instead of reconcile error on navigation#8994

Open
ericpgreen2 wants to merge 2 commits intomainfrom
ericgreen/fix-explore-preview-reactivity
Open

fix: explore preview shows 404 instead of reconcile error on navigation#8994
ericpgreen2 wants to merge 2 commits intomainfrom
ericgreen/fix-explore-preview-reactivity

Conversation

@ericpgreen2
Copy link
Contributor

@ericpgreen2 ericpgreen2 commented Mar 9, 2026

  • Navigating to an explore dashboard with a reconcile error showed a generic 404 instead of the actual error message
  • The preview didn't auto-recover when the underlying resource was fixed externally (e.g., fixing YAML in an external editor)
  • Root cause: the +page.ts load function eagerly fetched via fetchExploreSpec, which threw a 404 when metricsView was null (a normal state during reconcile errors); SvelteKit's error boundary then unmounted the page component and all its reactive queries
  • Fix: replaced the eager-fetch pattern with a reactive useExplore() query with polling (matching the web-admin pattern), so the component stays mounted and detects recovery
  • Extracted shared helpers (isExploreErrored, isExploreReconcilingForFirstTime, polling constants) into web-common to eliminate duplication between web-admin and web-local

Closes APP-771

Slack thread

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

Developed in collaboration with Claude Code

Replace the eager-fetch-or-fail pattern in the explore page's load
function with a reactive query pattern (matching web-admin). This fixes
two issues: navigating to a broken dashboard showed a 404 instead of
the reconcile error, and the preview didn't auto-recover when the
underlying resource was fixed externally.

Also extracts shared explore state helpers (`isExploreErrored`,
`isExploreReconcilingForFirstTime`, polling constants) from both
web-admin and web-local into `web-common/features/explores/selectors.ts`.
@ericpgreen2 ericpgreen2 self-assigned this Mar 9, 2026
@ericpgreen2 ericpgreen2 requested a review from AdityaHegde March 9, 2026 13:43
…ge flicker

Show DashboardBuilding while the explore query is pending (instead of
a blank page). Also fix a pre-existing flicker in DashboardStateDataLoader
where the time range query's loading state was incorrectly treated as a
"no data" error, causing "Failed to load dashboard" to flash briefly
before the dashboard rendered.
if (!query.state.data) return false;
if (isExploreReconcilingForFirstTime(query.state.data))
return PollIntervalWhenDashboardFirstReconciling;
return PollIntervalWhenExploreReconciling;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I dont see any difference in useExplore between cloud and local. How about moving the whole thing to selectors.ts ?

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.

2 participants