Skip to content

fix(metric-issue): Defer chart request until open period has loaded#109425

Merged
malwilley merged 1 commit intomasterfrom
malwilley/defer-chart-loading
Feb 26, 2026
Merged

fix(metric-issue): Defer chart request until open period has loaded#109425
malwilley merged 1 commit intomasterfrom
malwilley/defer-chart-loading

Conversation

@malwilley
Copy link
Member

The open period, when it loads, may (and most often does) change the selected time range. To avoid the chart loading twice, this waits for the open period to be loaded before firing the request.

@malwilley malwilley requested review from a team as code owners February 26, 2026 00:59
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Feb 26, 2026
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable autofix in the Cursor dashboard.

});

if (isLoading) {
if (isOpenPeriodPending || isLoading) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Chart can stall without selected event

Medium Severity

useEventOpenPeriod is now gated through isOpenPeriodPending, and useMetricDetectorChart is disabled while pending. When event is undefined, useEventOpenPeriod is created with enabled: false, which leaves React Query in a pending state, so isOpenPeriodPending || isLoading keeps metricIssueChart.tsx in the placeholder indefinitely.

Fix in Cursor Fix in Web

Copy link
Member

Choose a reason for hiding this comment

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

this does sound somewhat legit, but i think we're waiting anyway?

@malwilley malwilley merged commit b7d3f6c into master Feb 26, 2026
61 checks passed
@malwilley malwilley deleted the malwilley/defer-chart-loading branch February 26, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants