Skip to content

fix: transient canvas query errors when adding new components#9501

Merged
djbarnwal merged 4 commits into
mainfrom
fix/first-component-flash
May 26, 2026
Merged

fix: transient canvas query errors when adding new components#9501
djbarnwal merged 4 commits into
mainfrom
fix/first-component-flash

Conversation

@djbarnwal
Copy link
Copy Markdown
Member

Fixes transient error flashes that appeared when adding new components to an empty canvas dashboard.

New chart components could briefly issue aggregation queries before the canvas time state was fully resolved. For temporal charts, this sent fillMissing: true without a concrete time range, causing:

error rewriting to metrics query: time range is required for null fill

Tables/pivots had a similar initialization race where the pivot config could be built before the metrics-view schema was available. This caused measure fields like total_records to be temporarily classified as dimensions, producing errors such as:

invalid dimension "total_records": dimension "total_records" not found

Changes

  • Preserve unknown canvas time-series state instead of treating it as false
  • Add shared chart query gating so time-series charts wait for a resolved time range
  • Apply query gating across Cartesian, Combo, Heatmap, Funnel, Circular, and Scatter chart providers
  • Keep chart UI in a loading state while time metadata is resolving
  • Add pivot/table readiness gating so pivot queries wait for metrics-view schema and time state
  • Add a pivot query-level backstop to avoid firing aggregation requests before config is ready

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!

@djbarnwal djbarnwal requested a review from AdityaHegde May 25, 2026 16:42

const domainValues = getDomainValues();
const hasComparison = $timeAndFilterStore.showTimeComparison;
const waitingForTimeState =
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do not need a isFetching check on sources of timeAndFilterStore?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think just a check on the timeRange is fine.

Comment thread web-common/src/features/components/charts/query-util.ts
@djbarnwal djbarnwal merged commit 7a7312a into main May 26, 2026
10 checks passed
@djbarnwal djbarnwal deleted the fix/first-component-flash branch May 26, 2026 14:53
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