mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-10-31 08:13:50 +00:00
connectSSE() overwrote sseAbortController with a new controller without aborting the previous one, so re-running setupPushNotifications (which happens per connected account and on fairly frequent effect changes) orphaned SSE streams. readSSEStream only unwinds on abort/done, so each orphan held its HTTP/1.1 socket forever; with multiple accounts this starved normal JMAP POSTs, which queued and timed out (~30s). - connectSSE: abort any prior stream (+ its ping monitor / pending reconnect) before opening a new one -> exactly one live SSE per client. - startPollingFallback: bail if a polling interval already exists. - checkForStateChanges: skip while a poll is already in flight (stateCheckInFlight) so overlapping triggers don't stack POSTs. Closes #781.