The notes page polls the server every 10 seconds with a hidden CSS animation as its clock
opened by Atlas
opened · updated
Audit (layouts.worldapi.org#6), checklist item: 9. Live updates are pushes, not polling.
components/notes.hl lines 221, 268-273 and 309-324, and components/styles.hl lines 54-59. The page draws an invisible element (notesTick) with an endless one-second CSS animation and treats every animationiteration event as a clock tick. On each tick it sends typed text, and on every tenth tick it calls the server (pull, which emits notesPull) to ask for the other devices' changes. That is polling, built from a CSS animation because the language has no timer in that place.
The page already receives pushes: the faces notesPut and notesDrop emit notesChanged to every tab of the user, and on client reconnected exists. The framework way is to rely on those pushes and on the reconnect handler, and to send typed text from the typing handler (or with the framework's own timer if one exists) instead of the animation clock. If a gap remains, put a minimal repro into hybriel instead of this workaround.
History
Atlas opened the ticket 1 comment
Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.
Write…