broadcast_sse_event is never called — live event timeline is dead #1
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: bug (feature gap masquerading as a feature)
Files:
vigilar/web/blueprints/events.py,vigilar/web/static/js/app.js,vigilar/web/templates/kiosk/ambient.htmlThe frontend subscribes to
/events/streamviaEventSourcefrom bothapp.js:59andkiosk/ambient.html:445. The server-side/streamendpoint (events.py:69) correctly hands out aqueue.Queueper client and drains it to the SSE stream. However,broadcast_sse_event(events.py:18) is never called anywhere in the codebase — no producer ever pushes events into the subscriber queues. Clients receive only the initial{"type": "connected"}message and periodic keepalives; the event timeline never updates live. A page refresh is required to see new events.Phone push via VAPID works independently and is unaffected.
Root cause: Flask runs in its own process. The events subsystem emits to MQTT (
vigilar/events/*), but nothing in the Flask app subscribes to those topics to forward them intobroadcast_sse_event.Fix sketch:
broadcast_sse_event(payload)on each message.Alternative: delete
broadcast_sse_event, the/streamendpoint, and the client-sideEventSourceusage, and document that timeline updates require a refresh.