Repository navigation
fix: clear the Cursor auth-expired notice when there is no Cursor login - #412
Merged
chattymin merged 9 commits intoOct 5, 2026
Merged
Conversation
…sets Official limits are an account property, but the popover reaches them only through a provider snapshot. Week and month totals reset at their calendar boundaries, so a provider used last Friday has week = month = 0 on Monday (or after the 1st) and lost its tab and its limits section while the limits were being fetched fine (chattymin#336). Track the newest positive-token entry (lastUsage) in the shared ProviderEnrichment.local and keep the snapshot while it is within the 7-day weekly quota window. Zero-token synthetic records do not count. Extend enrichmentScanStart to cover the window and keep snapshots in provider registration order, since carriers arrive in task-completion order.
# Conflicts: # Sources/PokeTokenBar/Core/UsageStore.swift # docs/reference/defect-log.md
# Conflicts: # docs/reference/defect-log.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #411.
refreshCursorLimits()resetcursorLimitsAuthExpiredonly when a status came back. After a 401, logging out of Cursor or settingCURSOR_USAGE_API=0makesfetch()returnnilwithout throwing, so the "log in to Cursor again" notice stayed up until restart. The flag is now cleared on every non-throwing fetch. Anilresult means there is nothing left to re-authenticate. A 401/403 still sets the flag, and other errors (network, etc.) still leave it alone.Class sweep: Antigravity's
fetchis non-optional, and the Claude auth-expiry paths already reset on success or skip, so only Cursor had this gap.Type of change
UI changes
Validation
UsageStoreTests.testCursorAuthExpiredClearsWhenThereIsNoCursorLoginAnymoreuses a scripted provider: 401 first, thennil. It failed on unfixedmainand passes now.swift test --filter 'UsageStoreTests|CursorLimits': 84 tests, 0 failures.Checklist
swift buildandswift testpass locally