Skip to content

feat(occurrence): Add per-thread frame detection selection#90

Merged
Zylphrex merged 4 commits into
mainfrom
txiao/feat/prioritize-main-thread-on-cocoa
Jun 8, 2026
Merged

feat(occurrence): Add per-thread frame detection selection#90
Zylphrex merged 4 commits into
mainfrom
txiao/feat/prioritize-main-thread-on-cocoa

Conversation

@Zylphrex

@Zylphrex Zylphrex commented Jun 4, 2026

Copy link
Copy Markdown
Member

Replace the boolean active_thread_only on the frame detection options with a DetectionThread enum (ActiveThread, MainThread, AllThreads) so detectors can express thread selection explicitly. Switch the cocoa detectors to run on the main thread, resolving it via a new ProfileInterface::get_main_thread_id and falling back to the active thread when no main thread is found.

Replace the boolean active_thread_only on the frame detection options with
a DetectionThread enum (ActiveThread, MainThread, AllThreads) so detectors
can express thread selection explicitly. Switch the cocoa detectors to run
on the main thread, resolving it via a new ProfileInterface::get_main_thread_id
and falling back to the active thread when no main thread is found.

Co-Authored-By: Claude <noreply@anthropic.com>
@Zylphrex Zylphrex requested a review from a team as a code owner June 4, 2026 21:21

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 8d05a71. Configure here.

Comment thread src/occurrence/detect_frame.rs
Comment thread src/occurrence/detect_frame.rs
Zylphrex and others added 3 commits June 4, 2026 17:41
Cocoa frame detection resolves the main thread id, but SampleProfile::call_trees
only built trees for the active thread. When the main thread differs from the
active thread, detect_frame found no trees and detected nothing. Build trees for
the main thread in addition to the active thread.

Also fix clippy::unnecessary_sort_by by switching to sort_by_key.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ection

DetectionThread::MainThread previously fell back to the active thread when
no main thread could be resolved, causing detection to run on the wrong
thread. Make MainThread strict: only run when a main thread is resolvable,
otherwise produce no occurrences.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Zylphrex Zylphrex merged commit b0af461 into main Jun 8, 2026
16 checks passed
@Zylphrex Zylphrex deleted the txiao/feat/prioritize-main-thread-on-cocoa branch June 8, 2026 16:47
Zylphrex added a commit to getsentry/sentry that referenced this pull request Jun 8, 2026
This includes getsentry/vroomrs#90 which ensures that cocoa issues are
only detected on the main thread.
amy-chen23 pushed a commit to getsentry/sentry that referenced this pull request Jun 10, 2026
This includes getsentry/vroomrs#90 which ensures that cocoa issues are
only detected on the main thread.
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