fix(core): preserve relatedRequestId 0 in debounce guard#2135
fix(core): preserve relatedRequestId 0 in debounce guard#2135kiranmagic7 wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 69db244 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
@modelcontextprotocol/client
@modelcontextprotocol/codemod
@modelcontextprotocol/core
@modelcontextprotocol/server
@modelcontextprotocol/server-legacy
@modelcontextprotocol/express
@modelcontextprotocol/fastify
@modelcontextprotocol/hono
@modelcontextprotocol/node
commit: |
ab47799 to
5d11cba
Compare
|
Rebased this on current main (head
GitHub checks have now completed successfully on the refreshed head. |
5d11cba to
2b6b644
Compare
|
Rebased this on current Local verification after the rebase: GitHub now reports the branch as mergeable again; checks are running on the refreshed head. |
|
Friendly follow-up: this still looks ready for maintainer/code-owner review. Latest head |
2b6b644 to
72f0af9
Compare
|
Rebased this on current Local verification after the rebase: GitHub checks should restart on the refreshed head. |
72f0af9 to
6da1da1
Compare
|
Rebased this on current Local verification after the rebase: GitHub checks should restart on the refreshed head. |
6da1da1 to
cb7b48d
Compare
|
Rebased this on current Local verification after the rebase: GitHub checks completed successfully on the refreshed head: 13/13 visible checks passing. |
cb7b48d to
ae8e282
Compare
|
Rebased this on current Local verification after the rebase: GitHub checks completed successfully on the refreshed head: 13/13 visible checks passing. |
ae8e282 to
2771a65
Compare
|
Rebased this on current No logic change — rebase only. Waiting on required review. |
2771a65 to
6916938
Compare
|
Rebased on current Focused verification on the refreshed head: GitHub checks should restart on the refreshed branch. |
|
Current status check on head Review focus is still the narrow debounce-guard behavior: preserve |
6916938 to
48a32db
Compare
|
Rebased this on current Validation on the refreshed head: The PR-visible diff is still limited to the debounce guard, the regression test, and the patch changeset. |
48a32db to
a108cf1
Compare
|
Rebased on current Upstream moved the protocol implementation/tests into Validation on the refreshed head: GitHub checks are running on the refreshed branch. |
a108cf1 to
69db244
Compare
|
Rebased on current Local verification on the refreshed head: Hosted checks are green on this head as well: build, test (20/22/24), e2e (20/22/24), runtime tests, conformance, examples, pkg-publish, and Continuous Releases all passed. |
What changed
relatedRequestIdas present unless it isundefinedwhen deciding whether a notification can be debounced.relatedRequestId: 0.@modelcontextprotocol/core.Why
0is a valid MCP/JSON-RPC request id. The previous truthiness check treatedrelatedRequestId: 0as absent, so simple request-associated notifications could be coalesced by the debounce path while non-zero ids were sent immediately.Fixes #2117.
Tests
pnpm --filter @modelcontextprotocol/core exec vitest run test/shared/protocol.test.ts -t "relatedRequestId 0"— passespnpm --filter @modelcontextprotocol/core exec vitest run test/shared/protocol.test.ts— 151 tests passpnpm --filter @modelcontextprotocol/core test— 553 tests passpnpm --filter @modelcontextprotocol/core typecheck— passespnpm --filter @modelcontextprotocol/core lint— passespnpm changeset status --since origin/main— reports@modelcontextprotocol/corepatch bumpCompatibility / risk
Small behavior fix only: notifications already associated with non-zero request ids bypass debounce; this makes request id
0follow the same path. Notifications without a related request id remain debounced as before.