gitoria

calendar

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitcf175c80cf175c80calendar mission 008 (A7): re-vendor Hybriel master 0e3c9830 (bin 9d957fed, plugins whole: hl:crypto Web Push primitives, hl:web sendPush)mrecf175c80/reports/003-notifications-never-fired.md

8.4 KB

  1. # Report 003 (w3): calendar#9, event notifications never fired once
  2. **Verdict:** the reminders could only fire inside an open page that is in front and was touched since it loaded. On a
  3. phone that is almost never the case at the reminder time. A closed, frozen or dropped app was never reached, and a
  4. reminder missed that way was lost for good. Closed-app delivery needs **Web Push, which Hybriel does not have (gap, STOP)**.
  5. The open-app path is fixed: missed reminders show when the app is back, and the timers are set again whenever it is shown.
  6. **Where:** branch w3 in /media/STORAGE/claude-scratch/atlas/R/wt (from main c6809c7 = live). Commits: `31ffe91` (fix + gate +
  7. README), then the docs commit with this report. Not pushed, not deployed. No `.env` read (the backup tgz holds one: deleted
  8. from my copy unread). bin/ unchanged (hybriel 06617221). Ports 8700–8719 only. Every process I started was stopped. At the
  9. end `ss` showed nothing of mine listening.
  10. ## Cause, with evidence
  11. 1. **Only an open page that is in front could fire a reminder.** `arm()` (month-view.hl) sets browser `setTimeout`s.
  12. - Nothing runs on the server.
  13. - The service worker (hl:web's) has no scheduler and no `push` listener.
  14. - Chrome on Android freezes a page it switched away from (its timers stop) and later drops it.
  15. - **Real data** (copy of deploy-backups/calendar.worldapi.org-20261019-0621.tgz): one user, az5b2 = users `0muh8y8myb5z`.
  16. - 7 events, none with its own `$reminders`, settings empty → the defaults: 1 h before and the day before at 20:00.
  17. - That gives 8 reminder times from 1 to 14 Oct (Europe/Vienna):
  18. | event | reminder times |
  19. |---|---|
  20. | Friseurin, 10-02 14:00 | 10-01 20:00 · 10-02 13:00 |
  21. | Federico, 10-02 16:00 | 10-01 20:00 · 10-02 15:00 |
  22. | Fliesenleger, 10-09 15:00 | 10-08 20:00 · 10-09 14:00 |
  23. | REISEPASS, 10-14 13:15 | 10-13 20:00 · 10-14 12:15 |
  24. - Each would have needed the app open, in front and touched at that minute.
  25. - The backup holds only one signed-in session (created 10-15 09:23, last seen 10-16 17:52). There are no client logs, so
  26. whether his phone ever granted the permission cannot be read.
  27. 2. **Even open, nothing was planned until the first touch.**
  28. - `browserEnv()` (the clock, permission, time zone, then `arm()`) runs only on the first pointerover / focusin / touchstart
  29. on the month view.
  30. - Gate, old code: open and untouched → planned text "", no notification. "Turn on notifications" stays hidden until a touch.
  31. - hl:web has no hook for "page shown" (gap 2 below).
  32. 3. **A missed reminder was dropped.** `plan()` only takes reminders still to come (`at > now`).
  33. - Old code, tab dropped while away and opened again before the event → nothing.
  34. - Closed, then opened again before the event → nothing.
  35. 4. **Switched away and back in the same tab:** the paused timer fires late, on resume. Old runs: 61 s late (back after 60 s);
  36. 31 s late (back after 30 s); once not within 15 s.
  37. 5. **Not the cause: the notify path.**
  38. - hl:web `notify` uses `registration.showNotification` when a worker registration exists. The calendar has `offline`, so
  39. it always does. In every run the recorder saw `via: worker`.
  40. - Android's refusal of `new Notification()` only hits hl:web's fallback (no registration), which never ran.
  41. - A real tap on "Turn on notifications" asks the browser inside the user gesture (`userActivation.isActive` true).
  42. 6. **Why #4 passed review:** `tests/browser.mjs` grants the permission by CDP, moves the mouse before every step and keeps the
  43. tab in front. Not one of the phone's conditions.
  44. ## Fix (Hybriel only, `components/month-view/`)
  45. - `arm()` first shows, at once, the reminders that came due since this device last planned or showed one.
  46. - Only events that have not started yet, one per event (the newest), saying "Starts at 14:00 · place" (all-day:
  47. "Today, all day" / "All day, <date>").
  48. - The mark is in `localStorage` `calendar-reminded-until-<users @id>`. A firing timer moves it to its own time, so nothing
  49. shows twice. With no mark yet, the last 12 hours count.
  50. - Statics: `reminders.hl planBetween` / `missed` / `lateBodyOf`. `plan` = `planBetween` from now.
  51. - `arm()` also runs on `visibilitychange` → visible and on `pageshow`. The listeners are set in `browserEnv()`.
  52. - `letcount`: never reassigned 0.
  53. ## What fires where (tests/notify-paths.mjs, Chrome as a 390 px Android phone with touch, reminder 1 min before an event 2–3 min ahead)
  54. | scenario | old c6809c7 | new |
  55. |---|---|---|
  56. | open, touched once | on time (worker) | on time (worker); not shown again on reload |
  57. | open, never touched | nothing (nothing planned) | nothing: **GAP 2** |
  58. | switched away (frozen), back 30 s after | late on resume, or not within 15 s | at once on return (31 s after its time), once |
  59. | tab dropped while away, opened again | nothing | at once: "Starts at HH:MM" |
  60. | closed, at the reminder time | nothing | nothing: **GAP 1** |
  61. | closed, opened again before the event | nothing | at once: "Starts at HH:MM" |
  62. | permission button before a touch | hidden | hidden: **GAP 2** |
  63. **Gate numbers:**
  64. - `NOTIFY_GATE_PORT=8700 node tests/notify-paths.mjs <old tree>` → **5 passed, 2 failed**, 3 gaps. A first run with the
  65. earlier gate version gave 3/4.
  66. - New tree → **7 passed, 0 failed**, 3 gaps.
  67. - `tests/browser.mjs` 78/0 and `tests/short-id-switch.mjs` 18/0 on the new tree. They ran on a copy in my scratch dir, and
  68. the switch gate needs `NEW_IDENT_DIR` / `OLD_IDENT_DIR` set there. One earlier browser.mjs run, made in parallel with the
  69. other gates, hit the known "next month" timeout (36/1).
  70. **Real data** (`R/repro/realdata.mjs`, backup copy, az5b2 session made in the copy, phone emulation, Europe/Vienna; the copies
  71. are deleted):
  72. - His 7 events show the same on old and new (October and November views). No console errors.
  73. - None of his events is inside today's −2…+9-day window, so no timer is due.
  74. - Then an event like his ("Friseurin (check)", Coiffeur Adele, Vienna, the default reminders) 20 min ahead, saved as az5b2
  75. before the phone opens the app:
  76. - new: shown at once, "Friseurin (check)|Starts at 02:15 · Coiffeur Adele";
  77. - old: nothing.
  78. **Screenshots** (`R/run/{old,new}/*.png`, 780×1600): I had no tool that can show me an image, so I did not look at them.
  79. The checks read the DOM instead.
  80. ## Hybriel gaps (STOP): repro `/media/STORAGE/claude-scratch/atlas/R/repro/webpush-gap/` (README.md)
  81. 1. **Web Push**, all three parts missing (vendored 06617221 and master 851ba17a):
  82. - hl:crypto has no ES256 for the VAPID JWT, and no ECDH P-256 / HKDF / AES-128-GCM for the payload
  83. (`crypto-probe-sign.hl` → "has no export named 'sign'").
  84. - hl:web's generated `/__hl/sw.js` listens to install / activate / fetch / message / notificationclick only, with no
  85. `push` (`sw.js` fetched from the probe app).
  86. - Nothing wraps `pushManager.subscribe`.
  87. - No open hybriel ticket covers it (ident#8 "PWA and web push" is pending).
  88. - Once it exists, the calendar needs:
  89. - a push-subscription table;
  90. - a server tick each minute: due reminders → one push each, plus a "reminded until" mark;
  91. - the subscribe step behind "Turn on notifications".
  92. 2. **No client hook when a page is shown / hydrated / visible again.** A component's browser code starts only from a DOM
  93. event of its View, hence the first-touch rule. Wanted: e.g. `on client shown()`.
  94. ## Steps for caramboleyo (after a deploy, Chrome on Android)
  95. 1. Open calendar.worldapi.org (or the installed app) and log in. Tap the month once. Tap "Turn on notifications" → Allow.
  96. - If "Notifications are blocked" shows: Chrome ⋮ → Settings → Site settings → Notifications → calendar.worldapi.org →
  97. Allow.
  98. - Also Android Settings → Apps → Chrome → Notifications on.
  99. 2. **App open:** add an event 3 min ahead. Reminders "Own" → 1 minutes before → Save ("1 reminder set …" shows). Keep the app
  100. in front with the screen on → the notification comes 1 min before.
  101. 3. **Away / closed:** add another one 3 min ahead the same way, then switch to another app or close the calendar.
  102. - At the reminder time nothing comes. That is expected until Web Push exists.
  103. - Open the app again before the event starts and tap the month → the reminder comes at once, "Starts at HH:MM".
  104. 4. Tell us what came at steps 2 and 3 (and whether step 1 offered the button).
  105. Deploy note: no data change. The first open after the deploy may show, at once, reminders from the last 12 hours for events
  106. that have not started yet.

Branches

Latest commits

  • cf175c80calendar mission 008 (A7): re-vendor Hybriel master 0e3c9830 (bin 9d957fed, plugins whole: hl:crypto Web Push primitives, hl:web sendPush)mre
  • 9bf3c38bcalendar mission 008: re-vendor Hybriel f9833544 (gates old = new); Web Push stopped: hl:crypto half missing on mastermre
  • 186f969bcalendar mission 007: signed-in gate for the first-pointer race (fails on 3c5604f), README theme section, reportmre
  • ba9b4955calendar mission 006: first pointer event no longer re-runs the month (stale overwrite race), gate check, e2e settings cleanup, reportmre
  • bd730759calendar mission 006: theme move (WIP): brief, report, LOG, STATUSmre
  • b117b153calendar mission 006 WIP: reminder row fields keep 44 px; e2e script flagsmre
  • 53e3b0debrowser gate: Log out through the user menu, theme colour rgb(15, 20, 25)mre
  • 90bf9e2ecalendar mission 006 WIP: theme dbe3de7, theme shell (AppHeader/MainMenu/UserMenu/Sidebar/ContentFirst), styles cut to the app's own rules, check-theme gate, e2e toolsmre
  • 3c5604f9identkit: refuse a taken ident port, cold-start deadline, abort on dead ident, clear no-code error (as notes)mre
  • 4996bbe7paths: projects moved into /media/STORAGE/projects/WorldAPI/mre
  • f5bf0803calendar mission 004: re-vendor Hybriel to the shared static build 0f396652; compose cache volume + tmpfs; notify-paths gate in deploy.sh; gate start waits 150 s; reportmre
  • eb86526fmission brief 004mre
  • 2f953b16deploy.sh: wait up to DEPLOY_URL_WAIT (120 s) for 200 after the restart, as the other apps (cold compile, hybriel#148)mre
  • 9078e1b7calendar mission 003 (2/2): report, LOG, STATUS (cause: timers only in an open, front, touched page; gate old 5/2 new 7/0; Hybriel gaps Web Push + page-shown hook, STOP)mre
  • 31ffe910calendar mission 003 (1/2): calendar#9 — missed reminders shown when the app is back, timers set again when it is shownmre
  • 26c997d3mission brief 003mre
  • c6809c76calendar mission 002: report, LOG, STATUS (test bug; fixed gate 78/0 at 00:30 05:40 12:00 19:59 20:01; 23:30 not run, quota stop)mre
  • 00f72783calendar mission 002 (2/2): TEST bug — the reminder steps get their own identity (carol): alice's all-day Vacation (20th-22nd) from the events steps added 2 reminders from the 12th 20:00 to the 19th 23:00; Tokyo check no longer skipped in the Tokyo eveningmre
  • 54fb0ce1calendar mission 002 (1/2): gate clock override GATE_CLOCK=HH:MM (this process and every page get Date shifted to that local time today)mre
  • c838ee79mission brief 002mre