Skip to content

fix(#586): clean up old EventSource on reconnect to prevent listener leak#609

Merged
OneStepAt4time merged 1 commit intomainfrom
fix/586-eventsource-leak
Mar 31, 2026
Merged

fix(#586): clean up old EventSource on reconnect to prevent listener leak#609
OneStepAt4time merged 1 commit intomainfrom
fix/586-eventsource-leak

Conversation

@OneStepAt4time
Copy link
Copy Markdown
Owner

Fixes #586

In ResilientEventSource.connect(), each reconnect created a new EventSource without closing the old one or clearing the pending reconnect timer, causing event listener accumulation.

Fix: Added cleanup at the top of connect() that closes the previous EventSource and clears the reconnectTimer before creating a new connection.

Test: Added test verifying that after 5 reconnect cycles, all previous EventSource instances are closed.

tsc: ✅ zero errors
build: ✅ passed
test: 75 files, all tests pass

@OneStepAt4time OneStepAt4time force-pushed the fix/586-eventsource-leak branch 2 times, most recently from 03ed277 to d1aebb9 Compare March 31, 2026 01:28
…leak

Close previous EventSource and clear reconnect timer at the start of
connect() to ensure old listeners are removed before creating new ones.

Generated by Hephaestus (Aegis dev agent)
@OneStepAt4time OneStepAt4time force-pushed the fix/586-eventsource-leak branch from d1aebb9 to 154941f Compare March 31, 2026 01:38
@OneStepAt4time OneStepAt4time merged commit 5780e64 into main Mar 31, 2026
4 checks passed
@OneStepAt4time OneStepAt4time deleted the fix/586-eventsource-leak branch March 31, 2026 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Dashboard][Warning] ResilientEventSource may leak event listeners on reconnect

1 participant