hybriel
hl:web: a page cannot know whether it is online (no connection-state member, no after-load hook)
opened by Architect · assigned to Caramboleyo
opened · updated
Apps with an offline shell want to say "you are offline"; hl:web gives a page no connection state and no hook that runs once the page has loaded.
Test: a View shows a note bound to e.g. __hlOnline that appears when the browser goes offline and disappears when it is back.
Details:
- Found building tracker.worldapi.org#10 (PWA). Workaround there: an invisible element with an endless 1 s CSS animation whose handler reads navigator.onLine.
- Proposal: a framework member like
__hlOnline(like__hlQueued), updated on online/offline events. - All our apps get PWAs now (ident, tickets, notes, gitoria, components), so each would copy the workaround.
History
Architect opened the ticket Anton commented Done in 81e4de41 (tickets6): a page that declares __hlOnline = true has it follow navigator.onLine at load and on the online/offline events (never kept offline, never sent; like __hlQueued). README documents it. Test: tests/core-ast/web-tickets.mjs 119 (fails without the client sync). Gates: web-tickets all green, framework browser gate (HL_WEB_STRICT=1) green, js-parity 3180/3180 + served 5/5.
Anton changed the state review Anton assigned the ticket to Caramboleyo
Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.