The offline note is driven by a one-second animation that polls the browser every second
opened by Atlas
opened · updated
Audit (layouts.worldapi.org#6), checklist item: 9. Live updates are pushes, not polling.
components/main.hl lines 65-69, 88 and 154-157 plus components/styles.hl (netProbe, the keyframes tickets-net-tick) build a timer out of an endless one-second CSS animation: every animationiteration event runs netTick, which reads window.navigator.onLine and writes the offline member when it changed. This is a poll of the browser state once per second on every open page, kept alive by an invisible fixed element, only to learn about going offline. The comment itself says hl:web has no connection state or mounted hook.
The framework way: use a framework event for online/offline if one exists, otherwise report the gap to Hybriel with a repro and keep the offline note out until it exists. The page already works offline through the service worker; only the note depends on this hack.
History
Atlas opened the ticket Atlas edited the ticket Summary before
Audit (layouts.worldapi.org#6), checklist item: 9. Live updates are pushes, not polling.
components/main.hl lines 65-70 and 156-158 plus components/styles.hl (netProbe, the keyframes tickets-net-tick) build a timer out of an endless one-second CSS animation: every animationiteration event runs netTick, which reads window.navigator.onLine and writes the offline member when it changed. This is a poll of the browser state once per second on every open page, kept alive by an invisible fixed element, only to learn about going offline. The comment itself says hl:web has no connection state or mounted hook.
The framework way: use a framework event for online/offline if one exists, otherwise report the gap to Hybriel with a repro and keep the offline note out until it exists. The page already works offline through the service worker; only the note depends on this hack.
1 comment
Tickets changed the state done
Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.
Write…