Skip to content

feat(desktop): log token staleness when refresh recovery fails - #3859

Merged
dgageot merged 1 commit into
docker:mainfrom
trungutt:log-token-staleness
Jul 28, 2026
Merged

feat(desktop): log token staleness when refresh recovery fails#3859
dgageot merged 1 commit into
docker:mainfrom
trungutt:log-token-staleness

Conversation

@trungutt

Copy link
Copy Markdown
Contributor

What

When the Docker Desktop backend serves an expired access token, desktop.GetToken nudges it to refresh and polls for a fresh token. Until now every outcome of that recovery was logged at Debug (or not at all), so in a default deployment the failure path — sending a request with a token we already know is expired, which the gateway will reject with a 401 — left no trace in the logs.

This promotes the abnormal paths to Warn/Info:

  • Docker Desktop returned an expired token, forcing a refresh (Warn)
  • refresh nudge failed / no fresh token in time (Warn)
  • Token refresh failed, sending a token known to be expired (Warn) — includes how long ago the token expired, which distinguishes a request racing the token's expiry (seconds) from a stuck refresher on the Desktop side (hours)
  • successful recovery (Info)

No secret material is logged: tokens are identified by a truncated SHA-256 fingerprint, so the same token can be correlated across host log files without being recoverable.

@trungutt
trungutt marked this pull request as ready for review July 28, 2026 09:50
@trungutt
trungutt requested a review from a team as a code owner July 28, 2026 09:50
@dgageot
dgageot merged commit 5964620 into docker:main Jul 28, 2026
10 of 11 checks passed
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.

2 participants