-
Notifications
You must be signed in to change notification settings - Fork 1.9k
The bug in InMemoryEventStore break SSE stream resumability #943
Copy link
Copy link
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 workingfix proposedBot has a verified fix diff in the commentBot has a verified fix diff in the commentready for workEnough information for someone to start working onEnough information for someone to start working on
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 workingfix proposedBot has a verified fix diff in the commentBot has a verified fix diff in the commentready for workEnough information for someone to start working onEnough information for someone to start working on
Type
Fields
Give feedbackNo fields configured for issues without a type.
Describe the bug
The standalong sse stream Id is coded to
_GET_streamand the currentInMemoryEventStoregenerate event Ids in the format -${streamId}-${Date.now()}_${Math.random().toString(36).substring(2, 10)}The
replayEventsAfter(...)is called when client try to re-connect and resume the stream which further callsgetStreamIdFromEventId(...)-The issue is that
getStreamIdFromEventId(...)will always return an empty string as the streamId due to the current eventId format and the code will return from thisifcheck.To Reproduce
Steps to reproduce the behavior:
Expected behavior
MCP client should be able to re-connect to SSE stream.
Fix
The fix could be to use a different delimiter than underscore when combining streamId with rest of the eventId.
Used dash("-") in below sample fix -