calendar
All repositories: gitoria
8.4 KB
# Report 003 (w3): calendar#9, event notifications never fired once**Verdict:** the reminders could only fire inside an open page that is in front and was touched since it loaded. On aphone that is almost never the case at the reminder time. A closed, frozen or dropped app was never reached, and areminder missed that way was lost for good. Closed-app delivery needs **Web Push, which Hybriel does not have (gap, STOP)**.The open-app path is fixed: missed reminders show when the app is back, and the timers are set again whenever it is shown.**Where:** branch w3 in /media/STORAGE/claude-scratch/atlas/R/wt (from main c6809c7 = live). Commits: `31ffe91` (fix + gate +README), then the docs commit with this report. Not pushed, not deployed. No `.env` read (the backup tgz holds one: deletedfrom my copy unread). bin/ unchanged (hybriel 06617221). Ports 8700–8719 only. Every process I started was stopped. At theend `ss` showed nothing of mine listening.## Cause, with evidence1. **Only an open page that is in front could fire a reminder.** `arm()` (month-view.hl) sets browser `setTimeout`s.- Nothing runs on the server.- The service worker (hl:web's) has no scheduler and no `push` listener.- Chrome on Android freezes a page it switched away from (its timers stop) and later drops it.- **Real data** (copy of deploy-backups/calendar.worldapi.org-20261019-0621.tgz): one user, az5b2 = users `0muh8y8myb5z`.- 7 events, none with its own `$reminders`, settings empty → the defaults: 1 h before and the day before at 20:00.- That gives 8 reminder times from 1 to 14 Oct (Europe/Vienna):| event | reminder times ||---|---|| Friseurin, 10-02 14:00 | 10-01 20:00 · 10-02 13:00 || Federico, 10-02 16:00 | 10-01 20:00 · 10-02 15:00 || Fliesenleger, 10-09 15:00 | 10-08 20:00 · 10-09 14:00 || REISEPASS, 10-14 13:15 | 10-13 20:00 · 10-14 12:15 |- Each would have needed the app open, in front and touched at that minute.- The backup holds only one signed-in session (created 10-15 09:23, last seen 10-16 17:52). There are no client logs, sowhether his phone ever granted the permission cannot be read.2. **Even open, nothing was planned until the first touch.**- `browserEnv()` (the clock, permission, time zone, then `arm()`) runs only on the first pointerover / focusin / touchstarton the month view.- Gate, old code: open and untouched → planned text "", no notification. "Turn on notifications" stays hidden until a touch.- hl:web has no hook for "page shown" (gap 2 below).3. **A missed reminder was dropped.** `plan()` only takes reminders still to come (`at > now`).- Old code, tab dropped while away and opened again before the event → nothing.- Closed, then opened again before the event → nothing.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);31 s late (back after 30 s); once not within 15 s.5. **Not the cause: the notify path.**- hl:web `notify` uses `registration.showNotification` when a worker registration exists. The calendar has `offline`, soit always does. In every run the recorder saw `via: worker`.- Android's refusal of `new Notification()` only hits hl:web's fallback (no registration), which never ran.- A real tap on "Turn on notifications" asks the browser inside the user gesture (`userActivation.isActive` true).6. **Why #4 passed review:** `tests/browser.mjs` grants the permission by CDP, moves the mouse before every step and keeps thetab in front. Not one of the phone's conditions.## Fix (Hybriel only, `components/month-view/`)- `arm()` first shows, at once, the reminders that came due since this device last planned or showed one.- Only events that have not started yet, one per event (the newest), saying "Starts at 14:00 · place" (all-day:"Today, all day" / "All day, <date>").- The mark is in `localStorage` `calendar-reminded-until-<users @id>`. A firing timer moves it to its own time, so nothingshows twice. With no mark yet, the last 12 hours count.- Statics: `reminders.hl planBetween` / `missed` / `lateBodyOf`. `plan` = `planBetween` from now.- `arm()` also runs on `visibilitychange` → visible and on `pageshow`. The listeners are set in `browserEnv()`.- `letcount`: never reassigned 0.## 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)| scenario | old c6809c7 | new ||---|---|---|| open, touched once | on time (worker) | on time (worker); not shown again on reload || open, never touched | nothing (nothing planned) | nothing: **GAP 2** || 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 || tab dropped while away, opened again | nothing | at once: "Starts at HH:MM" || closed, at the reminder time | nothing | nothing: **GAP 1** || closed, opened again before the event | nothing | at once: "Starts at HH:MM" || permission button before a touch | hidden | hidden: **GAP 2** |**Gate numbers:**- `NOTIFY_GATE_PORT=8700 node tests/notify-paths.mjs <old tree>` → **5 passed, 2 failed**, 3 gaps. A first run with theearlier gate version gave 3/4.- New tree → **7 passed, 0 failed**, 3 gaps.- `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, andthe switch gate needs `NEW_IDENT_DIR` / `OLD_IDENT_DIR` set there. One earlier browser.mjs run, made in parallel with theother gates, hit the known "next month" timeout (36/1).**Real data** (`R/repro/realdata.mjs`, backup copy, az5b2 session made in the copy, phone emulation, Europe/Vienna; the copiesare deleted):- His 7 events show the same on old and new (October and November views). No console errors.- None of his events is inside today's −2…+9-day window, so no timer is due.- Then an event like his ("Friseurin (check)", Coiffeur Adele, Vienna, the default reminders) 20 min ahead, saved as az5b2before the phone opens the app:- new: shown at once, "Friseurin (check)|Starts at 02:15 · Coiffeur Adele";- old: nothing.**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.The checks read the DOM instead.## Hybriel gaps (STOP): repro `/media/STORAGE/claude-scratch/atlas/R/repro/webpush-gap/` (README.md)1. **Web Push**, all three parts missing (vendored 06617221 and master 851ba17a):- hl:crypto has no ES256 for the VAPID JWT, and no ECDH P-256 / HKDF / AES-128-GCM for the payload(`crypto-probe-sign.hl` → "has no export named 'sign'").- hl:web's generated `/__hl/sw.js` listens to install / activate / fetch / message / notificationclick only, with no`push` (`sw.js` fetched from the probe app).- Nothing wraps `pushManager.subscribe`.- No open hybriel ticket covers it (ident#8 "PWA and web push" is pending).- Once it exists, the calendar needs:- a push-subscription table;- a server tick each minute: due reminders → one push each, plus a "reminded until" mark;- the subscribe step behind "Turn on notifications".2. **No client hook when a page is shown / hydrated / visible again.** A component's browser code starts only from a DOMevent of its View, hence the first-touch rule. Wanted: e.g. `on client shown()`.## Steps for caramboleyo (after a deploy, Chrome on Android)1. Open calendar.worldapi.org (or the installed app) and log in. Tap the month once. Tap "Turn on notifications" → Allow.- If "Notifications are blocked" shows: Chrome ⋮ → Settings → Site settings → Notifications → calendar.worldapi.org →Allow.- Also Android Settings → Apps → Chrome → Notifications on.2. **App open:** add an event 3 min ahead. Reminders "Own" → 1 minutes before → Save ("1 reminder set …" shows). Keep the appin front with the screen on → the notification comes 1 min before.3. **Away / closed:** add another one 3 min ahead the same way, then switch to another app or close the calendar.- At the reminder time nothing comes. That is expected until Web Push exists.- Open the app again before the event starts and tap the month → the reminder comes at once, "Starts at HH:MM".4. Tell us what came at steps 2 and 3 (and whether step 1 offered the button).Deploy note: no data change. The first open after the deploy may show, at once, reminders from the last 12 hours for eventsthat have not started yet.
Branches
Latest commits
- edb7c947calendar: the sign-in callback keeps the session it finds and signs it in (same cookie, nothing signed out; ident#28); security gate 56+4 failing → 60 passedmre
- bf8cc0fcStyles move into their components: the shell's styles into main.hl, the events and the editors into the month view's Style block; styles.hl keeps only the theme inherit, the accent and the message line; .gitignore ignores a bin symlink too; tests/styles-shots.mjs for the before/after pixel comparemre
- 5d8579d7README: login.js stays by caramboleyo's explicit rulemre
- cc759328Merge sb3-standby: calendar deploys through its standbymre
- f2fcdc6dcalendar: a standby container (port 45015, profile standby, reminder clock off) and a /health page; deploy hands over through standby-swap.sh without a gapmre
- 229643f7Merge branch 'cal-14'mre
- 1110b26fcalendar#14: the month name no longer breaks into two lines on a phone (Reminder settings drops to its own row when the header is too narrow), gate checks for one-line title and all header controls on screenmre
- 490c658aident#31: the selector's sign-in returns to the page the user started on (return attribute = the login callback with next), gate checkmre
- 18095868calendar: Reminder settings button opens its dialog again (the dialog's open handler still closed the removed user menu and stopped); old e2e and gate scripts use the new headermre
- 6eee4b5acalendar header: the selector alone top right plus Log out as before the theme missions; Reminder settings back on the month page (WIP: the settings test still fails)mre
- 0b909decident 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
- 0c8f9364Merge branch 'sy-sync'mre
- 9fab1c8fsync components.hybriel 4922f9c into the month view: prev / next 44 px targets, names formatted in UTC (a UTC+12 zone showed the wrong first weekday); the calendar keeps its own language handling (Accept-Language / browser) and the P1/C13 reminder code; gate: 44 px check (SY)mre
- 27d3e294theme: sync from layouts 4994037 (list rows stack, td word-keep, heading code, edited tap target)mre
- 2ac9c1bbdeploy: security gate (tests/security.mjs)mre
- 6b0a2571merge sc-sec (calendar security) with 99-year sessionsmre
- 92001e52sessions last 99 years (creator 2026-10-23: logins never expire; only sign out ends them)mre
- 0f76c99dSecurity audit SC: push endpoint SSRF guard, uploadMax 0, Secure cookie, login session rotation + rate limit, event cap, nosniff, security gatemre
- 2dd53dccP1: one reminder shows once: arm() one at a time, the page skips reminders the server already pushed; push-twice gatemre
- 3a29760aC13 report (handoff)mre