simple-web-app

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 1504a1336b33a4e051a0752f8c34df3729765e5a
parent c6c96d2d8b32daa1e36c9b787f85b50bd166c751
Author: Silas Brack <silasbrack@gmail.com>
Date:   Mon,  8 Jun 2026 18:38:19 +0200

fix: filter SSE subscription by story_id

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Diffstat:
Mtemplates/story.html | 11++---------
1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/templates/story.html b/templates/story.html @@ -88,16 +88,9 @@ <script> (function() { - var storyId = {{ story.id }}; - var evtSource = new EventSource('/api/records/v1/comment/subscribe/*'); + var evtSource = new EventSource('/api/records/v1/comment/subscribe/*?filter[story_id]={{ story.id }}'); evtSource.onmessage = function(event) { - try { - var data = JSON.parse(event.data); - // Only reload if the comment is for this story - if (data.Insert && data.Insert.story_id === storyId) { - window.location.reload(); - } - } catch(e) {} + window.location.reload(); }; })(); </script>