Skip to content

fix(mcp): atomically replace pending OAuth connections - #476

Merged
tnunamak merged 3 commits into
mainfrom
tnunamak/oauth-pending-atomic-1024
Oct 26, 2026
Merged

tnunamak merged 3 commits into
mainfrom
tnunamak/oauth-pending-atomic-1024

Conversation

@tnunamak

Copy link
Copy Markdown
Member

Two races in #474's one-pending-connection-per-client rule. Concurrent registrations for the same client can each pass the sweep and leave many pending rows (a review reproduced 100 rows from 100 parallel requests), because the sweep and the create in connection-api.ts are separate statements. And a connection the owner approves after the sweep's snapshot can still be revoked, because the revoke is unconditional.

This makes the replace atomic and the revoke pending-only, so an approved connection is never revoked by a sweep. New tests run N parallel registrations for one client and assert exactly one pending row, and approve a connection mid-sweep and assert it survives; the single-request path is unchanged.

Server suite 2,314 pass; core 49 and IndexedDB 7 pass; typecheck, ESLint and format pass.

Draft: merging to main publishes an npm release and a Docker image. Desktop carries the same races through its own copy of #474 and picks up this fix when it repins onto main.

@tnunamak
tnunamak marked this pull request as ready for review October 26, 2026 15:44
@tnunamak
tnunamak merged commit aacc9fa into main Oct 26, 2026
4 checks passed
@tnunamak
tnunamak deleted the tnunamak/oauth-pending-atomic-1024 branch October 26, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant