Commit Graph
432 Commits
Author SHA1 Message Date
Lucas Berger f95760e6c6 fix(03): IN-01 document RRULE_PRESETS lossy round-trip v1 limitation 2026-06-09 11:05:50 -04:00
Lucas Berger fd13852eb9 fix(03): WR-04 rank failed/dead outbox row above done in sync-status 2026-06-09 11:04:00 -04:00
Lucas Berger 5b720ffdb8 fix(03): WR-03 log unconditional PUT/DELETE when If-Match etag is missing 2026-06-09 11:04:00 -04:00
Lucas Berger eed178fb39 fix(03): WR-01/WR-02/IN-02 recurrence-edit helper text, all-day toggle clamp, edit-mode parse-failure guard 2026-06-09 11:02:09 -04:00
Lucas Berger 5168920eb1 fix(03): CR-01 preserve RRULE on edit-as-move (forward source rule to create row) 2026-06-09 10:59:19 -04:00
Lucas Berger 7a48659cae fix(03): update event lookup test mocks for CR-01/CR-02 query-chain changes
The CR-01 fix appended .orderBy().limit(1) to the edit/delete event lookups
and CR-02 added .innerJoin(calendars).limit(1) to the freshest-etag re-read.
The existing test doubles terminated the mock chain at .where(), so the new
chain calls hit undefined methods → handlers caught the throw and returned 503
(events.test.ts) and the worker skipped the PUT (outboxWorker.test.ts).

Extend the mocks to match the corrected production chains. Behaviour-preserving:
mockWhereCalEvents stays the awaited terminal so etag override assertions still drive.

