fix(ui): remove duplicate SSE connection and guard JSON.parse#16
Merged
Killea merged 1 commit intoKillea:mainfrom Mar 1, 2026
Merged
fix(ui): remove duplicate SSE connection and guard JSON.parse#16Killea merged 1 commit intoKillea:mainfrom
Killea merged 1 commit intoKillea:mainfrom
Conversation
The startSSE() function in index.html was opening two simultaneous EventSource connections: one inline handler and one via AcbSSE.startSSE(). The inline block was a leftover from before shared-sse.js was extracted. - Remove the residual native EventSource block from index.html - Keep only window.AcbSSE.startSSE() which is the canonical implementation - Add try/catch around JSON.parse in shared-sse.js to prevent client crash on malformed SSE frames
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
1. Duplicate SSE connection
startSSE() in index.html was opening two simultaneous EventSource connections:
Both connections were active simultaneously, causing every SSE event to be processed twice (double message appends, double thread refreshes, double agent polling).
The inline block was a leftover from before shared-sse.js was extracted as a module. It was never removed.
2. Unguarded JSON.parse
es.onmessage in shared-sse.js called JSON.parse(e.data) without a try/catch. A single malformed SSE frame would throw an unhandled exception, crashing the SSE listener silently.
Changes
src/static/index.html
src/static/js/shared-sse.js
Tests