Skip to content

chore(autofix): Emit seer opened event when starting analysis#115595

Open
Zylphrex wants to merge 2 commits into
masterfrom
txiao/chore/emit-seer-opened-event-when-starting-analysis
Open

chore(autofix): Emit seer opened event when starting analysis#115595
Zylphrex wants to merge 2 commits into
masterfrom
txiao/chore/emit-seer-opened-event-when-starting-analysis

Conversation

@Zylphrex
Copy link
Copy Markdown
Member

Starting the analysis also opens the drawer so make sure to emit the same event.

Starting the analysis also opens the drawer so make sure to emit the same
event.
@Zylphrex Zylphrex requested review from a team as code owners May 14, 2026 19:10
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 14, 2026
Comment thread static/app/views/issueDetails/streamline/sidebar/autofixSection.tsx
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.52%

Comment on lines +317 to +327
analyticsParams={{
group_id: group.id,
has_streamlined_ui: true,
autofix_exists: false,
autofix_step_type: null,
has_summary: false,
has_root_cause: false,
has_solution: false,
has_coded_solution: false,
has_pr: false,
}}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: The issue_details.seer_opened analytics event fires on button click, even if the asynchronous operation to open the Seer drawer fails, leading to inaccurate analytics.
Severity: LOW

Suggested Fix

Move the analytics tracking to after the asynchronous operation has successfully completed. Instead of using the analyticsEventKey prop on the Button, manually fire the issue_details.seer_opened event inside the handleStartRootCause function after the await startStep(...) call succeeds.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: static/app/views/issueDetails/streamline/sidebar/autofixSection.tsx#L312-L327

Potential issue: The `Button` component has an `analyticsEventKey` prop that fires the
`issue_details.seer_opened` event immediately on click. The `onClick` handler,
`handleStartRootCause`, then calls the asynchronous function `startStep`. If this
`startStep` call fails, an error is caught, and the function returns before
`openSeerDrawer()` is called. This results in the analytics event being recorded even
when the Seer drawer fails to open, skewing analytics data.

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Copy Markdown
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.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 368d26c. Configure here.

has_pr: false,
mode: 'explorer',
referrer,
}}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seer opened event fires even when drawer doesn't open

Low Severity

The issue_details.seer_opened event is emitted via the button's built-in analytics on every click, but the drawer only opens if startStep('root_cause') succeeds. When startStep throws, the catch block returns early and openSeerDrawer() is never called, yet the "seer opened" event has already been sent. The other usage of this event (the "Open Autofix" button) calls openSeerDrawer directly, so the event always matches reality there. This will inflate "seer opened" analytics counts when analysis fails to start.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 368d26c. Configure here.

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.

1 participant