correction bug
deploy / deploy (push) Successful in 31s

This commit is contained in:
Romain committed 2026-10-04 13:38:33 +02:00
1 parent eaad6f1e77
commit a5da756803
51 files changed
+537 -672

No files matched your search

+13 -2
View File
@@ -299,15 +299,26 @@ export function createSync(userId: string, hooks: SyncHooks): SyncEngine {
}
setStatus({ state: 'syncing', error: undefined })
try {
await push()
// Un envoi refusé (fiche trop lourde, quota…) ne doit pas empêcher de recevoir les autres appareils
let pushError: unknown
try {
await push()
} catch (e) {
pushError = e
}
// Déconnexion pendant la synchro : on n'écrit plus rien dans la base de cet utilisateur
if (stopped) return
await pullItems()
if (stopped) return
await pullLists()
if (stopped) return
await pullSettings()
if (pushError) throw pushError
meta.lastSyncAt = new Date().toISOString()
saveMeta()
setStatus({ state: 'idle', lastSyncAt: meta.lastSyncAt })
} catch (e) {
setStatus({ state: navigator.onLine ? 'error' : 'offline', error: (e as Error).message })
if (!stopped) setStatus({ state: navigator.onLine ? 'error' : 'offline', error: (e as Error).message })
}
}