Two devices can make valid edits to the same old record while offline. Reconnection order should not become an accidental business policy that silently discards one person's work.
Preserve the base revision and intended changes for each operation. Then apply a conflict rule appropriate to the fields and consequences rather than assuming the newest-looking timestamp is correct.
Distinguish independent changes from competing decisions
An address correction and a note addition may be mergeable. Two different appointment times or approval decisions may require explicit review. Define field ownership and valid state transitions before implementing a general merge.
Client clocks can differ, so a device timestamp alone is weak evidence of causal order. Use server-established revisions or another reviewed consistency design to detect stale writes and preserve meaningful relationships.
Reconcile a fictional two-device request edit
Suppose a phone and tablet both hold request version 12. On the phone, a staff member changes the callback number. On the tablet, they change the scheduled visit time. Another test case changes that same visit time differently on both devices.
Reconnect in both possible orders. For independent fields, verify the chosen merge preserves both intended edits. For competing times, verify the product either applies its explicit authority rule or presents a review state with both values and their context.
Test one device's deletion, a permission change, and a server edit during disconnection. Preserve the rejected or conflicting draft so the user can resolve it without reconstructing the original work from memory.
Make resolution a durable operation
When a user chooses a resolution, record the current server revision and the selected result. The record may change again while the conflict screen is open, so resolution itself needs the normal consistency checks.
Show the conflict in task language: which field changed, what is current, what this device attempted, and what action is available. Avoid presenting raw JSON or forcing users to understand queue internals.
The tradeoff is automation versus human effort. Automatic merges keep routine work moving but can conceal meaningful disagreement. Manual review protects consequential decisions while adding delay. Use a mixed policy where field semantics justify it and test each category separately.
Flutter's offline-first guide provides architectural context. The Social App portfolio account documents related mobile and native offline work. This request conflict is fictional and does not describe its internal resolution algorithm.
Questions about offline edit conflicts
Should the last device to reconnect win?
Only if that is an explicit acceptable policy for the relevant data. Arrival order does not necessarily represent user intent or business authority.
Can every field merge independently?
No. Some fields form a combined business state, such as appointment date and assigned resource. Review invariants across fields.
What should a regression case include?
Include the shared base, both edits, server changes, arrival permutations, preserved drafts, and final result. Bring it to a mobile consistency review.