cosmo icon indicating copy to clipboard operation
cosmo copied to clipboard

Cosmo router is blocking the response when subscribing via SSE, until at least one message is received which causes a timeout

Open lghinet opened this issue 8 months ago • 4 comments

Component(s)

router

router version

0.222.0

What happened?

When subscribing to a subscription via SSE, cosmo router is blocking the response until at least one message is received from the subgraph which can cause a timeout if no messages are received within 1 minute. (depending on the timeout).

Cosmo router should flush right away, with a text/event-stream Content-Type even if no messages are streamed, and maintain the connection until is closed by client

lghinet avatar Jun 19 '25 10:06 lghinet

WunderGraph commits fully to Open Source and we want to make sure that we can help you as fast as possible. The roadmap is driven by our customers and we have to prioritize issues that are important to them. You can influence the priority by becoming a customer. Please contact us here.

github-actions[bot] avatar Jun 19 '25 10:06 github-actions[bot]

related to https://github.com/wundergraph/cosmo/issues/1995

lghinet avatar Jul 08 '25 05:07 lghinet

hello @endigma not sure if this issue is a duplicate, it can be solved using heartbeats but only if your client can handle them, which in my case it doesn't. I think the router should do an one time flush after the subscription is done , just to establish the connection with the client

lghinet avatar Jul 09 '25 02:07 lghinet

Sure, I'll take a closer look

endigma avatar Jul 09 '25 09:07 endigma