Skip to content

fix: make in-memory event replay use stored stream ids#1978

Open
Genmin wants to merge 2 commits intomodelcontextprotocol:mainfrom
Genmin:fix/in-memory-event-store-resume
Open

fix: make in-memory event replay use stored stream ids#1978
Genmin wants to merge 2 commits intomodelcontextprotocol:mainfrom
Genmin:fix/in-memory-event-store-resume

Conversation

@Genmin
Copy link
Copy Markdown

@Genmin Genmin commented Apr 29, 2026

Summary

  • Look up the stream id from the stored event metadata instead of parsing the generated event id.
  • Replay events in insertion order so events stored in the same millisecond are not reordered by the random id suffix.
  • Add regression coverage for the standalone SSE stream id used by GET streams.

Fixes #943

Tests

  • pnpm --filter @modelcontextprotocol/test-integration exec vitest run test/taskResumability.test.ts
  • pnpm --filter @modelcontextprotocol/examples-server run typecheck
  • pnpm --filter @modelcontextprotocol/examples-server run lint
  • pnpm --filter @modelcontextprotocol/test-integration run lint
  • Pre-push hook: full lint, build, and typecheck suite passed

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

changeset-bot Bot commented Apr 29, 2026

🦋 Changeset detected

Latest commit: 17fb9ec

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

@modelcontextprotocol/client

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

@modelcontextprotocol/server

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

@modelcontextprotocol/express

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

@modelcontextprotocol/fastify

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

@modelcontextprotocol/hono

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

@modelcontextprotocol/node

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

commit: 17fb9ec

@Genmin Genmin force-pushed the fix/in-memory-event-store-resume branch from e318285 to 17fb9ec Compare April 30, 2026 16:20
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.

The bug in InMemoryEventStore break SSE stream resumability

1 participant