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:
@@ -47,6 +47,7 @@ status: clean
|
||||
## Resolution (iteration 3)
|
||||
|
||||
All 12 original findings plus the 2 fix-induced findings are resolved:
|
||||
|
||||
- **NEW-CR-01** (iOS gesture gate re-broken by `await navigator.serviceWorker.ready` in the tap path) — FIXED in `c7ef581`. `PushPermissionPrompt.tsx` and `SettingsSheet.tsx` now pre-resolve both the SW registration and VAPID key into state via `useEffect`, disable the Enable control until both are ready, and call `subscribe(registration, vapidKey)` synchronously — zero `await` between the user gesture and `pushManager.subscribe()`. Manually verified.
|
||||
- **NEW-WR-01** (whole-cache-clear delete branch emitted no `delete` change events) — FIXED in `17756fc`, with a new regression test in `sync.test.ts`.
|
||||
|
||||
@@ -60,20 +61,20 @@ one prior warning that is partially fixed but not fully resolved.
|
||||
|
||||
Prior findings status:
|
||||
|
||||
| ID | Status | Notes |
|
||||
|-------|------------------|-------|
|
||||
| CR-01 | CONFIRMED-FIXED | Stale-bucket prune loop added after dispatch at lines 176-182 of reminderScheduler.ts |
|
||||
| CR-02 | CONFIRMED-FIXED | 0003 SQL is untouched; 0004_mature_maximus.sql adds the two MODIFY COLUMN statements; schema.ts uses varchar(2048)/varchar(512) |
|
||||
| CR-03 | CONFIRMED-FIXED | sw.ts now uses clients.matchAll + focus + navigate(url) + openWindow fallback inside event.waitUntil |
|
||||
| CR-04 | NOT-FIXED (new critical introduced) | See NEW-CR-01 below |
|
||||
| WR-01 | CONFIRMED-FIXED | sentReminders.add(key) is now after the fan-out loop (line 162) |
|
||||
| WR-02 | CONFIRMED-FIXED | `and` import removed; only `eq, inArray` remain |
|
||||
| WR-03 | CONFIRMED-FIXED | Both POST and DELETE catch blocks log err.message only |
|
||||
| WR-04 | CONFIRMED-FIXED | Delete changes now collected after db.delete() via pendingDeleteRows pattern |
|
||||
| WR-05 | CONFIRMED-FIXED | Health-check POSTs existingSub.toJSON() to re-confirm server record before setIsSubscribed(true) |
|
||||
| IN-01 | CONFIRMED-FIXED | dispatchEventChange runs Promise.all to fetch actorRows in parallel with subs query |
|
||||
| IN-02 | CONFIRMED-FIXED | VAPID vars have `:-` empty-string fallbacks in docker-compose.yml |
|
||||
| IN-03 | CONFIRMED-FIXED | useId() replaces Math.random() in PushPermissionPrompt |
|
||||
| ID | Status | Notes |
|
||||
| ----- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| CR-01 | CONFIRMED-FIXED | Stale-bucket prune loop added after dispatch at lines 176-182 of reminderScheduler.ts |
|
||||
| CR-02 | CONFIRMED-FIXED | 0003 SQL is untouched; 0004_mature_maximus.sql adds the two MODIFY COLUMN statements; schema.ts uses varchar(2048)/varchar(512) |
|
||||
| CR-03 | CONFIRMED-FIXED | sw.ts now uses clients.matchAll + focus + navigate(url) + openWindow fallback inside event.waitUntil |
|
||||
| CR-04 | NOT-FIXED (new critical introduced) | See NEW-CR-01 below |
|
||||
| WR-01 | CONFIRMED-FIXED | sentReminders.add(key) is now after the fan-out loop (line 162) |
|
||||
| WR-02 | CONFIRMED-FIXED | `and` import removed; only `eq, inArray` remain |
|
||||
| WR-03 | CONFIRMED-FIXED | Both POST and DELETE catch blocks log err.message only |
|
||||
| WR-04 | CONFIRMED-FIXED | Delete changes now collected after db.delete() via pendingDeleteRows pattern |
|
||||
| WR-05 | CONFIRMED-FIXED | Health-check POSTs existingSub.toJSON() to re-confirm server record before setIsSubscribed(true) |
|
||||
| IN-01 | CONFIRMED-FIXED | dispatchEventChange runs Promise.all to fetch actorRows in parallel with subs query |
|
||||
| IN-02 | CONFIRMED-FIXED | VAPID vars have `:-` empty-string fallbacks in docker-compose.yml |
|
||||
| IN-03 | CONFIRMED-FIXED | useId() replaces Math.random() in PushPermissionPrompt |
|
||||
|
||||
---
|
||||
|
||||
@@ -110,10 +111,11 @@ resolve) or after a SW update cycle, the await is observable and iOS will reject
|
||||
`NotAllowedError`.
|
||||
|
||||
The same pattern is present in `SettingsSheet.tsx:115`:
|
||||
|
||||
```typescript
|
||||
const registration = await navigator.serviceWorker?.ready // ← same problem
|
||||
const registration = await navigator.serviceWorker?.ready; // ← same problem
|
||||
if (registration) {
|
||||
await subscribe(registration, resolvedVapidKey)
|
||||
await subscribe(registration, resolvedVapidKey);
|
||||
}
|
||||
```
|
||||
|
||||
@@ -169,6 +171,7 @@ if (onChanges && seenUids.length > 0) {
|
||||
```
|
||||
|
||||
However, the subsequent delete runs two branches:
|
||||
|
||||
1. `seenUids.length > 0`: deletes cache rows NOT in seenUids (the standard prune)
|
||||
2. `seenUids.length === 0`: deletes ALL rows for the calendar (`db.delete(...).where(eq(calendarId, cal.id))`)
|
||||
|
||||
@@ -184,19 +187,19 @@ common case but the empty-server-response case is silently missed.
|
||||
**Fix:** Add the pre-capture for the empty-seenUids branch:
|
||||
|
||||
```typescript
|
||||
let pendingDeleteRows: Array<{ uid: string; title: string | null }> = []
|
||||
let pendingDeleteRows: Array<{ uid: string; title: string | null }> = [];
|
||||
if (onChanges) {
|
||||
if (seenUids.length > 0) {
|
||||
pendingDeleteRows = await db
|
||||
.select({ uid: calendarEvents.uid, title: calendarEvents.title })
|
||||
.from(calendarEvents)
|
||||
.where(and(eq(calendarEvents.calendarId, cal.id), notInArray(calendarEvents.uid, seenUids)))
|
||||
.where(and(eq(calendarEvents.calendarId, cal.id), notInArray(calendarEvents.uid, seenUids)));
|
||||
} else {
|
||||
// Server returned zero events — all cached rows will be deleted
|
||||
pendingDeleteRows = await db
|
||||
.select({ uid: calendarEvents.uid, title: calendarEvents.title })
|
||||
.from(calendarEvents)
|
||||
.where(eq(calendarEvents.calendarId, cal.id))
|
||||
.where(eq(calendarEvents.calendarId, cal.id));
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user