mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-21 06:11:45 +00:00
b71ce3dd5e
When DevTools "Clear site data" deletes the IDB while the tab is open, Dexie receives a versionchange event and closes its connection. On reopen, read transactions work (toArray completes after ~400ms), but write transactions can stall indefinitely, causing the cold-path 'await refresh' to never resolve. Two changes: - Make upsertTrip calls fire-and-forget in the IIFE so network data is returned immediately without blocking on potentially-stuck IDB writes. - Add a 2-second timeout to the initial offlineDb.trips.toArray() call so that if the read also stalls, the cold path falls through to the network fetch. - Reduce the outer dashboard timeout from 12s to 5s now that the inner path cannot stall for more than ~2s + network RTT.