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 Mar 27, 2026
Conversation
… 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.
AdityaHegde
approved these changes
Mar 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DashboardStateDataLoaderderives afullTimeRangeQueryfromvalidSpecQuery. WhenvalidSpecQueryresolved,fullTimeRangeQuerywould start fetching (isLoading: true,data: undefined). The synthetic "no data" error condition onrelease-0.84had noisLoadingguard, so it evaluateddata?.timeRangeSummary?.min == nullwhiledatawas stillundefinedduring loading —undefined == nullistruein JS, firing a spurious error that rendered "Failed to load dashboard" for one frame.!fullTimeRange.isLoading &&(backport from main) andfullTimeRange.data &&to ensure the error only fires after a successful fetch that returned null time range values.Closes APP-811
Checklist:
Developed in collaboration with Claude Code