gitoria

notes

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit23758cd623758cd6Re-vendor complete Hybriel plugins and runtime to day44mre23758cd6/reports/012-deflake-delete.md

3.7 KB

  1. # Report 012 — the delete section of the notes gate de-flaked (worker E4, branch w12-deflake from f431bdf)
  2. **Verdict: the cause is a state revert in the page, not a layout race — and it is NOT the phone pane switch (the section runs at 1280 px). Fixed in the gate (tests/browser.mjs only); the app side is NOT fixed (cause is in the framework's ack handling, see "Open").**
  3. ## 1. Reproduction (`NOTES_GATE_UNTIL=delete`, one delete section ≈ 2 min, load 2–9, no load generators)
  4. Unmodified f431bdf, 12 runs: **3 failed (25 %)**: 3× "back to the list, one note less" (the `#deleteyes` press missed). Instrumented copies (MutationObserver +
  5. capture listeners + WebSocket frame log, installed just before the clicks) over ~40 more runs failed ≈ 20–25 % too, in three shapes:
  6. `click: #deleteno has no layout box (not visible)` (the reported one, 3×), `delete question` never shown (4×), `back to the list` (the Delete press hit FOOTER).
  7. State at failure (identical every time): the Delete button is the SAME node, the editor is not re-rendered, `#deleteask` goes `ask` → `ask open` on the click, and
  8. **14–50 ms later, with no click, back to `ask`** (class written twice) — `#deleteyes/#deleteno` have no box (display:none) so the next click finds nothing (or the layout
  9. below shifts and the press lands on the footer). Right at that moment a WebSocket ack `{i:7, ok:true, sync:{components/notes.hl:{notes,session,signedIn,signedOut}}}`
  10. for an emit sent BEFORE the click arrives (log: `WS<` 1 ms after the class write). So: not "not rendered yet", not hidden behind the ListFirst pane (width 1280),
  11. not a replaced element — the page's `asking` is set back to false by a late ack of an earlier emit (a push/pull).
  12. After the fix every one of 20 runs logged exactly one revert: the first "Delete note" press after opening the note is undone **every time** in this gate; whether the gate
  13. fails depends only on whether the revert lands before or after its next click.
  14. ## 2. Decision
  15. A real (small) app/framework defect: a person who presses "Delete note" within the ~50 ms–100 ms after a late ack sees the question flash and vanish and presses again;
  16. nothing is lost or deleted wrongly, and a human rarely clicks that soon after opening a note, so it is not a blocker. I found no .hl change that is certain to prevent it:
  17. the ack carries no `asking` key, the handlers never write `asking` outside open()/keep/drop, so the reset comes from how the client applies the ack's `sync` patch (Hybriel
  18. runtime) — I did not touch the framework and wrote no JS workaround. Not fixed in .hl → **open item for Atlas / a Hybriel ticket** (minimal facts above; log
  19. format in /media/STORAGE/claude-scratch/atlas/E4/logs/e3-4.log, e4-7.log).
  20. ## 3. Fix (test) and proof
  21. tests/browser.mjs: `openAsk(page, label)`: press "Delete note", wait (polling every 60 ms, no fixed sleep) until the question has stayed visible for 8 samples (~0.5 s, the
  22. calmClick rule); if it was open and closed again by itself, press again (what a person does), up to 4 times, printing a line when it had to. Used for both openings.
  23. - Before (f431bdf, delete section only): **3 / 12 failed** (+ the deploy failure); instrumented copies ≈ 20 %.
  24. - After: **20 / 20 passed** (2 parallel loops × 10, delete section), each logging one "closed by itself, pressing Delete again — attempt 2" (so the gate fails on neither
  25. and also shows the revert is real; on old code the same state kills the run).
  26. - Full gate: **66 passed, 0 failed**. realdata-offline (newest notes backup copy, deleted after): **12 passed, 0 failed**.
  27. - No screenshots: no UI change (test only).
  28. Ports 8700–8729 used; logs in /media/STORAGE/claude-scratch/atlas/E4/logs/ (baseA*, d2/d3/e3/e4 = instrumented, af1/af2 = after, full.log, realdata.log). At the end nothing of mine listens.

