Repository navigation
fix: document multi-instance refresh and test replayed rotations - #44
Merged
Merged
Conversation
Two adapter instances refreshing one token at once each get the API's replayed successor and write the same refresh cookie. No adapter change was needed: the cookie holds only API-supplied fields and refresh_token_reused is already terminal and never retried. Adds tests for both and documents multi-instance deployment against the API release that ships the replay window (seamless-auth-api#613).
Bccorb
force-pushed
the
fix/concurrent-refresh-replay
branch
from
November 19, 2026 16:42
7d133d3 to
521728e
Compare
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.
Closes #42
Adapter side of M14. The API's refresh replay window (fells-code/seamless-auth-api#613, unreleased) answers concurrent refreshes of one token with the same successor.
Trace: the refresh cookie holds only
suband the API'srefreshToken, so two instances given the same R2 write the same refresh cookie. The access cookie carries the API'ssessionId. The in-process refresh sharing keeps no state that assumes one winner and its cache is 5 seconds, matching the API default. A 401 (includingrefresh_token_reused) is never cached, never retried, and clears the cookies. No adapter code change was needed.POST /auth/refresh);refresh_token_reusedclears cookies with a single upstream call.Checks: ruff check, ruff format --check, mypy, pytest (1088 passed).