calendar
All repositories: gitoria
8.0 KB
# Report 008 (A7): calendar#9 part 2 — Web PushBranch w8-webpush (worktree A7/wt), not pushed, not deployed, no .env read. Hybriel master 0e3c9830: bin/hybriel sha256 9d957fed77d0bd7f0bfeb3b90beb358b524d24d555f63578d3340ecd63706b65, plugins/ whole from master.## Step 1 — re-vendor (commit cf175c8). Gates, pristine re-vendored tree, own cold cache| gate | before (f9833544) | after (0e3c9830) ||---|---|---|| tests/browser.mjs | 81/0 | 81/0 || tests/notify-paths.mjs (port 8732) | 7/0 + 3 gaps | 7/0 + 3 gaps (a run at 8788 failed only because 8795 is foreign) || theme/check-theme.mjs | 0 problems | 0 problems |## Step 2 — what was built (all Hybriel)- `lib/push.hl`: table push.db, `savePush` / `dropPush`, the clock (`every`), `sendPush` per due reminder, drop on 404/410, retry up to 15 min when the service answers 5xx.- `lib/push-plan.hl`: server copy of the reminder plan on hl:time `fromLocal`. WHY A COPY: **Hybriel gap**, a static that calls hl:time `fromLocal` is refused in a component's browser build ("'viaStatic' is a static … whose initializer reaches 'instantOf', a name the realm 'client' … cannot bind"). Repro: `.scratch/hltime-client/` (page.hl, calc.hl, run.mjs). Delete the copy when fixed.- Faces `calPushSave(sub, zone)` / `calPushOff(endpoint)` (calendar.hl); `month-view.hl`: tapping "Turn on notifications" (or the first pointer on a device that already allowed them) subscribes and saves; text "Reminders also reach this device when the calendar is closed." (else "…while the calendar is open on this device.").- project.hl: `CALENDAR_PUSH_PUBLIC / _PRIVATE / _SUBJECT` → pushKey / pushPrivateKey / pushSubject (all or none). `tools/vapid-keys.hl` makes the pair (hl:crypto). README "Web Push" says how deploy sets it. No key committed.## Step 3 — proof- `tests/push.mjs` (PUSH_GATE_PORT=8788): real headless Chrome as a 390 px phone, real touch tap on the button, subscribe stubbed (headless has no push service), then the browser is CLOSED; local fake push service decrypts like a user agent. **New 9/9, old (re-vendored tree without the feature) 0/9.** Checks: page text after the tap; subscribe got the VAPID key; the encrypted push arrives once at the reminder time (0 s late) with title "Zahnarzt Push", body "Starts in 1 minute"; VAPID JWT verifies with the public key; no duplicate; on 410 the subscription is dropped (second reminder not sent to it).- Real FCM (tests/push-real.mjs, lisbeth's Chrome 155, one tab reused, under the lock): the tab subscribed through **fcm.googleapis.com** (real tap path = pointer + permission already given), the app on loreana (reverse tunnel, app only SENDS) sent at the reminder time with the page on about:blank: server log `push sent (201)`. **Not proven:** that the notification was displayed — the service worker target was gone and `getNotifications()` afterwards was empty (could be already dismissed; the page screenshot hung on lisbeth's non-visible tab). So real end-to-end display is unverified; delivery to FCM (201) is.- Evidence: /media/STORAGE/claude-scratch/atlas-evidence/A7/ (ok-2-subscribed.png: phone shot after the tap showing the new text; logs).## Gaps1. hl:time `fromLocal` in a browser static (above).2. Real notification display on a device not observed (above); no "turn off on this device" button yet (face `calPushOff` exists).3. Pre-first-touch behaviour of part 1 unchanged (GAP 2): subscription of a device that already allowed notifications happens at its first pointer, not at load (the `shown` hook is not used).4. W50: nothing relied on server members; subscriptions are in the table.## A8 finish (turn off, subscribe on show, final gates, real FCM display proof)Branch w8-webpush, not pushed, not deployed, no live .env read. Evidence: /media/STORAGE/claude-scratch/atlas-evidence/A8/.- **Turn off on this device** (`#push-off`, button right under the on-state text, 44 px high, only shown while this device is subscribed): in Hybriel (`on pushOff` in month-view.hl: `navigator.serviceWorker.getRegistration()` → `pushManager.getSubscription()` → `unsubscribe()` → `emit server calPushOff(endpoint)`; no JS, no gap). The choice is kept in localStorage (`calendar-push-off-<user>`) so a reload / later show does not subscribe again; "Turn on notifications" is offered again and undoes it. In lisbeth's real Chrome: subscription before = fcm.googleapis.com, after the click `getSubscription()` = none, text "Reminders show while the calendar is open on this device."- **Subscribe when already allowed**: `on client shown(r) { browserEnv() }` subscribes/refreshes whenever the app is shown again (tab visible, pageshow). NOT at the very first load: measured, the first `pageshow` comes before the components are hydrated, Hybriel's `shown` hook only hears later shows (and `reconnected` never the first) — so on first load it is the first pointer, as before. Page asks the browser for a subscription only when the server has the VAPID settings (`pushAvailable` ← `lib/util.hl pushConfigured`); without them (browser gate) nothing is asked and the console stays clean.- **Gates on the final code (head after the last commit)**: tests/browser.mjs 81/0; tests/notify-paths.mjs 7/0 + 3 Hybriel gaps (unchanged); theme/check-theme 29 files 0 problems; tests/push.mjs **16/16** (9 old + part 3: shown-again subscribes without touch, off control 44 px, tap unsubscribes the browser, control gone / "Turn on" back, reload does not resubscribe, **no push to the device after off**, same reminder still reaches the owner's other device). On main 186f969 (+ the vendored bin/plugins, since main has no bin) push.mjs fails: 0 passed, 2 failed (no subscribe, no text). An earlier browser run (80/1) found the console warning "subscribePush needs the app to set pushKey" → fixed by `pushAvailable`, whole sequence rerun. Load was 10–42 during the runs; no check needed a second try after the fix.- **Real FCM + visible notification** (tests/push-real-app.mjs outside the lock, tests/push-real.mjs under `timeout 600 flock -o`; app on loreana, host `localhost:8789` via ssh -R, own ident, fresh VAPID pair, one existing about:blank tab reused, fresh login each run): the page subscribed through **fcm.googleapis.com**, event 2.5 min ahead with a 1-min reminder, the calendar page stayed open; at the reminder time the app log says `push sent (201) for 0mvijc09clk0:1792612860000` and `registration.getNotifications()` read from the page = `[["Real push","Starts in 1 minute","0mvijc09clk0:1792612860000"]]` (tag = the push's tag). Screenshots real-3-on.png, real-4-notified.png. **Not separable**: with the page open the page's own timer shows the same notification with the same tag (one notification replaces the other), so this proves "FCM accepted the push (201) and a notification with the push's tag is shown by the service worker", not that the push alone created it; the OS-level toast of lisbeth's desktop cannot be captured from CDP. Closed-page delivery stays proven by the fake push service (decrypting user agent, push.mjs) + the A7 FCM 201 run.- Shots (looked at): shot-1280-on.png (one row: text · "Turn off on this device" · "Reminder settings"), shot-1280-off.png (blue "Turn on notifications" · "Reminders show while … open on this device." · settings), shot-390-off.png (button full-width block, text under it, settings), real-3-on.png at 390 (text, then "Turn off on this device" as a quiet 44 px button, then "Reminder settings"). Layout clean, no overlap. The off control is a quiet text button like "Reminder settings" (same theme style).- **Deploy must**: put into the live `.env` of calendar (Atlas): `CALENDAR_PUSH_PUBLIC` (VAPID public key, base64url), `CALENDAR_PUSH_PRIVATE` (32-byte scalar, base64url), `CALENDAR_PUSH_SUBJECT` (`mailto:…` or `https://…`) — all three or none; make the pair with `bin/hybriel tools/vapid-keys.hl` (see README "Web Push"); optional `CALENDAR_PUSH_EVERY` (s, default 30), `CALENDAR_PUSH_LATE` (s, default 900). Keep the pair stable (a new pair invalidates all subscriptions). Storage gets `push.db` by itself. Nothing else.- Gaps left: hl:time `fromLocal` in browser statics (repro .scratch/hltime-client); no hook for the very first load (above).
Branches
Latest commits
- a69b27f9docker-compose: nofile 65536 (Hybriel int 6+ boot opened >1024 files in the tracker)mre
- 1a97edfdcalendar mission 010: reminder rows at 390 px (the 7-column month grid no longer catches the reminder lists), gate checks, settings-shots, reportmre
- 61b21404calendar mission 009: reminder times on hl:time in the browser (lib/push-plan.hl and the Intl code removed), DST gate tests/dst.mjs, E2E script, reportmre
- 875353c1calendar mission 009: re-vendor Hybriel master 022a3ac1 (int 6 6b396322 hl:time browser side, int 7 65e8ec21; bin sha256 6e0f77d7, plugins whole)mre
- ce16a4efdeploy: backup copies index files first and *.mpack data last (hot-copy skew, hybriel #203)mre
- f490bc8cdeploy: Web Push gate tests/push.mjs (PUSH_GATE_PORT)mre
- 3af29fc8calendar mission 008 (A8): report, README, LOG, push-shots.mjsmre
- f91f3663calendar mission 008 (A8): push only asked of the browser when the app has the VAPID settings (pushAvailable); real-FCM E2E scripts (push-real-app.mjs, push-real.mjs)mre
- bf571badcalendar mission 008 (A8): Turn off on this device (unsubscribes the browser, server drops the device, choice kept), subscribe/refresh when the app is shown again; push gate part 3mre
- 50985708calendar mission 008 (A7): Web Push report, README, mission, LOGmre
- ee318774calendar mission 008 (A7): push-real.mjs, push sent log linemre
- ebda0fd1calendar mission 008 (A7): server-side reminder plan on hl:time (push-plan.hl; hl:time fromLocal in a browser static is refused: repro .scratch/hltime-client), push gate 9/9mre
- d063dad3calendar mission 008 (A7): Web Push (WIP): lib/push.hl subscriptions + sender clock, faces calPushSave/calPushOff, button subscribes, VAPID tool, tests/push.mjs; instantOf on hl:timemre
- 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