notes
All repositories: gitoria
3.1 KB
# notes mission 005 — notes#4: offline and sync in pure Hybriel — STOPPED at a Hybriel gap**Nothing moved in the app.** notes-offline.js and sw.js stay; no app file changed. The design of report 001(rows = notes + `__hlQueue` + mine, queued faces, push, pull) cannot run on hl:web a832f73b: **a kept page with a `for`list does not boot** when that list is repainted during boot. For notes that happens on every offline reload (the keptlist is newer than the cached document) and on every load of a page whose list is derived from `__hlQueue`. The page thenshows the stale server HTML and nothing reacts: no editing, no queue, no sync. So the offline list, the core of notes#4,is blocked. Hybriel #123 #124 #125 themselves are fine (read in plugins/web: the state is kept per component, the paramfallback works, and `whoOf`/`forget` drop the copy at a face log-out).## The gap (for a hybriel ticket; Atlas → Anton)**hl:web: a `for` list repainted while the client boots throws in rebindRow (`rowKidless` is still undefined), and thepage never boots.**- Cause: `plugins/web/client.hl` calls `boot()` from the root at line 178, and `rowKidless = {}` is declared at line 1500.Members are set in root order (compiled `__run__`: `boot()` comes before `__derive__(57)` = rowKidless), so duringboot `rowKidless` is undefined. `rebindRow` (client.hl:1479) reads `rowKidless[bk]` for every row that stays → TypeError,boot aborts, `window.__hl` is never set. It is the same in hybriel HEAD 6a08821d.- Repro A `.scratch/w5/repro-rowkidless/`: an offline page, `shown = withQueue(items, __hlQueue)`, `for (r of shown)`.An online first load → `client booted (window.__hl): false`,`TypeError: Cannot read properties of undefined (reading 'page.hl|page.hl:11:33') (view.hl:1479:6)`.- Repro B `.scratch/w5/repro-rehydrate/`: a kept page with a plain `for (r of items)`, a push adds a row, CDP cuts thenetwork (page + worker), reload → `client booted: false rows: one` (the stale cached list), same TypeError.- Run: `REPRO_PORT=8731 ../../../bin/hybriel project.hl`, then `node run.mjs` (Chrome 8732–8739). README in `.scratch/w5/`.- Proposed fix: declare `rowKidless` (and any other member boot reaches) before the root's `boot()` call, or startboot after the root has run.## Also found (not a gap)- CDP `Network.emulateNetworkConditions offline` does not close a WebSocket that is already open: an emit made right afterthe cut still reached the server (prototype `.scratch/w5/proto/`). The new gate checks must therefore reload offline(the page boots from the worker, the socket cannot open) before they edit, or the "offline" edit is really online.## GateOld code, unchanged app: `NOTES_GATE_PORT=8720 NOTES_GATE_IDENT_PORT=8721 NOTES_GATE_CHROME=8722-8729 node tests/browser.mjs`→ **57 passed, 0 failed**. No new checks and no real-data run, because nothing was built. Nothing of mine is left runningon 8720–8739.## Open- notes#4 waits for this gap. When it is fixed, build the 001 design (`by` + `from` continuation on the server, copyupdated instead of a new one per save) and delete notes-offline.js and sw.js.
Branches
Latest commits
- 21c8f65dnotes mission 012: STATUSmre
- 0bbb3dd9notes mission 012: delete section of the browser gate de-flaked (openAsk: calm wait, press again when the question closes by itself); report 012mre
- f431bdf8notes mission 011: notes on the layouts theme (ListFirst shell), styles cut, check-theme gate, E2E extended; reportmre
- 1a8603d1notes mission 011 WIP: deploy.sh gate summary also matches check-theme, browser.mjs logout via the user menumre
- dae2e508notes mission 011 WIP: theme dbe3de7, shell on AppHeader/MainMenu/UserMenu/Sidebar + ListFirst, styles cut to the app's own, check-theme gate, e2e auditmre
- fd36da27notes mission 010: the note editor is the Hybriel MdEditor block (components.hybriel 1442e58, verbatim); md-editor.js, its route, script tag and offlineFiles retired; gate 66/0, realdata-offline 12/0, round-trip and Chrome E2E tests; report 010mre
- efa92170notes tests/identkit.mjs: refuse a taken ident port, cold-wait deadline, emit, identities; mission 009 reportmre
- f3dec0f1Merge branch 'w7'mre
- d1cf966dre-vendor hybriel 97bcf128: offlineFiles for the editor script, 44 px taps, 390 px offline checks, mission 008mre
- 4a610a21paths: projects moved into /media/STORAGE/projects/WorldAPI/mre
- eeaea980report 007: say which runs included the removed checkmre
- 8a8ad9banotes mission 007: report, LOG, STATUSmre
- 2cce9c96code order: plain declarations where never reassigned (letcount 0 never); gate: scan every IndexedDB at log-out, soft mode for old-code runs, drop a check that could not failmre
- 7f6a4090README: offline in Hybriel (hl:web offline, continuation, known md-editor gap); gate waits report instead of crash; realdata-offline checkmre
- 632223f2notes#4: delete notes-offline.js and sw.js (hl:web's generated worker and kept state replace them)mre
- 52a2acadgate: offline checks on hl:web's worker/queue, Chrome offline via CDP (reload offline first), one-offline conflict, log-out forgets the kept copymre
- e5785b03notes#4: the notes page in Hybriel — hl:web offline = [Notes], queued faces notesPut/notesDrop, push notesChanged, value-form notesPull on a tick; notes-offline.js/sw.js no longer loaded or routedmre
- 510aff75notes#4: server continues a run of saves of one login (by + since), loser keeps writing into its copy; notesFor listmre
- 0176c4b5mission brief 007mre
- 06cfa870notes mission 006: re-vendor hybriel 0f396652 (static), reportmre