-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
text/event-stream Requests Hang Indefinitely When Sablier is Enabled #433
Comments
Hello @jramsgz Can you give me a sample to reproduce the issue ? It should not be blocking indefinitely. Are you sure you don't get a 307 Temporary Redirect response and your SSE stream is closed on your client side ? I know we did some hacks for the Traefik plugin because the router is regenerated on every change. Meaning that scaling to zero and up regenerate the middleware and thus, kills all the connections. For that matter, we respond with a 307 to reload the same uri. If the SSE supports 307 to re-open SSE stream that might work |
Hi @acouvreur, Thank you for the response! The issue happens when the container is active, not when it’s scaled to zero. When Sablier is enabled in the active container, all text/event-stream requests remain in a pending state, which effectively blocks the SSE stream and prevents real-time updates from coming through. I haven’t tested making an SSE request when scaled to zero, only while it’s active. Let me know if there are any specific details or logs I can provide to help with troubleshooting. I’ll work on getting a sample to reproduce the issue as soon as possible. |
See https://github.com/jramsgz/sablier-sse for a sample to reproduce the issue |
Hey @jramsgz Thanks a lot for the sample, could reproduce the bug in no time thanks to your effort. There is indeed a bug because the middleware does not return a response until the underlying request is done. We should probably have a special case for that matter. I'll see if I have time to work on that :) |
Note that this should only happen with Traefik, with Caddy the stream is returned instead of wrapped. |
Describe the bug
When using Pocketbase's real-time database subscriptions (SSE - Server-Sent Events), enabling Sablier causes all text/event-stream requests to remain in a loading state indefinitely. This issue prevents real-time data updates from being transmitted, as the requests never complete or time out.
Context
Expected behavior
Server-Sent Events (SSE) should function normally, with text/event-stream requests completing and delivering real-time updates as intended.
Actual Behavior
When Sablier is enabled, all text/event-stream requests stay in a pending state, and the real-time functionality is effectively broken.
The text was updated successfully, but these errors were encountered: