Fix SSE keep-alive timer lifecycle in Streamable HTTP server transport (v1.x) (#2547)
This commit is contained in:
parent
bb5a718cbf
commit
e3f3daa12c
1 changed files with 1172 additions and 97 deletions
8
.changeset/sse-keepalive-timer-lifecycle.md
Normal file
8
.changeset/sse-keepalive-timer-lifecycle.md
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
'@modelcontextprotocol/sdk': patch
|
||||
---
|
||||
|
||||
Fix SSE keep-alive timer lifecycle in the Streamable HTTP server transport. Keep-alive timers are now owned by the stream they were armed for, so a stale disconnect arriving after a reconnect no longer stops the live stream's keep-alive, a resume closes the superseded stream
|
||||
cleanly, and a failed priming-event write no longer leaves a timer running or a stale request correlation behind. A resume that completes after the transport closed now gets a 404 instead of a silent stream nothing will ever write to. Non-finite `keepAliveMs` values now disable
|
||||
keep-alive, and values above 2^31-1 are clamped instead of firing every millisecond. With an event store configured, a response completing while its request stream is disconnected is now stored for `Last-Event-ID` replay and its request correlations released when the client can
|
||||
resume the stream, instead of `send()` rejecting; for clients that cannot resume (no priming event), `send()` still rejects so the failure surfaces. Replays no longer double-deliver events written concurrently with a resume, and requests racing transport close now receive a 404.
|
||||
Loading…
Reference in a new issue