Skip to content

Settings reads the login-item status once, off the main thread - #1867

Merged
r3dbars merged 2 commits into
mainfrom
claude/app-health-check-w19eqh
Sep 25, 2026
Merged

r3dbars merged 2 commits into
mainfrom
claude/app-health-check-w19eqh

Conversation

@r3dbars

@r3dbars r3dbars commented Sep 25, 2026

Copy link
Copy Markdown
Owner

🤖 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

  • Affects: settings (all users)
  • Lane: activation / app health
  • Why this matters: switching back to Transcripted can't stall on a slow login-item reply.

What changed

  • LaunchAtLoginState: one status read gives enabled, needs-approval, unavailable and the status line (same strings as before).
  • LaunchAtLoginController.currentState (one read) and readState() (one read on a detached task). The old isEnabled/needsApproval/isUnavailable/statusDescription keep working on top of it.
  • Settings keeps one launchAtLogin state. 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.
  • Toggling is unchanged: register/unregister still run when the user flips the switch.

How I checked it

  • bash scripts/dev/linux-checks.sh: 48 passed
  • python3 scripts/dev/check-source-pins.py --changed-only: PASS (71 pins); no test reads these names
  • bash build.sh --no-open / bash run-tests.sh: CI

Checks I could not run, and why:

  • Build and fast tests: cloud session, no Swift toolchain. CI builds.

Mac or hardware test still needed? If yes:

  • Optional: open Settings > General, toggle Launch at login off and on. The status line should update, and "Waiting for approval" should clear after allowing it in Login Items and switching back.

Risk Review

  • Privacy / local-first behavior reviewed (no data change)
  • Checked the text-pin tests for every file I edited
  • Storage path or migration impact reviewed (none)
  • Agent PRs got an independent deep review of the full diff (requested)
  • No private transcripts, audio, tokens, personal paths, or customer data are included

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

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
r3dbars marked this pull request as ready for review September 25, 2026 19:42
@r3dbars
r3dbars merged commit 582529a into main Sep 25, 2026
8 checks passed
@r3dbars
r3dbars deleted the claude/app-health-check-w19eqh branch September 25, 2026 19:42
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