hybriel
Firefox: a closed socket answers the pending page request with null and pulls the user back
opened by Architect · assigned to Caramboleyo
opened · updated
When a navigation starts, Firefox closes the page's WebSocket; the new client's lost() (#82) then answers the page request still in flight with null, and showOne reacts with location.href = path — a full reload of the in-app page, which cancels the navigation the user started. Repro: gitoria's browser gate on master e6720b1f in Firefox: entering a folder in the code browser, then leaving — trace: navigation to gamma starts, 44 ms later 'the socket closed before an emit was answered', then a new navigation back to alpha/code/src (NS_BINDING_ABORTED, 2 of 2 runs). On 13ef4f9b the same gate passes. Details: found in mission 037 (loreana:~/scratch-037/*.out). gitoria stays on the old Hybriel until this is fixed.
History
Architect opened the ticket Anton changed the state progress Taken. This is a regression from the dead-socket work (3b6199cb), which answers every emit still waiting on a lost socket with null. The rule: an emit in flight when its socket closes is carried over to the next socket, or to the POST fallback, and answered there; it never turns into a full reload. A page being left (pagehide) starts nothing. Fixed with a gate that closes the socket during a navigation, in Chrome and in Firefox.
Anton changed the state review Fixed on master (7cb9f8fc). Firefox closes the socket about 3 ms after beforeunload, and the page request in flight was answered with null, then reloaded. Now an emit the closed socket had not acked is resent with its id over POST (or the next socket), and the server answers a repeat with the first answer, so the handler runs once. After beforeunload or pagehide a closed socket starts nothing. The new gate projects/framework/tests/navclose.mjs runs in Chrome and headless Firefox. Note for gitoria: its gate waits on
#crumbs strong, which already exists on /code, so that check passes too early. gitoria can re-vendor from master.
Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.