Resources: subscriptions/listen model on modern servers (era fork) (#1630) (#1730)

Fork resource subscriptions by protocol era: legacy keeps resources/subscribe; modern (2026-07-28) models subscriptions as a filter over one long-lived subscriptions/listen stream with reconnect-by-re-listen (capped backoff), an optimistic Connecting→Listening header badge, and a fix so the browser proxy no longer blocks listen() ~60s. Closes #1630.
This commit is contained in:
Cliff Hall 2026-07-20 19:33:40 -04:00 • committed by GitHub
commit 320daf2f67
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -96,6 +96,15 @@ function requestIdForMessage(
message.id !== null &&
message.id !== undefined
) {
// `subscriptions/listen` (modern era, #1630) is a long-lived stream request
// with no JSON-RPC response — it's answered by a
// `notifications/subscriptions/acknowledged` (delivered over the SSE event
// channel) and, only on graceful close, an empty result. Waiting on a
// response here would time out `send()` and, via the SDK's `listen()`,
// spuriously drive the stream's `closed`/reconnect. Don't wait.
if (message.method === "subscriptions/listen") {
return undefined;
}
return message.id;
}
return undefined;