Skip to content

fix(client): dedupe concurrent OAuth refreshes#1800

Open
raashish1601 wants to merge 1 commit intomodelcontextprotocol:mainfrom
raashish1601:contributor-15/typescript-sdk-1760-refresh-dedupe
Open

fix(client): dedupe concurrent OAuth refreshes#1800
raashish1601 wants to merge 1 commit intomodelcontextprotocol:mainfrom
raashish1601:contributor-15/typescript-sdk-1760-refresh-dedupe

Conversation

@raashish1601
Copy link
Copy Markdown

Summary

  • dedupe in-flight refreshes per provider, authorization server, resource, and refresh token inside auth()
  • reuse the shared refresh result so parallel callers do not replay rotating refresh tokens
  • add a focused auth regression and a patch changeset for @modelcontextprotocol/client

Fixes #1760.

Validation

  • corepack pnpm test -- --run test/client/auth.test.ts
  • corepack pnpm exec tsgo -p tsconfig.json --noEmit
  • corepack pnpm exec eslint --config eslint.config.mjs src/
  • corepack pnpm exec prettier --ignore-path ../../.prettierignore --check src/client/auth.ts test/client/auth.test.ts

@raashish1601 raashish1601 requested a review from a team as a code owner March 27, 2026 22:21
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 27, 2026

🦋 Changeset detected

Latest commit: a059ef1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@modelcontextprotocol/client Patch

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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 27, 2026

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/client@1800

@modelcontextprotocol/server

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/server@1800

@modelcontextprotocol/express

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/express@1800

@modelcontextprotocol/hono

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/hono@1800

@modelcontextprotocol/node

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/node@1800

commit: a059ef1

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.

Race condition in auth() causes refresh token invalidation when rotating tokens are used

1 participant