mirror of
https://github.com/bigskysoftware/htmx.git
synced 2026-02-16 04:49:56 +00:00
* Close SSE stream on visibility change to fix iOS Safari background disconnect (#3634) iOS Safari silently kills TCP connections when the app is backgrounded, leaving SSE streams dead with no error event. The new `closeOnHide` config option proactively cancels the stream reader when the page becomes hidden and reconnects when visible again (requires `reconnect: true`). Also renames `pauseInBackground` to `closeOnHide` across source, docs, types, and tests to reflect the new disconnect/reconnect behavior (previously it only paused processing). * Improve SSE closeOnHide with reconnectRequested flag and cancellable backoff - Create reader outside __parseSSE and pass as argument - Add reconnectRequested flag so visibility reconnects skip backoff delay - Symmetric visibility handler: cancel on hidden, reconnect on visible - Cancellable backoff delay via delayCanceller so tab return is instant