gitoria

ident

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmain0f6d1592Merge branch 'f18b-shell-session' into mainIdentmain/reports/011-daily-mail-urgent.md

6.3 KB

  1. # ident mission 011 — ident#7: delivery (daily mail at 17:00 in the user's zone, urgent at once) — gates green, NOT deployed, NOT merged (branch w11)
  2. ## What works
  3. - **Daily mail** (`lib/delivery.hl`, texts + clock `lib/delivery-helpers.hl`; project.hl `delivery = new Delivery()`): a round every
  4. `IDENT_DIGEST_EVERY` s (60). Per account: `local(now, zone)` (hl:time, hybriel#5) at 17:00 or later and the stored `lastDate`
  5. ≠ today's LOCAL date → the date is stored FIRST (new table `digests {account, lastDate, sentAt, count}`), then ONE mail
  6. "ident: N notifications (YYYY-MM-DD)" with every pending one (mail = daily, not mailed, email still on for its kind NOW),
  7. oldest first, ≤ 200: `* <name> — <app> · <identity>`, text (indented, line breaks kept), action link; footer = inbox link
  8. (`IDENT_PUBLIC_URL`) + where to switch. Marked `mailSent`/`mailedAt`. Nothing pending = no mail, the day still counts (later
  9. arrivals → tomorrow). Once per local day across restarts; server down at 17:00 → sent at its first round after (same day).
  10. DST: nothing of ours, `local()` gives the wall clock.
  11. - **Urgent**: `lib/api.hl apiNotify` → `deliverUrgent(id)`: `mail = now` (fixed at arrival by the user's switches,
  12. lib/notify.hl) → mailed before the API answers, subject "<app>: <name>". Push hook for ident#8: `pushHooks.push` in
  13. lib/delivery.hl (+ the existing `hasPushDevice` in lib/notify.hl).
  14. - **Mail** through `lib/mail.hl sendNotificationMail` (hl:smtp; with `IDENT_MAIL_SINK` one JSON line per mail to `<sink>.mail`).
  15. - **Fake clock for tests only**: `IDENT_TEST_CLOCK` = a file with an epoch-ms instant that delivery takes as "now" (only
  16. delivery reads it; never set in docker-compose).
  17. - deploy.sh runs the new gate too (7 gates).
  18. ## How the time zone is chosen (decision)
  19. Unchanged source: the browser's IANA zone at the first login (already stored since piece 1), changeable on `/` (the existing
  20. text field + "Use this browser's", accepted by the creator 2026-09-24 — I did NOT turn it into a select: Chrome's own
  21. `supportedValuesOf` list differs from tzdata's names (it has `Asia/Calcutta`, no `Asia/Kolkata` — Node's Intl lists the same, and the gate's Chrome refused Asia/Kolkata), and the browser gate
  22. covers the field). New: the server checks the name against hl:time's database (`isZone`) → `unknown time zone: <name>`; a first
  23. login with an unknown zone stores UTC. **No zone / unknown zone = UTC** (`lib/accounts.hl zoneOf`, read-time, no migration, nothing
  24. rewritten); `/` says "Your daily mail of notifications comes at 17:00 in this time zone." under the zone — that is the
  25. "ask": the smallest thing, no extra prompt. Live data has no account without a zone (2 accounts, both Europe/Vienna).
  26. Container: debian:12-slim image has `tzdata` 2026b (checked `/usr/share/zoneinfo` in worldapi-hybriel-runtime:debian12).
  27. ## Commits (branch w11)
  28. 39749e0 zones via hl:time · 371ef1b sendNotificationMail · 7869f57 delivery · ab6331f tests/delivery.mjs · dfa7b78 README +
  29. deploy.sh · 6534803 gate console check (49) · + this report/LOG/STATUS.
  30. ## Gates (ports 8700–8719 via `.scratch/w11/runall.mjs <tree> <out>`: temp copies with ports remapped, browser via IDENT_GATE_*,
  31. HL_PORT_BASE=8506; 8702 is held by another Chrome, never used as a server port). OLD (7a54fe7) → NEW:
  32. browser 152/0 → 152/0, apps 107/0 → 107/0, selector 99/0 → 99/0, migration 33/0 → 33/0, iplimit 39/0 → 39/0, notify 130/0 →
  33. 130/0, hardening 17/0 → 17/0, signoutall 6/0 → 6/0, shortid 19/0 → 19/0, invites 44/0 → 44/0,
  34. **delivery (new) 15/34 on old → 49/0 on new** (run twice green).
  35. ## New checks (tests/delivery.mjs, 49; fail on old code: 34 of them)
  36. Three real Chromes with emulated zones (Vienna, New York, "off" user) + API users Tokyo and one with an unknown zone (→ UTC).
  37. Fake clock: nothing at 05:00 UTC; urgent mailed at once, not again in the digest; urgent with mail+push off → nothing; Tokyo
  38. 16:59 nothing / 17:00 (08:00Z) one mail with both, own only, text/link/identity/app, not twice; arrival after 17:00 → next day;
  39. Vienna 15:00Z, UTC 17:00Z, New York 21:00Z (16:59 = nothing each); "off" (override all → email off on the per-app page, clicks)
  40. gets nothing — switched off after arrival AND arrived switched off — and both stay pending in the store; server stopped over Tokyo's
  41. 17:00 → sent at the first round after the restart, second restart same day → nothing; DST Vienna 25 Oct 2026 (15:00Z = 16:00 CET:
  42. nothing; 16:00Z: mail), New York 1 Nov 2026 (21:00Z nothing, 22:00Z mail); zone changed on `/` to Australia/Adelaide (typed, saved)
  43. → mail at 06:30Z, not again at Vienna's 17:00; server refuses `Mars/Olympus_Mons`; account page no overflow 390/1280; console clean
  44. (after the gate's own restart only the stopped server's network errors). Screenshots .scratch/delivery-account-{390,1280}.png:
  45. I have no image viewer in this session — checked by DOM checks + a coarse pixel render (section, field, two buttons visible), not by eye.
  46. ## Real data (copy of deploy-backups/ident.worldapi.org-20261019-2043.tgz, storage/mpackdb only, no .env; deleted after)
  47. - Delivery check (`.scratch/w11/rdscripts/run.mjs`, port 8705, creator's az5b2 session file, one account's zone REMOVED on the
  48. copy to play a pre-zone account): 12/0 — creator's `/` shows Europe/Vienna + the note; urgent → sink at once; Vienna 16:59 nothing,
  49. 17:00 one mail (2 notifications); the zoneless account's round at 17:00 UTC (not Vienna's), no pending = no mail, its record not
  50. rewritten; no `mail: sent`/`FAILED` in the log (SMTP_HOST empty) — only the sink got mail. Live data holds 0 notifications, so
  51. the first live 17:00 sends nothing.
  52. - Same-output run (tests/realdata-baseline.mjs + realdata-compare.py, old vs new): 190 byte-identical, 77 after masking, 23 differ —
  53. all expected: `/` pages carry the new note line, the home module/asset hash, stored state (`digests` table, urgent ones now `mailSent`).
  54. ## Hybriel gaps
  55. None blocking. Finding (not hit by app code, all updates go through `merged(r, …)` which keeps `id`): hl:mpackdb `update(id, rec)`
  56. with a `rec` WITHOUT `id` silently changes nothing (hybriel#29 "done" fixed the key loss; now it is a silent no-op). Repro:
  57. `.scratch/w11/probe/upd.hl` vs `upd2.hl`. Not reported further by me — Atlas decides.
  58. Open: mail failures are only logged (as for codes); the inbox still shows times in UTC (out of scope).

Branches

Latest commits

  • 0f6d1592Merge branch 'f18b-shell-session' into mainIdent
  • 19868218|||PR ident#39 shell reads its session member instead of a cross-file emitmre
  • 5d1b3fedMerge branch 'v61-day61' into mainIdent
  • 83faeb15|||PR ident: vendor Hybriel day61mre
  • b2572b34Merge branch 'v59-day59' into mainIdent
  • 67cf016d|||PR ident: vendor Hybriel day59mre
  • 600c043dMerge branch 'v58-day58' into mainIdent
  • 365f8c80|||PR ident: vendor Hybriel day58mre
  • 585126e5Merge branch 'f16-setf' into mainIdent
  • 953bf03a|||PR ident setF mirror dropped (hybriel#370)mre
  • a1419d9cMerge branch 'f15-navigate' into mainIdent
  • 3b3e451f|||PR ident#36 navigate to the app instead of location.assignmre
  • e36f4516Merge branch 'f14-online' into mainIdent
  • 2c5eac91|||PR ident#38 online state without probe timermre
  • bf1980f2Merge branch 'v56-day56' into mainIdent
  • 62ae0adf|||PR ident: vendor Hybriel day56mre
  • 0d18abc4Merge branch 'f13-avatar' into mainIdent
  • 2a99730a|||PR ident#37 avatar in hlmre
  • fa4ed25bMerge branch 'f11-upsert' into mainIdent
  • 8f3d9bc9|||PR ident#42 keyed upsert and removemre