codeburn/mac/Sources/CodeBurnMenubar
iamtoruk 0fd8419bfd fix(menubar): keep the newer credential copy and drop the sticky retry flag
Three fixes in the store read path.

A locked keychain no longer reads as a disconnect. currentRecord() treated
any failure from readOurCache() as fatal, and a nil as "the item vanished",
which cleared isBootstrapCompleted. .unavailable now falls back to the last
known record and leaves the flag set.

Recency. A Keychain hit always won and the legacy file was then unlinked,
even when the file was newer. This service name has been in use since May
2026, so an upgrading install can hold a months-old item beside a file the
pre-migration build wrote today; the older token won and the newer copy was
deleted. Both stores now compare first (expiresAt for Claude, lastRefresh for
Codex) and adopt the later one before anything is removed. Codex matters most
here: serving a spent rotating refresh token ends in a terminal invalid_grant.

lastLegacyCleanupFailed is gone. It was set on every cleanup path and read
only by tests, never surfaced. The retry it was meant to signal already
happens, because the unlink is attempted on every successful read.

Also serializes migrate + unlink under the existing SafeFile.withExclusiveLock
so two menubar instances cannot race on the same legacy file, and drops a
leftover no-op local.
2026-08-19 11:43:32 -07:00
..
Data fix(menubar): keep the newer credential copy and drop the sticky retry flag 2026-08-19 11:43:32 -07:00
Security fix(menubar): never let a Keychain read raise UI on the refresh timer 2026-08-19 11:43:22 -07:00
Theme Harden menubar: fix refresh loop, concurrency, data sync, and edge cases 2026-05-01 08:01:25 -07:00
Views fix(menubar): migrate Claude/Codex caches to namespaced Keychain 2026-08-19 15:21:28 +05:30
AppStore.swift fix(menubar): fail closed on leftover JSON and partial Disconnect 2026-08-19 20:56:07 +05:30
AppVersion.swift Normalize menubar version display 2026-05-11 11:21:39 -07:00
CodeBurnApp.swift mac: register the login item with SMAppService 2026-08-18 07:48:03 -07:00
CurrencyState.swift perf(desktop): share cache state and eliminate duplicate cold hydration 2026-08-12 17:16:41 +03:00
MenubarScope.swift feat(menubar): add Local/Combined usage toggle (#566) (#568) 2026-06-28 22:01:01 +02:00
RefreshCadence.swift menubar: skip unchanged background refreshes, 120s AC idle cadence, utility QoS for tick spawns (#703) (#704) 2026-07-16 15:11:25 -07:00
StatusItemContextMenuPolicy.swift test(mac): lock status-item context menu policy (#802) 2026-07-24 19:27:25 +07:00