fix: resolve splash hang, dashboard skeleton, and sync-stuck regressions

- TripPlannerPage: change splash effect dep from `trip` (object ref) to
  `trip?.id` (primitive) — background refreshes no longer reset the 1500 ms
  timer on every new object reference, fixing the forever-splash on SPA nav
- tripRepo.list: await upserts on the cold-IDB path so the next mount reads
  from Dexie instead of hitting the network again, fixing the remount skeleton
- tripSyncManager: add stale-flag detection (>2 min resets _syncing), 90 s
  hard timeout via Promise.race, parallel post-sync prefetch via
  Promise.allSettled, and updated header comment to reflect manual-only policy
- OfflineTab: guard handleResync with a 120 s client-side timeout that
  interrupts and clears the spinner if syncAll stalls
This commit is contained in:
jubnl
2026-05-05 20:52:00 +02:00
parent 6b90c7b255
commit 544d5641d0
4 changed files with 95 additions and 64 deletions
+5 -1
View File
@@ -36,7 +36,11 @@ export const tripRepo = {
const fresh = await refresh
if (!fresh) return { trips: [], archivedTrips: [], refresh: Promise.resolve(null) }
// Data came straight from network — no background re-fetch needed
// Await upserts on cold path so next mount reads from IDB instead of hitting network again
await Promise.all([
...fresh.trips.map(t => upsertTrip(t)),
...fresh.archivedTrips.map(t => upsertTrip(t)),
]).catch(() => {})
return { ...fresh, refresh: Promise.resolve(null) }
},