Repository navigation
docs: tell refresh clients to refresh one request at a time - #143
Merged
aaronbrethorst merged 2 commits intoOct 11, 2026
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 58 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Member
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
aaronbrethorst
approved these changes
Oct 11, 2026
aaronbrethorst
left a comment
Member
There was a problem hiding this comment.
This matches the server's rotation and reuse-detection behavior exactly, and fixes the openapi sentence #135 missed. Clear, useful guidance for client authors.
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.
Fixes #140.
Since #135, presenting a refresh token that was already used revokes every refresh
token the user holds, with no grace window. That puts a requirement on clients that
nothing wrote down: a client that sends two refreshes with the same token ends its
own user's sessions. One request wins, the other lands on the
!rotatedbranch,and its revocation runs after the winner commits (the #129 lock), so the
replacement the winner was just given is revoked too.
This adds that to the refresh section of the README and to the
/api/v1/auth/refreshdescription in openapi.yaml: refresh single-flight, with onerefresh in flight and any request that fails meanwhile waiting for its result.
It also says plainly that a lost response can't be handled the same way, since a
retry after the server processed the refresh presents a spent token and the user
has to log in again. The README notes that the Android app's refresh-on-401
interceptor has to work this way when it is added.
It also fixes a sentence #135 missed. The operation description in openapi.yaml
still said a consumed token is "rejected and logged". It now says the token also
revokes every refresh token the user holds, which is what the 401 description
already said.
I checked each claim against auth_refresh.go: both the
UsedAt != niland the!rotatedbranches revoke, and both return the same 401.#136 also edits these two files, so I kept this away from its lines (the README's
429 bullet and openapi's 429 description).
git merge-treeagainst #136's branchmerges cleanly. Docs only. go build, go vet and go test pass, including the
openapi drift guards.