I have many clients (android devices) that need to update the same resource. The problem is that some of the devices experience offline state. And then I have the following problem:
- Device A is offline.
- Device A updates Resource1 (R1) (no changes are transmitted to the firebase server)
- Device B updates R1. This is the correct update chronologically speaking.
- Device A becomes online, and all his old updates override the latest and the correct updates from device B.
Firebase docs say:
Firebase apps automatically handle temporary network interruptions. Cached data is available while offline and Firebase resends any writes when network connectivity is restored.
I think if somehow I will prevent firebase from sending all the request online it will solve my problem. I also read about maybe using dates (but then I need to rely on the time of each device, and any case every setvalue request will take more time so I will check the current update datetime on the server)
Maybe anyone had a similar problem?
thanks