Skip to content

fix: prevent embed flash of "Failed to load dashboard" due to race in time range query#9132

Merged
ericpgreen2 merged 1 commit intorelease-0.84from
ericgreen/fix-embed-failed-to-load-flash
Mar 27, 2026
Merged

fix: prevent embed flash of "Failed to load dashboard" due to race in time range query#9132
ericpgreen2 merged 1 commit intorelease-0.84from
ericgreen/fix-embed-failed-to-load-flash

Conversation

@ericpgreen2
Copy link
Copy Markdown
Contributor

@ericpgreen2 ericpgreen2 commented Mar 27, 2026

  • DashboardStateDataLoader derives a fullTimeRangeQuery from validSpecQuery. When validSpecQuery resolved, fullTimeRangeQuery would start fetching (isLoading: true, data: undefined). The synthetic "no data" error condition on release-0.84 had no isLoading guard, so it evaluated data?.timeRangeSummary?.min == null while data was still undefined during loading — undefined == null is true in JS, firing a spurious error that rendered "Failed to load dashboard" for one frame.
  • Added !fullTimeRange.isLoading && (backport from main) and fullTimeRange.data && to ensure the error only fires after a successful fetch that returned null time range values.

Closes APP-811

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

… time range query

When the explore spec query resolved, the derived `fullTimeRangeQuery` store
would briefly evaluate with `enabled: true` but the underlying TanStack Query
still in its disabled state (`isLoading: false`, `data: undefined`). The
synthetic "no data" error condition used `==` (loose equality), so
`undefined?.timeRangeSummary?.min == null` evaluated to `true`, firing a
spurious error that immediately rendered "Failed to load dashboard" for one
frame before the query started fetching.

Fix by guarding the synthetic error with `!fullTimeRange.isLoading` (backport
from main) and `fullTimeRange.data &&` (new guard) to ensure the error only
fires when data has actually been fetched and returned null time range values.
@ericpgreen2 ericpgreen2 requested a review from AdityaHegde March 27, 2026 11:18
@ericpgreen2 ericpgreen2 self-assigned this Mar 27, 2026
@ericpgreen2 ericpgreen2 merged commit 6ecd455 into release-0.84 Mar 27, 2026
13 checks passed
@ericpgreen2 ericpgreen2 deleted the ericgreen/fix-embed-failed-to-load-flash branch March 27, 2026 12:04
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