Commit graph

5 commits

Author SHA1 Message Date
3b1926198f Document tests with Given/When/Then comments 2026-08-20 10:51:49 +02:00
045e647ed2 Rewrite SSE view as async using redis.asyncio, fix nginx buffering
Sync generators blocked uvicorn's event loop preventing chunks from
being flushed. Converts to async generators with redis.asyncio so
streaming works correctly under ASGI. Adds /sse/ nginx location with
proxy_buffering off and 1h read timeout.
2026-05-19 09:18:36 +02:00
0a66cfcf7a Make ?feed optional in /sse/notifications/, add global stream
Without ?feed=, the endpoint subscribes to all notification channels via
Redis psubscribe("notifications:*") and adds target_feed to each event.
With ?feed=, behavior is unchanged. Updates README and root _links.
2026-05-19 09:06:44 +02:00
Andros Fenollosa
8ca15ffab9 Fix SSE heartbeat blocking issue
The SSE endpoint was using pubsub.listen() which blocks indefinitely
waiting for messages. This prevented heartbeats from being sent when
there was no activity, causing connections to timeout and close.

Changed to use pubsub.get_message(timeout=1) in a while loop, which
allows heartbeats to be sent every 30 seconds even when there are no
new notifications, keeping connections alive.

This fixes the issue where SSE connections would break and users
wouldn't receive real-time notifications.
2025-12-11 16:41:25 +01:00
Andros Fenollosa
9ccd326bea Realtime notification had been added 2025-12-05 09:13:52 +01:00