feat(desktop): log token staleness when refresh recovery fails - #3859
Merged
Conversation
trungutt
marked this pull request as ready for review
July 28, 2026 09:50
dgageot
approved these changes
Jul 28, 2026
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.
What
When the Docker Desktop backend serves an expired access token,
desktop.GetTokennudges 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)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)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.