codeburn/mac/Tests/CodeBurnMenubarTests
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
..
AppStoreRefreshRecoveryTests.swift feat(menubar): mark badge when a paired device is unreachable in combined scope 2026-07-31 15:13:38 -06:00
AppVersionTests.swift Normalize menubar version display 2026-05-11 11:21:39 -07:00
CapacityEstimatorTests.swift feat(mac): native Swift menubar app + one-command install 2026-04-17 16:55:56 -07:00
ClaudeRateLimitTests.swift menubar: honor Retry-After on Claude quota 429s, back off failed refreshes (#702) 2026-07-16 14:52:47 -07:00
ClaudeSubscriptionParsingTests.swift fix(menubar): provider-correct plan tab copy; surface model-scoped weekly limits 2026-07-02 19:37:51 +02:00
CLIDevinConfigTests.swift feat: add devin provider (#444) 2026-06-09 21:58:31 +02:00
CodeBurnCacheDirectoryTests.swift perf(desktop): share cache state and eliminate duplicate cold hydration 2026-08-12 17:16:41 +03:00
CodexPlanParsingTests.swift feat(codex): show the credit limit on credit-metered ChatGPT workspaces 2026-07-27 08:19:59 -04:00
CodexQuotaSummaryTests.swift fix(codex): align credit/dollar footer formatting across desktop and menubar 2026-08-01 22:32:53 +02:00
CodexResetCreditsTests.swift menubar: surface Codex limit-reset credits (count and next expiry) in the Plan tab (#723) (#724) 2026-07-17 05:58:21 -07:00
CodexTerminalFailureTests.swift test(menubar): lock in Codex terminal-failure classification 2026-05-30 12:32:19 -07:00
ContributionHeatmapTests.swift fix(menubar-tests): add missing localModelSavings/savingsUSD args so swift tests compile (#465) 2026-06-09 21:56:13 +02:00
CredentialKeychainCacheRedTests.swift fix(menubar): migrate Claude/Codex caches to namespaced Keychain 2026-08-19 15:21:28 +05:30
CredentialKeychainContinuityTests.swift fix(menubar): keep the newer credential copy and drop the sticky retry flag 2026-08-19 11:43:32 -07:00
DataClientProcessTests.swift feat(menubar): Claude config selector, hardened (supersedes #635) 2026-07-10 01:44:51 +02:00
KimiQuotaPresentationTests.swift fix(menubar): keep showing Kimi quota when the login is idle, stamp stale data 2026-07-26 06:35:13 -07:00
KimiUsageParsingTests.swift menubar: add Kimi Code subscription quota tracking 2026-07-23 21:31:55 +02:00
LiveKeychainCredentialCacheTests.swift fix(menubar): never let a Keychain read raise UI on the refresh timer 2026-08-19 11:43:22 -07:00
MenubarPayloadCombinedTests.swift feat(menubar): add Local/Combined usage toggle (#566) (#568) 2026-06-28 22:01:01 +02:00
MenubarPeriodSettingsTests.swift fix(clients): display CLI-computed values verbatim, align period windows across app/dash/menubar 2026-07-20 06:26:15 -07:00
MenubarStatusCacheTests.swift feat(menubar): add Local/Combined usage toggle (#566) (#568) 2026-06-28 22:01:01 +02:00
QuotaPaceTests.swift menubar: linear pace on Codex quota windows — deficit/reserve, projection, run-out ETA (#726) (#728) 2026-07-20 05:21:43 -07:00
RefreshCadenceTests.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
ServeConnectionTests.swift fix(desktop): close cache and lifecycle review gaps 2026-08-12 20:31:17 +03:00
StatusItemContextMenuPolicyTests.swift test(mac): lock status-item context menu policy (#802) 2026-07-24 19:27:25 +07:00
TerminalLauncherTests.swift feat(menubar): add preferred terminal setting with Terminal.app fallback 2026-08-04 00:19:00 +03:00
UpdateCheckerTests.swift fix(menubar): clarify update failure status 2026-07-26 15:20:13 +08:00
UsageDataChangeGuardTests.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