fix(client): deduplicate concurrent OAuth refreshes - #2757
Open
CharlesMcMillan wants to merge 3 commits into
Open
fix(client): deduplicate concurrent OAuth refreshes#2757CharlesMcMillan wants to merge 3 commits into
CharlesMcMillan wants to merge 3 commits into
Conversation
🦋 Changeset detectedLatest commit: 3b205e7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Author
|
@claude review |
@modelcontextprotocol/client
@modelcontextprotocol/codemod
@modelcontextprotocol/core
@modelcontextprotocol/server
@modelcontextprotocol/server-legacy
@modelcontextprotocol/express
@modelcontextprotocol/fastify
@modelcontextprotocol/hono
@modelcontextprotocol/node
commit: |
This was referenced Sep 4, 2026
Wrap complete auth recovery in an optional provider transaction. Serialize incompatible ordinary calls without dropping their options, while code exchange and forced reauthorization continue to bypass the queue. Normalize null error descriptions only at the client parser boundary.
CharlesMcMillan
marked this pull request as draft
September 6, 2026 20:20
Author
|
@claude review |
CharlesMcMillan
marked this pull request as ready for review
September 6, 2026 20:52
Author
|
Current head 3b205e7 has one failing check: client-conformance reports sse-retry as 2 passes plus a timing warning. The isolated scenario passes locally (503 ms reconnect vs 500 ms target), while the auth scenarios pass in CI. I cannot rerun the failed job with contributor permissions (GitHub requires repository admin rights). Could a maintainer rerun job 101554954460 / run 34058603161? No test suppression or unrelated SSE changes are included. |
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.
Summary
Prevent overlapping OAuth refresh calls from redeeming the same rotating refresh token. Equivalent calls sharing a provider share one pending result; calls with different auth options are serialized and execute their own discovery and validation. Authorization-code exchanges and forced reauthorization remain distinct operations.
Hosts sharing credentials across processes can implement the optional
withAuthTransactionprovider hook. It wraps the complete auth operation, including error recovery and persistence, so hosts can release ownership in onefinallyinstead of inferring completion from individual provider callbacks. No lock spans browser consent.The client decoder also treats
error_description: nullas omitted, preserving an authorization server'sinvalid_grantclassification. The public OAuth schema stays strict.Fixes #1760. Replaces #1813. Adapter integration: nicobailon/pi-mcp-adapter#528.
Verification
5119ee7f; published CI is checked separately for each PR head.