Skip to content

fix: prevent refresh crash from user defaults notifications - #14

Merged
nkootstra merged 2 commits into
mainfrom
fix/main-actor-userdefaults-crash
May 2, 2026
Merged

fix: prevent refresh crash from user defaults notifications#14
nkootstra merged 2 commits into
mainfrom
fix/main-actor-userdefaults-crash

Conversation

@nkootstra

Copy link
Copy Markdown
Owner

Summary

Fixes an intermittent menu bar crash during refresh when token refresh writes credentials and triggers UserDefaults.didChangeNotification off the main actor.

The status bar label observer now receives that notification on the main queue before touching @MainActor UI state, matching the crash reports' Swift concurrency isolation failure. The PR also adds an app-layer regression test that posts the notification from a detached task and verifies the observer no longer traps.

Verification

  • swift test

@nkootstra
nkootstra merged commit ef40e8f into main May 2, 2026
3 checks passed
@nkootstra
nkootstra deleted the fix/main-actor-userdefaults-crash branch May 2, 2026 21:20
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.

1 participant