Skip to content

fix: notify user when OAuth token is fully expired#15

Merged
CodeZeno merged 1 commit intoCodeZeno:mainfrom
itskolbyk:fix/token-expired-notification
Apr 19, 2026
Merged

fix: notify user when OAuth token is fully expired#15
CodeZeno merged 1 commit intoCodeZeno:mainfrom
itskolbyk:fix/token-expired-notification

Conversation

@itskolbyk
Copy link
Copy Markdown
Contributor

Problem

When the Claude Code OAuth token is fully expired and the CLI cannot refresh it automatically, the app silently shows ... and retries with exponential backoff forever. Users have no idea what's wrong or how to fix it (see issue #12).

The root cause is in window.rs where all poll errors are caught by Err(_e) — the underscore discards the error variant, so TokenExpired and a transient network failure are handled identically.

Fix

  • window.rs: Match on poller::PollError::TokenExpired specifically. Show "auth?" / "re-login" in the widget on first failure, fire a one-time Windows balloon notification with instructions, and retry every 5 minutes rather than aggressive backoff.
  • tray_icon.rs: Add notify_balloon() using the NIF_INFO / NIIF_WARNING Windows API.
  • localization/: Add token_expired_title and token_expired_body fields to the Strings struct. Currently English-only — happy to add translations if you can provide them.

Testing

To reproduce: delete or corrupt ~/.claude/.credentials.json, launch the app, and observe the tray balloon + widget text change. Run claude logout && claude login and the app recovers on the next poll.

Closes #12

@CodeZeno CodeZeno merged commit b5ae662 into CodeZeno:main Apr 19, 2026
@itskolbyk itskolbyk deleted the fix/token-expired-notification branch April 21, 2026 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(Issue) Not tracking at all

2 participants