-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
P1Significant bug affecting many users, highly requested featureSignificant bug affecting many users, highly requested featureenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedgood first issueGood for newcomersGood for newcomersready for workEnough information for someone to start working onEnough information for someone to start working on
Description
Summary
The _scheduleReconnection method in StreamableHTTPClientTransport is currently private and uses setTimeout for scheduling reconnection attempts. This doesn't work well for clients that aren't running continuously (e.g., serverless functions, mobile apps that need push notifications to wake up).
Motivation
From PR #1129 review comment by @mattzcarey:
not for this PR but it would be good to be able to overwrite this method. For clients which aren't running all the time this will need some input externally from the client itself to wake it up.
Proposed Solution
Make reconnection behavior customizable, either by:
- Allowing
_scheduleReconnectionto be overridden (make it protected or provide a hook) - Accepting a custom scheduler function in the transport options
- Emitting an event when reconnection is needed, letting the client handle scheduling
Use Cases
- Serverless/edge functions that can't maintain long-running timers
- Mobile apps that need to schedule reconnection via platform-specific mechanisms (push notifications, background fetch)
- Desktop apps that need to handle sleep/wake cycles
Related
- PR feat: implement SEP-1699 SSE polling via server-side disconnect #1129: SEP-1699 SSE polling implementation
Metadata
Metadata
Assignees
Labels
P1Significant bug affecting many users, highly requested featureSignificant bug affecting many users, highly requested featureenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedgood first issueGood for newcomersGood for newcomersready for workEnough information for someone to start working onEnough information for someone to start working on