Branches

Latest commits

  • 23758cd6Re-vendor complete Hybriel plugins and runtime to day44mre
  • 5d7cc700Backup tar: --hard-dereference, so mpackdb sidecars are never stored as hard links (Tracker's finding)mre
  • 3e07b1cfVendor complete Hybriel day39 plugin sources and librariesmre
  • d7366702Check session cookie flags after login and assert anonymous GET stays cookielessmre
  • 16bc8fd8Re-vendor Hybriel day38b with the mpackdb store-open race fixmre
  • d860dc2dnotes#12: the markup names its own rules instead of hand-written class strings: the selected row is `aria-current="page"` (the list-first theme rule styles it, no class), the delete question is `Style.pAsk` and follows its own `open` attribute (bound to `asking`), the error line is `Style.pMessage` (body once in lib/looks.hl, rule in notes.hl, main.hl and loginfailed.hl). The CSS declarations are the same, only selectors changed (.ask -> p.ask, .ask.open -> p.ask[open], .message -> p.message); the pages look the same (AE 0 at 4 sizes). main.hl's selectorClass in/out stays (login.js reads it).mre
  • 2e7f8664notes#13: the list and back links pass the note key from the loop (emit pick(e, r.key)) instead of writing data-note into the View and reading it back with getAttribute; the two window.history.replaceState calls and the identcode e.target.value read stay (hl:web has no replace-navigation, a bound hidden input is not adopted on a script's change event), see NO13 reportmre
  • 4dc98282notes#15: a deleted note made in this tab leaves the list at once (the delete now removes this tab's edit under every key the row has: local id, server id); gate: browser.mjs notes#15 section, red on the old codemre
  • e4e7402fnotes#11: plain declarations instead of let for variables never reassigned (components/notes.hl 3, lib/jsoncheck.hl 5, lib/util.hl 2, tools/migrate-short-ids.hl 8)mre
  • 27b6a09enotes#8: Style blocks in the nested form (note-list, note-editor, .ask with their children nested, :empty as a nested pseudo-class); the same CSS rules, the pages look the samemre
  • 71a9538bnotes: B27W report, log linemre
  • 78ba0073notes: an ident access key (Authorization: Bearer idt_…) reads and writes its identity's notes through /api/me and /api/notes; gate tests/ident-access-notes.mjs (ident#27)mre
  • 3de46dacnotes: the sign-in callback keeps the session it finds and signs it in (same cookie, nothing signed out; ident#28); security gate 73+5 failing → 78 passedmre
  • 5909d458notes: MdEditor from components 59704ce (text on the clipboard always pastes, a file manager copy still attaches; pipe rows without a delimiter row; tickets#49, notes#5)mre
  • 98bd6a98N5b: pipe rows without a delimiter row are a table (MdEditor ad4e929, plain copy); gate tests/dashboard-table.mjs; reportmre
  • dbf93319N5 report: components gate rerun 613 passed, 0 failedmre
  • 3a8bc0d2N5: empty Table-button table is written as a real pipe table (MdEditor 4bd1112, plain copy); gate tests/table-button.mjs; reportmre
  • c16bd443N5: step 1 report (tables pass locally; his DASHBOARD note has no delimiter row)mre
  • 6091320anotes: MdEditor 7437e32 (surface drawn at once when the page is claimed); gate measures claim-to-text on 5 note loads at 1280 and 390mre
  • 0aa9277enotes: move each component's styles into its own Style block (shell and header selector in main.hl, list, editor frame and delete question in notes.hl); styles.hl keeps the theme inherit, the accent and the message colour; .gitignore ignores a bin symlink too; tests/shots.mjs for the pixel comparemre