style(13-03): apply Prettier formatting across repo

Mechanical reformat — no logic changes. 398 files changed, 19125
insertions(+), 16457 deletions(-). Prettier 3.8.4 with .prettierrc
(singleQuote:true, semi:true, tabWidth:2, trailingComma:all,
printWidth:100). Isolated per D-13-08 for reviewability.
This commit is contained in:
Lucas Berger
2026-06-11 20:35:18 -04:00
parent 4bc0445173
commit 982438dc10
398 changed files with 19050 additions and 16382 deletions
@@ -64,7 +64,7 @@ Other fixes (backoff index `outboxWorker.ts:533-535`, fail-closed credentials `o
**File:** `apps/api/src/broker/outboxWorker.ts:267-297`, `apps/api/src/routes/events.ts:371-401`
**Issue:** WR-01 was fixed only for the same-calendar `update` branch. When a recurring event is edited *and moved to a different calendar*, the PATCH handler (`events.ts:371-398`) enqueues a `delete` of the old object plus a `create` with a brand-new `newUid` and the edit payload. The edit payload omits `recurrence` by design (`EventForm.tsx:323`; the recurrence picker is disabled in edit mode). The worker's `create` branch then builds the VEVENT with:
**Issue:** WR-01 was fixed only for the same-calendar `update` branch. When a recurring event is edited _and moved to a different calendar_, the PATCH handler (`events.ts:371-398`) enqueues a `delete` of the old object plus a `create` with a brand-new `newUid` and the edit payload. The edit payload omits `recurrence` by design (`EventForm.tsx:323`; the recurrence picker is disabled in edit mode). The worker's `create` branch then builds the VEVENT with:
```ts
rruleString: fields.recurrence && fields.recurrence !== 'none'
@@ -80,13 +80,14 @@ Unlike the `update` branch, the `create` branch performs **no** `rawVevent` read
```ts
// events.ts — add rawVevent to the eventRow select, then in the move branch:
const preservedRrule = extractRruleString(eventRow.rawVevent ?? '')
const preservedRrule = extractRruleString(eventRow.rawVevent ?? '');
await tx.insert(calendarOutbox).values({
/* ...create row... */
payload: JSON.stringify({ ...payload, _preservedRrule: preservedRrule }),
groupId,
})
});
```
…and in the worker `create` branch, fall back to `fields._preservedRrule` when `recurrence` is absent.
2. Or, in the worker `create` branch, when the row has a `groupId` (move) and the payload lacks `recurrence`, look up the RRULE from the sibling delete row's original uid/calendar via `calendarEvents.rawVevent` and feed it to `buildVeventString`, mirroring `outboxWorker.ts:244-248`.
@@ -107,7 +108,7 @@ Add a regression test: move a recurring event → assert the created ICS contain
**File:** `apps/pwa/src/components/EventForm.tsx:259-271, 287-289`
**Issue:** `validate()` for all-day uses strict `endDate < startDate`. `handleAllDayToggle` only advances `endDate` to `startDate` when toggling all-day ON *and* `endDate < startDate`. When a timed event spans midnight (start 2026-06-10 23:00, end 2026-06-11 01:00) and the user toggles all-day ON, the time inputs are discarded but `endDate` is left at 06-11, producing a 2-day all-day event the user likely did not intend; conversely, toggle paths that leave `endDate === startDate` validate as a 1-day event silently. Not data loss, but the toggle can change the event span without a clear signal.
**Issue:** `validate()` for all-day uses strict `endDate < startDate`. `handleAllDayToggle` only advances `endDate` to `startDate` when toggling all-day ON _and_ `endDate < startDate`. When a timed event spans midnight (start 2026-06-10 23:00, end 2026-06-11 01:00) and the user toggles all-day ON, the time inputs are discarded but `endDate` is left at 06-11, producing a 2-day all-day event the user likely did not intend; conversely, toggle paths that leave `endDate === startDate` validate as a 1-day event silently. Not data loss, but the toggle can change the event span without a clear signal.
**Fix:** On toggle-on, clamp `endDate` to `max(startDate, endDate)` deterministically and clear time errors. Add a test covering toggle-on across a midnight-spanning timed event.