I have an Android app, that keeps track of some items and their quantities.
What I need is a way for the user to modify data on multiple devices while being offline, with proper synchronization order.
I don't know how to best explain it, so I'll give an example:
- Device A changes quantity of item to 5.
- Device B changes it to 3.
- Device B goes online, changes data on server, like it should, to 3.
- Device A goes online and replaces that data with 5 which is an older change and shouldn't be done.
Can this situation be prevented natively in Firebase, or should I, for example, use timestamps on items myself, and replace it only if newer?
Thanks.