Skip to content

fix: avoid duplicate SSE close callbacks#1986

Open
Genmin wants to merge 3 commits intomodelcontextprotocol:v1.xfrom
Genmin:fix/v1x-sse-close-once
Open

fix: avoid duplicate SSE close callbacks#1986
Genmin wants to merge 3 commits intomodelcontextprotocol:v1.xfrom
Genmin:fix/v1x-sse-close-once

Conversation

@Genmin
Copy link
Copy Markdown

@Genmin Genmin commented Apr 29, 2026

Summary

  • guard the SSE response close handler so programmatic close() does not fire onclose twice
  • add a real HTTP regression test covering close() ending the SSE response

Fixes #321

Validation

  • npm test -- test/server/sse.test.ts -t "should only call onclose once"
  • npm test -- test/server/sse.test.ts
  • npm run typecheck
  • npm run lint
  • npm test
  • npm run build

@Genmin Genmin requested a review from a team as a code owner April 29, 2026 23:54
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 29, 2026

🦋 Changeset detected

Latest commit: 1c9fe2c

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

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 Apr 29, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@modelcontextprotocol/sdk@1986

commit: 1c9fe2c

@Genmin
Copy link
Copy Markdown
Author

Genmin commented Apr 30, 2026

Added the missing patch changeset for the v1.x SDK package so the release-metadata blocker should clear on the next checks run. The code checks were already green before this metadata-only update.

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.

1 participant