Repository navigation
fix: cover concurrent refreshes across adapter instances - #46
Merged
Merged
Conversation
Add tests for two instances refreshing one token against an API with the replay window, and for refresh_token_reused staying terminal. Document multi-instance deployment.
Bccorb
force-pushed
the
fix/concurrent-refresh-across-instances
branch
from
November 19, 2026 16:42
7db10bc to
082f1b5
Compare
Merged
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 #43
Part of the M14 security work (fells-code/seamless-auth-api#603). The API adds a 5 second refresh replay window in fells-code/seamless-auth-api#613, so two adapter instances presenting the same refresh token each get a 200 with the same successor.
Trace of src/refresh.rs
refreshToken,sessionIdand claims, and each writes the same refresh cookie and an access cookie for the same session. Nothing assumes one winner, so no code change and no shared lock.refresh_token_reused, is returned as rejected, clears the access and refresh cookies, is never kept and is never retried. The kept window (5s) is within the API window.Changes
refresh_token_reusedclears cookies on both the silent refresh and POST /refresh with exactly one upstream call each.Checks
cargo fmt --check,cargo clippy --all-targets -- -D warnings(default,--no-default-features,--no-default-features --features native-tls) andcargo test(154 + 1 passed) are clean.scripts/check-manifest.shreports drift on main as well (stale bundled manifest); it is unrelated and left alone.