Settings reads the login-item status once, off the main thread - #1867
Merged
Merged
Conversation
Settings asked macOS for the login-item status three times, each a synchronous XPC call on the main thread, when it opened and again on every app activation. One Sentry freeze was exactly that call. Now it takes one reading off main, and a stale reading can't overwrite a newer one or a toggle. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0126tPTsXGHmWx6EmsR32sjX
A slow status reply would otherwise park a Swift concurrency thread per read and could stall other async work. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0126tPTsXGHmWx6EmsR32sjX
r3dbars
marked this pull request as ready for review
September 25, 2026 19:42
This was referenced Sep 26, 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.
🤖 Generated with Claude Code
https://claude.ai/code/session_0126tPTsXGHmWx6EmsR32sjX
Why
Settings asked macOS for the launch-at-login status 3 times, each a synchronous XPC call (
SMAppService.mainApp.status) on the main thread. It did this when the window opened and again on every app activation while Settings exists. One real Sentry app hang (1.1.17, 8 GB Mac) was exactly this call. Item 5 in the 2026-09-25 app health audit.Product Impact
activation/ app healthWhat changed
LaunchAtLoginState: one status read gives enabled, needs-approval, unavailable and the status line (same strings as before).LaunchAtLoginController.currentState(one read) andreadState()(one read on a detached task). The oldisEnabled/needsApproval/isUnavailable/statusDescriptionkeep working on top of it.launchAtLoginstate. The window's first value is one synchronous read (was 3). Refreshes on open and on app activation read off main, with a generation counter so a stale reply can't overwrite a newer read or a toggle's failure message.How I checked it
bash scripts/dev/linux-checks.sh: 48 passedpython3 scripts/dev/check-source-pins.py --changed-only: PASS (71 pins); no test reads these namesbash build.sh --no-open/bash run-tests.sh: CIChecks I could not run, and why:
Mac or hardware test still needed? If yes:
Risk Review
Notes
Follows #1860 in the same app-health thread.
Agent handoff
`COORD_DONE: BRIEF | this PR | login-item status: 1 read, off main on refresh | none | none | linux-checks, source pins | CI + deep review
Generated by Claude Code