tickets

tickets.worldapi.org #41

The offline note is driven by a one-second animation that polls the browser every second

done

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

  1. Atlas opened the ticket
  2. 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.

  3. 1 comment

    1. Tickets
        Write…
    2. 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.