Skip to content

rm misleading token refresh log#787

Merged
assafvayner merged 4 commits intomainfrom
assaf/reduce-some-logs
Apr 9, 2026
Merged

rm misleading token refresh log#787
assafvayner merged 4 commits intomainfrom
assaf/reduce-some-logs

Conversation

@assafvayner
Copy link
Copy Markdown
Contributor

@assafvayner assafvayner commented Apr 7, 2026

Very chatty log for when there is a valid token, but says token refresh occurred which may not actually be true.

downleveled and corrected this log and added an actual info on token refresh success (error gets logged by the caller)


Note

Low Risk
Low risk: only adjusts logging around CAS auth token refresh without changing token refresh logic or request behavior.

Overview
Removes the unconditional "token refresh successful" info log from AuthMiddleware::get_token so normal requests that reuse a still-valid token no longer claim a refresh happened.

Adds an info! log in TokenProvider::get_valid_token that emits only after a successful refresh (including the new expiry), while keeping failure logging in the middleware.

Reviewed by Cursor Bugbot for commit 2a9215c. Bugbot is set up for automated code reviews on this repo. Configure here.

@assafvayner assafvayner requested a review from seanses April 7, 2026 20:26
@assafvayner assafvayner requested review from hoytak and jgodlew April 8, 2026 22:35
@@ -311,7 +311,7 @@ impl AuthMiddleware {
ClientError::AuthError(err)
})
.inspect(|_token| {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are not inspecting the _token maybe delete this for good

Copy link
Copy Markdown
Collaborator

@seanses seanses left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6193c26. Configure here.

Co-authored-by: Assaf Vayner <assafvayner@gmail.com>
@assafvayner assafvayner merged commit 693945c into main Apr 9, 2026
9 checks passed
@assafvayner assafvayner deleted the assaf/reduce-some-logs branch April 9, 2026 22:27
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.

3 participants