mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
89bae414ff
syncTrip read the roadtrip preferences before writing anything and rethrew everything but a 404. That read has an offline fallback which throws a bare Error when there is no cached row, which is the state a first sync is in and the state a logout leaves behind, so the whole downloaded bundle for that trip was dropped while the run still counted it. Settings reported "N trips stored" over an empty database, and the trips were gone the moment the connection was. The read moved to the end and is never fatal now: it belongs to an optional addon and the addon answers 404 when it is off. Two things that fed it, from the same trace. A sync run started on navigator.onLine alone, so work-offline downloaded over the real connection while every repo read answered from cache. And work-offline itself survived a logout, in localStorage, while step six of the same logout deleted the database it reads from, so the next account came up believing it was offline with nothing to be offline with. Also in this pass: deleting a hotel booking released its day stop after deleting the booking row, which now clears the stop's pointer by trigger. The release goes first, or the stop stands with nothing left to reach it.