Fix status bar crash at midnight

NSCalendarDayChanged is posted from a background queue (CoreFoundation's
__postAndResetMidnight), but MainWindowStatusBarView's handler for it was
main-actor isolated, so Swift's executor check trapped with EXC_BREAKPOINT
at 00:00 every night the app was running. The time zone and locale change
handlers have the same shape, so they get the same treatment: nonisolated,
hopping to the main actor before updating the count label. SmartFeed
already handles NSCalendarDayChanged this way.

The crash came in with the last-refresh time in the status bar (e4eefa31d).
This commit is contained in:
Dave Marquard committed 2026-10-22 10:20:39 -07:00
1 parent 59c0afe4a9
commit b17800e28f
1 file changed
+13 -6
@@ -215,16 +215,23 @@ final class MainWindowStatusBarView: NSView {
}
// The last refresh time shows the date only when it’s not today, so it changes at midnight.
@objc func handleCalendarDayChanged(_ notification: Notification) {
updateCountLabel()
// These system notifications aren’t guaranteed to arrive on the main thread.
@objc nonisolated func handleCalendarDayChanged(_ notification: Notification) {
Task { @MainActor in
self.updateCountLabel()
}
}
@objc func handleCurrentLocaleDidChange(_ notification: Notification) {
updateCountLabel()
@objc nonisolated func handleCurrentLocaleDidChange(_ notification: Notification) {
Task { @MainActor in
self.updateCountLabel()
}
}
@objc func handleSystemTimeZoneDidChange(_ notification: Notification) {
updateCountLabel()
@objc nonisolated func handleSystemTimeZoneDidChange(_ notification: Notification) {
Task { @MainActor in
self.updateCountLabel()
}
}
@objc func handleArticleThemeNamesDidChange(_ notification: Notification) {