8 failing tests now green; full suite: api 103, pwa 141.
2026-06-09 10:51:10 -04:00
Lucas Berger 6d2fd79209 fix(03): IN-04 type resolveUserId param as Hono Context instead of any 2026-06-09 10:44:15 -04:00
Lucas Berger 7e4ea710d0 fix(03): IN-03 guard localStorage access in InstallPrompt 2026-06-09 10:43:37 -04:00
Lucas Berger e29d6c1714 fix(03): IN-02 treat unmapped 4xx as hard fail (no full-backoff retry) 2026-06-09 10:43:14 -04:00
Lucas Berger 95f9d8c097 fix(03): IN-01 cache decrypted client per userId within a drain cycle 2026-06-09 10:42:41 -04:00
Lucas Berger 1c71f8c980 fix(03): WR-06 surface move-failed distinctly with re-save guidance 2026-06-09 10:41:55 -04:00
Lucas Berger 7bc129f0f3 fix(03): WR-04 start background workers only when run as entrypoint 2026-06-09 10:40:54 -04:00
Lucas Berger 22d1bc27d6 fix(03): WR-05 use resolved realpath for direct-run guard 2026-06-09 10:40:26 -04:00
Lucas Berger d34edece96 fix(03): WR-03 use cleaned string for all-day check in parseDateTime 2026-06-09 10:39:54 -04:00
Lucas Berger 5499f83782 fix(03): WR-02 make default-calendar selection deterministic (orderBy id, limit 1) 2026-06-09 10:39:28 -04:00
Lucas Berger 02aa407764 fix(03): WR-01 preserve existing RRULE on edit instead of resetting to none 2026-06-09 10:39:06 -04:00
Lucas Berger f645644853 fix(03): CR-03 convert exclusive all-day end to inclusive on edit pre-fill 2026-06-09 10:37:13 -04:00
Lucas Berger a596f520b4 fix(03): CR-02 scope freshest-etag re-read to the writing member's calendar 2026-06-09 10:36:18 -04:00
Lucas Berger 54addb1515 fix(03): CR-01 scope event edit/delete lookup to acting member's writable set 2026-06-09 10:35:51 -04:00
Lucas Berger 8b519460d9 docs(03): add code review report 2026-06-09 10:32:20 -04:00
Lucas Berger 197e138e3b docs(04): finalize phase plan (coverage gates + roadmap annotations) 2026-06-09 10:25:22 -04:00
Lucas BergerandClaude Opus 4.8 38fa6f448b docs(04): create phase plan — 6 plans across 5 waves for shared lists + live sync
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 10:21:53 -04:00
Lucas Berger d89eb47483 docs(03): add code review report 2026-06-09 10:19:01 -04:00
Lucas Berger a348bdd815 docs(04): add validation strategy 2026-06-09 10:03:12 -04:00
Lucas Berger bc45bddac9 docs(04): research phase — lists schema, SSE fan-out, fractional-indexing, dnd-kit, react-router 2026-06-09 10:01:47 -04:00
Lucas BergerandClaude Sonnet 4.6 492b85e9dc docs(04): UI design contract for shared lists + live sync
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 09:43:32 -04:00
Lucas Berger f695cc014d wip: Phase 4 paused — discuss complete, entry gate cleared, ready to plan 2026-06-07 21:53:23 -04:00
Lucas Berger 9ee59065f1 docs(quick-260607-u8o): record SSE-over-Pangolin smoke test PASS 2026-06-07 21:51:38 -04:00
Lucas Berger 1329e19803 chore: merge executor worktree (worktree-agent-a0352288acbf5055f) 2026-06-07 21:50:53 -04:00
Lucas Berger 26655cf859 docs(260607-u8o): mark Gate 2 Part C SSE row + summary PASS
- Part C row C1: PENDING -> PASS (2026-06-08) with verbatim evidence
- Summary Part-C row: DEFERRED -> PASS (Phase 4 entry gate D-14 cleared)
2026-06-07 21:49:55 -04:00
Lucas Berger dea6cb65a1 docs(260607-u8o): mark Phase 1 UAT item 4 (SSE smoke) PASS
- Record SSE-over-Pangolin smoke PASS (2026-06-08) with verbatim evidence
- Update Summary: passed 0->1, pending 4->3
2026-06-07 21:49:30 -04:00
Lucas Berger 92585d78db docs(260607-u8o): pre-dispatch plan for record SSE smoke PASS 2026-06-07 21:48:25 -04:00
Lucas Berger ecdb2317c8 docs(state): record phase 4 context session 2026-06-07 21:32:10 -04:00
Lucas Berger 05e1c9e556 docs(04): capture phase context 2026-06-07 21:32:09 -04:00
Lucas Berger 35871cd8cf roadmap(06): add Phase 6 — UX Polish
phase.add appended the entry after the 999.x backlog (the decimal backlog
convention confused the auto-placement). Moved it into Phase Details before
## Progress, added it to the top checklist + Progress table + execution order,
gave it goal/success-criteria/candidate-scope (promotes backlog 999.2/3/6/7/8/9),
renamed the dir to 06-ux-polish, and bumped STATE to 6 phases (50%).
2026-06-07 19:28:34 -04:00
Lucas Berger cca5205173 chore(03): close Phase 03 — transition to Phase 04
- 03-08-SUMMARY (Gate 2 record) written; phase marked complete (12/12)
- ROADMAP: Phase 3 [x] complete 2026-06-07; REQUIREMENTS updated
- STATE: advanced to Phase 4, focus + progress corrected (backlog 999.x were
  miscounted as milestone phases → reset total_phases to 5, 60%)
- PROJECT.md evolved: event CRUD / OIDC login / iOS PWA install moved to
  Validated (Phase 3); D-17 logged; Android install + onboarding-provider-setup
  kept Active
- removed stale .continue-here + one-shot HANDOFF.json

Carried forward: B5 (Android install), Phase 4 SSE entry gate (D-14), backlog 999.3-999.9.
2026-06-07 19:24:33 -04:00
Lucas Berger d71b15cd02 docs(03): Gate 2 complete for Phase 03 scope — D3 recurring write verified, recurring-series delete confirmed
Weekly recurring create writes valid RRULE and recurred in Fastmail; repeat-bound
+ per-occurrence-duration UX gaps backlogged (999.7/999.8). Deleting the recurring
series cleared master + all occurrences in one delete. Remaining deferred by
design: B5 (Android), C (SSE smoke — Phase 4 entry gate).
2026-06-07 19:19:57 -04:00
Lucas Berger cee7f0bad0 docs(backlog): add 999.6-999.9 (all-day visual, form end-tracking + all-day edit off-by-one, recurrence bound, recurring series edit)
Captured from Gate 2 live testing 2026-06-07:
- 999.6 all-day events need distinct visual treatment
- 999.7 event form: auto-advance end when start moves; + latent all-day EDIT
  off-by-one (edit grows the event by a day — write/display convert inclusive
  <-> exclusive but the edit form does not)
