fix(pwa): fail offline mutations fast instead of pausing + silent write loss

Mutations ran in TanStack's default 'online' network mode, which PAUSES a
write fired offline: isPending stays true forever, onError never fires,
and the paused mutation is dropped on reload — a health entry vanishes
with no 'not saved' signal. Switch mutations to 'always' network mode so
an offline write rejects immediately and the form surfaces an honest
failure, and add a global OfflineMutationToaster backstop for call sites
without their own onError. Correct the offline banner copy, which promised
changes would auto-save.
This commit is contained in:
Marc-André Bombeck committed 2026-07-08 23:51:08 +02:00
1 parent a53dd2b59c
commit 081bb2289d
9 files changed
+144 -18

No files matched your search

+2 -1
View File
@@ -210,7 +210,8 @@
"backToDashboard": "Torna alla dashboard"
},
"offlineBanner": {
"message": "Nessuna connessione — le tue modifiche verranno salvate appena torni online.",
"message": "Nessuna connessione — le modifiche non possono essere salvate finché non torni online.",
"saveFailed": "Impossibile salvare — sei offline. Riprova quando torni online.",
"showingCached": "Vengono mostrati i tuoi ultimi dati sincronizzati."
},
"demoBanner": {