Repository navigation
InMemoryEventStore: standalone-stream resume broken by getStreamIdFromEventId split #2560
Copy link
Copy link
Open
Labels
P2Moderate issues affecting some users, edge cases, potentially valuable featureModerate issues affecting some users, edge cases, potentially valuable featurebugSomething isn't workingSomething isn't workingready for workEnough information for someone to start working onEnough information for someone to start working onv1Issues / PRs related to v1.xIssues / PRs related to v1.xv2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixesIdeas, requests and plans for v2 of the SDK which will incorporate major changes and fixes
Description
Activity
#943 describes the same root cause and is open with
ready for workon it. Three PRs already fix it the way your second option suggests, by reading the stream id from the metadata the store already keeps for each event instead of parsing the event id:- fix: replay in-memory events for underscore stream ids #2044 against
v1.x, patchingsrc/examples/shared/inMemoryEventStore.ts, which is still the path there. It adds a regression test that stores two events on_GET_streamand asserts both the replayed stream id and the payloads. - fix: make in-memory event replay use stored stream ids #1978 and fix: resume in-memory event streams with underscored ids #1984 against
main, near identical and from the same author, which also replace the eventId sort with insertion order. Both predate Implement MCP 2026-07-28 #2286, so they patchexamples/server/src/inMemoryEventStore.ts, and that file has since moved toexamples/shared/src/inMemoryEventStore.ts.
None of the three has a review, and
getStreamIdFromEventIdonmainstill splits on the first underscore. If it helps, I can port themainside onto the moved path so there is one branch ready change per line.- fix: replay in-memory events for underscore stream ids #2044 against
- addedbugSomething isn't workingSomething isn't workingready for workEnough information for someone to start working onEnough information for someone to start working onP2Moderate issues affecting some users, edge cases, potentially valuable featureModerate issues affecting some users, edge cases, potentially valuable feature
on Aug 17, 2026 - addedv2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixesIdeas, requests and plans for v2 of the SDK which will incorporate major changes and fixesv1Issues / PRs related to v1.xIssues / PRs related to v1.x
on Aug 18, 2026
Metadata
Metadata
Assignees
Labels
P2Moderate issues affecting some users, edge cases, potentially valuable featureModerate issues affecting some users, edge cases, potentially valuable featurebugSomething isn't workingSomething isn't workingready for workEnough information for someone to start working onEnough information for someone to start working onv1Issues / PRs related to v1.xIssues / PRs related to v1.xv2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixesIdeas, requests and plans for v2 of the SDK which will incorporate major changes and fixes
InMemoryEventStore.getStreamIdFromEventIdderives the stream id witheventId.split('_')[0], which returns the empty string for any event id belonging to the standalone GET stream (its stream id_GET_streamstarts with an underscore, so generated ids look like_GET_stream_<uuid>).As a result, resuming the standalone stream with a
Last-Event-IDnever works with the shipped example store:replayEventsAfterreplays nothing and returns'', and the transport registers the successor stream under the key''instead of_GET_stream. All stored and future standalone notifications are then silently dropped while the client sits on a healthy-looking keep-alive'd stream.Pre-existing (the id format and the split predate the keep-alive work). Fix is to derive the stream id from the last separator instead of the first, or to keep an explicit eventId-to-streamId map in the store. Affects the example store on both main and v1.x; regression tests built on this store also exercise the wrong key.