gitoria

notes

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit52d8d24252d8d242notes: e2e script checks Log out and the selector in the header instead of the user menumre52d8d242/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

  • 52d8d242notes: e2e script checks Log out and the selector in the header instead of the user menumre
  • e5abf7b7notes header: the selector alone top right plus Log out as before the theme missions; the user icon is gonemre
  • a2e343aeident selector back in the header (creator 2026-10-24): selector top right signed in and out on phone and desktop, no second Log in button, new gate checks (WIP: gates not re-run after the last edits)mre
  • b96c7f70theme: sync from layouts 4994037 (list rows stack, td word-keep, heading code, edited tap target)mre
  • 6140e6a0sessions last 99 years (creator 2026-10-23: logins never expire; only sign out ends them)mre
  • cb7e6469deploy: security gate (tests/security.mjs)mre
  • 774bf34bnotes security: CSRF guard on /api/notes, new session at login, Secure cookie, uploadMax 0, login rate limit, nosniff, face payload check; tests/security.mjs; SN reportmre
  • ef18a68fsync components.hybriel 214c318: MdEditor on a phone, two even toolbar rows of 44 px targets, label 15 px, table head 16 px (E2)mre
  • c37488b1MN report: alignment updatemre
  • 4fb35a0enotes mobile: Delete note and the delete row exactly on the editor's edges; gate asserts 1 pxmre
  • 91736270MN report and logmre
  • 15667425notes: delete confirmation buttons at most 12rem wide on the desktopmre
  • 8f7a6a95gate: MN phone checks (list header gutter, back gap, delete question)mre
  • 90c73ed3notes mobile: back link gapmre
  • 72bd4f83notes mobile: list header on the gutter, delete confirmation as a question + two equal buttons, Delete note under the editor edgemre
  • ba1e73f8notes: a sent edit is done once the server's version is not older, so a second writer's text shows in the first tab; gate: two writers both waysmre
  • c69ef9ebsync components.hybriel 134b4e3: MdEditor builds an editor put into the page at once, redraws a surface put in anew (F5, hybriel#211)mre
  • 2eb783f5sync components 9a: shared Icon (icons/icons.hl), md-editor toolbar icons + single focus ring (components f4-icons ba96735)mre
  • 4dd46dadsync-components: copy icons/icons.hl + README (F4); testsmre
  • c92e4a0ftests/e2e-outside.mjs: real-Chrome E2E, a note pushed from another device while open, then typingmre