Files
SRCmail/lib/jmap
dealerweb 00dc509e60 Fix: treat an aborted SSE connect as a close, not a failure
Since the per-account push setup (#281), every account switch tears down
and re-creates push notifications for all connected clients. Aborting an
SSE connect that is still in flight lands in the fetch rejection handler,
which treated it as a network failure:

- fallbackToPolling() started an unsupervised 3s state poll on a client
  whose push had just been intentionally closed, after the cleanup that
  would have removed it had already run.
- The late rejection also nulled sseAbortController, orphaning the
  replacement connection set up right after: it could never be aborted
  again and reconnected itself in parallel once the server closed it.

Rapid switching multiplied both effects until the server's concurrency
limit stalled the app entirely.

Each connect attempt now tracks its own AbortController: an aborted
attempt returns silently instead of falling back to polling, and the
end-of-stream reconnect only fires if the stream is still the current
one. Regression tests simulate the switch churn both ways.
2026-07-23 14:34:32 +02:00
..