Skip to content

fix(core): preserve zero related request IDs#2493

Closed
franekmat wants to merge 1 commit into
modelcontextprotocol:mainfrom
franekmat:fix/related-request-id-zero-debounce
Closed

fix(core): preserve zero related request IDs#2493
franekmat wants to merge 1 commit into
modelcontextprotocol:mainfrom
franekmat:fix/related-request-id-zero-debounce

Conversation

@franekmat

Copy link
Copy Markdown

Summary

  • treat only an undefined relatedRequestId as absent when deciding whether a notification can be debounced
  • add a same-tick regression proving two notifications associated with JSON-RPC request ID 0 are both sent
  • add patch changesets for the affected client, server, and core packages

Fixes #2117.

Verification

  • Regression test fails on unmodified origin/main with one send instead of two.
  • pnpm --filter @modelcontextprotocol/core-internal exec vitest run test/shared/protocol.test.ts -t 'relatedRequestId 0 in the same tick' passes with the fix.
  • pnpm --filter @modelcontextprotocol/core-internal check passes.
  • pnpm lint:all passes.
  • pnpm test:all: all test files passed on the second run, but Vitest exited non-zero because the existing protocol:timeout:max-total [sse 2025-11-25] E2E left two unhandled timeout rejections. Its direct targeted rerun passed (1 test, 411 skipped).

@franekmat franekmat requested a review from a team as a code owner July 14, 2026 12:58
@changeset-bot

changeset-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 01f75bf

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

This PR includes changesets to release 6 packages
Name Type
@modelcontextprotocol/client Patch
@modelcontextprotocol/server Patch
@modelcontextprotocol/core-internal Patch
@modelcontextprotocol/core Patch
@modelcontextprotocol/server-legacy Patch
@modelcontextprotocol/codemod 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

pkg-pr-new Bot commented Jul 14, 2026

Copy link
Copy Markdown

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/@modelcontextprotocol/client@2493

@modelcontextprotocol/codemod

npm i https://pkg.pr.new/@modelcontextprotocol/codemod@2493

@modelcontextprotocol/core

npm i https://pkg.pr.new/@modelcontextprotocol/core@2493

@modelcontextprotocol/server

npm i https://pkg.pr.new/@modelcontextprotocol/server@2493

@modelcontextprotocol/server-legacy

npm i https://pkg.pr.new/@modelcontextprotocol/server-legacy@2493

@modelcontextprotocol/express

npm i https://pkg.pr.new/@modelcontextprotocol/express@2493

@modelcontextprotocol/fastify

npm i https://pkg.pr.new/@modelcontextprotocol/fastify@2493

@modelcontextprotocol/hono

npm i https://pkg.pr.new/@modelcontextprotocol/hono@2493

@modelcontextprotocol/node

npm i https://pkg.pr.new/@modelcontextprotocol/node@2493

commit: 01f75bf

@franekmat

Copy link
Copy Markdown
Author

Closing as a duplicate

@franekmat franekmat closed this Jul 14, 2026
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.

relatedRequestId 0 is treated as absent by notification debounce guard

1 participant