DmitrySharabin / mavo-firebase-firestore

Firebase backend plugin for Mavo. Store and sync app data in milliseconds. Store and serve files at Google scale. Authenticate users simply and securely. All the Google Firebase powers are at your fingertips.
https://plugins.mavo.io/plugin/firebase-firestore
MIT License
6 stars 0 forks source link

Data loss from race condition with autosave and realtime #19

Open karger opened 4 years ago

karger commented 4 years ago

I thought I posted this issue but cannot find it; sorry if duplicate.

I've found that combining autosave and realtime in the firebase plugin leads to corruption of the data. Race conditions are hell to debug so I'm not sure exactly what's going on, but you can see the data corruption. I put a demonstration at this link. Open two instances in separate windows/tabs. Then in one of them, start clicking on the add button, quickly. This should increment a counter and generate a list of (increasing) values. At some point you'll see that list get corrupted.

karger commented 4 years ago

Note: if you click very quickly, it seems to work. But a rate of 1 or 2 clicks per second seems to trigger the race.