- 999.8 recurrence bound (repeat-until/count) so a recurring event isn't one
  giant multi-month event; verify daily-vs-weekly selection
- 999.9 edit a recurring series (whole-series edit; per-occurrence already v1.x)
2026-06-07 19:13:08 -04:00
Lucas Berger f656a41d1c docs(03): Gate 2 substantially complete — A/B/D verified; only D3 quick confirm left
A2 (transparent SSO), B2/B3/B4 (iOS standalone + load-bearing standalone login),
D2 (all-day, after off-by-one fix) all PASS. Remaining: D3 weekly recurring
(quick). Deferred: B5 Android, C SSE (Phase 4 entry gate).
2026-06-07 18:40:01 -04:00
Lucas Berger d4d5327fc4 fix(calendar): all-day off-by-one (exclusive DTEND) + member color too close to shared rose
All-day: a single-day all-day event displayed across two days. iCal all-day
DTEND is EXCLUSIVE (1-day event = DTSTART:24/DTEND:25) and the server occurrence
carries that exclusive end, but Schedule-X treats all-day end as INCLUSIVE.
hydrateEvents now subtracts one day (clamped to >= start) so a 1-day event shows
on one day and an N-day event spans N days. Write path was already correct
(verified against stored VEVENTs). +regression test.

Color: a member's coral (#E8734A) was mistaken for the shared-family rose
(#F25C7A). Reorder COLOR_PALETTE so warm near-rose hues (amber, coral) are
assigned LAST; early members get cool, clearly-distinct colors (blue/green/teal).
2026-06-07 18:37:56 -04:00
Lucas Berger 29b8c02715 docs(03): Gate 2 progress — A3 distinct colors + iOS install verified; backlog 999.5 (provider setup)
A3 PASS (distinct colors after collision fix), B1 PASS (wife installed + logged
in on iPhone). Added backlog 999.5: first-login provider-setup prompt to attach
each member's own Fastmail app password (per-member personal calendar, D-09).
Remaining Gate 2: A2, B2/B3/B4, D2, D3 (quick operator confirms); B5/C deferred.
2026-06-07 18:15:51 -04:00
Lucas Berger f700182674 fix(auth): assign first UNUSED palette color (AUTH-03 distinct colors)
Gate 2 A3 fail: a second member (amelia) got the same color as the first (luc),
both #E8734A. Color was assigned by COUNT(*) % palette; a deleted spike user
shifted the count so two live members landed on the same slot. Replace with
'first palette color not already in use by another user' (fall back to count
round-robin only once the palette is exhausted) — guarantees distinct, stable
colors for up to palette length members. +1 regression test (deletion frees a
slot → next member fills it, no collision).
2026-06-07 18:14:20 -04:00
Lucas Berger cdb097c5b3 docs(03): record Gate 2 live-verification results (2026-06-07)
A1 (OIDC login → app), D1/D4/D5 (create/edit/delete round-trips), D6 (412
conflict), and /health-over-tunnel verified live this session via operator
browser testing + outbox evidence. Remaining: A2/A3 + D2/D3 (desktop, quick),
B (iOS device, load-bearing), C (SSE — Phase 4 entry gate per D-14).
2026-06-07 18:02:53 -04:00
Lucas Berger 86069b89c1 docs(backlog): promote session-timeout + event-reminder todos to backlog (999.3/999.4) 2026-06-07 18:01:18 -04:00
Lucas Berger 2e10752a59 fix(pwa): stop calendar remount/flash on re-render (Bug B root cause)
The calendar flashed whenever the event popup/form closed or a post-write events
refetch landed. Root cause: CalendarContent was a function component DEFINED
INSIDE CalendarShell's render and used as <CalendarContent />. A nested component
has a new identity every render, so React unmounted+remounted its whole subtree
— including <ScheduleXCalendar> — on ANY CalendarShell re-render. The earlier
Bug B work only minimized re-renders (Zustand selectors) to dodge this; the
resync-before-done fix made the post-write ['events'] refetch deliver changed
data again, so the remount/flash returned.

Fix: render the content as a plain JSX element value (const calendarContent)
referenced at both layout sites instead of a nested component type. Element
values reconcile in place across re-renders — no remount, no flash.
2026-06-07 17:55:56 -04:00
Lucas Berger ae9fd9d790 docs(todo): redirect to sign-in on session timeout instead of hanging
Captured from Gate 2 live testing: when the OIDC session expires mid-use, the
app hangs the action and shows a generic 'couldn't load events' instead of
recognizing the signed-out state and redirecting to /api/login. Re-auth is
currently only wired to the initial /api/me failure (one-shot).
2026-06-07 17:49:20 -04:00
Lucas Berger 2c8f1a28af fix(auth): self-healing displayName; drop synthetic Member<sub> from storage
The legend showed 'Member 972be1a3' because Authelia does not emit
name/preferred_username/email in the ID TOKEN (only at the userinfo endpoint),
and @hono/oidc-auth reads ID-token claims only. The real fix is an Authelia
claims_policy adding those claims to id_token for the familysync client.

App-side robustness so it self-heals once Authelia is fixed (no DB surgery):
- deriveDisplayName now returns null (not a synthetic 'Member <sub>') when no
  real claim is present, so we never persist an ugly sub string; the UI degrades
  to a generic 'Member'.
- upsertUser now tracks the IdP name authoritatively: a non-null displayName that
  differs from the stored value updates the row (blank/stale 'Member …'/email →
  real name on next login). A null value never overwrites a good stored name.
2026-06-07 16:17:17 -04:00
Lucas Berger 98753d8e34 fix(broker): reconcile deletes into cache + resync before marking outbox done
Two write-path cache bugs surfaced during Gate 2 live testing:

P1 (delete didn't work / ghost event): syncCalendar only UPSERTED events
present on Fastmail and never removed cache rows for events that disappeared.
A successful CalDAV delete left the row in calendar_events forever, so
GET /api/events kept returning it and the UI showed a ghost that 'wouldn't
delete' (even after refresh). Add a prune step: delete calendar_events rows for
this calendar whose uid is absent from the server response (scoped to cal.id so
it never touches another calendar or the other member's rows — BUG B). Empty
server result prunes the whole calendar's cache.

P2 (edit needed a manual refresh): the outbox worker marked a row 'done' BEFORE
triggerTargetedResync refreshed the cache. The PWA's SyncStateToast invalidates
['events'] the instant sync-status flips to 'done', so it refetched stale cache.
Re-sync first, then mark done — 'done' now guarantees the cache reflects the write.

Tests: +2 prune regressions (present-subset prune, empty-server prune-all).
2026-06-07 16:12:43 -04:00
Lucas Berger bb61d21c83 fix(pwa): gate events query on auth to stop OIDC state-cookie churn
Internal Server Error after returning from Authelia: processOAuthCallback threw
OAUTH_INVALID_RESPONSE ("unexpected state parameter") because the OIDC state
cookie no longer matched the state returned to /callback.

Root cause: eventsQuery (fetchEvents, redirect:'follow', retry:2) ran
concurrently with fetchMe on load. While unauthenticated, every /api/* request
hits the OIDC guard, which 302-redirects to Authelia AND sets a fresh state
cookie. fetchEvents could not follow the cross-origin redirect, so React Query
retried it up to 3x over ~3s — each retry overwriting the state cookie mid-login,
racing the single /api/login navigation that owns the real flow.

Fix: enabled: meQuery.isSuccess. Only fetchMe (redirect:'manual', retry:false)
touches a guarded endpoint while unauthenticated, so the top-level /api/login
navigation owns the state cookie uncontested. Realizes the documented design
intent that only fetchMe drives the login redirect.
2026-06-07 15:57:17 -04:00
Lucas Berger 69bc57221b docs(quick-260607-l6l): summary, state, handoff update + reminder-options todo
- 260607-l6l SUMMARY (executor + orchestrator review follow-ups)
- STATE.md: quick-task row + session continuity (edit/delete blocker resolved)
- HANDOFF.json: 3 write-path code bugs marked done; remaining = operator rebuild + Gate 2 human/device checkpoints
- new backlog todo: event-creation reminder/VALARM options
2026-06-07 15:39:43 -04:00