0

Offline-first sync in Flutter: how do I resolve conflicts between phone and server?

AO Abena Owusu 76 il y a 2 semaines Ghana

Field agents edit the same record on the phone and in the web back-office. After a sync, one version silently overwrites the other.

Modifiée il y a 37 secondes
  • Which version are you running? The behaviour changed in the latest release. · Eric Habimana · il y a 2 semaines
6
SZ Salif Zongo 143 · il y a 2 semaines Réponse acceptée

For data where conflicts are rare, last-write-wins is acceptable if you log what was overwritten. For critical data such as stock or balances, send operations (+3 units) instead of final values, so concurrent changes add up instead of overwriting.

4
CO Chinedu Okafor 91 · il y a 2 semaines

Add a version (or updated_at) column and send the version you edited with every update. The server rejects the update with 409 Conflict when versions differ, and the app then shows both values to the user or merges field by field.

  • Which version are you running? The behaviour changed in the latest release. · Moussa Fall · il y a 2 semaines

Vous connaissez la réponse ? Rejoignez Griot pour aider.

Publier

Poser une question Obtenir de l'aide de la communauté Publier un composant Partager un SDK, un wrapper ou un package Proposer un troc Échanger une heure d'aide contre une autre Créer une prime Récompenser une solution en Mobile Money Organiser un hackathon Lancer un défi pour la communauté
Troc de compétences Primes Hackathons Observatoire