Skip to content

v1.54.0 — gentle menu-bar polling + cache-first status (stop usage 429s)

Choose a tag to compare

@jaysonventura jaysonventura released this 25 Jun 06:22
bc29942

Stops the menu bar's /api/oauth/usage 429 (`rate limited`) state while keeping the subscription % on screen. The 429s came from event-driven bursts across multiple clients (the app's launch fetch, the status line, every cdt-menubar status), not the steady heartbeat — so this coalesces/defers those calls.

Changed

  • Cadence 5→10 min + 0–60s jitter — the % moves slowly, so no real freshness lost; jitter stops clients syncing into a burst.
  • Launch guard — defer the first live fetch on launch when the on-disk cache is already fresh (relaunching can't burst the endpoint).
  • Cache-first cdt-menubar status — reuses the menu bar's fresh reading ((cached, as of …)), only fetches live when stale/missing or --live/--fresh; a live fetch is persisted so cdt-budget / the next status get it for free.
  • New UsageCache.swift centralizes cache read/write/freshness (shared poll-interval constant + atomic write that won't clobber the status line's writer); pure freshness math unit-tested.
  • 429 back-off unchanged; monitor stays read-only on credentials (no OAuth minting). Independent security PASS + code-review APPROVE; 46 tests green.

Full diff: #27