Open hunterwilliams opened 7 years ago
Okay so a year later I've finally found the real issue and a solution. This is caused by firebase itself and how limit (1). Unfortunately the library abstracts away that layer.
If you want to do child_added 1 pretty much don't. Just do child_added w/o a depth. However this can cause large data pulls. Do a getAll immediately after sync. This uses a firebase caching mechanism found here: https://firebase.google.com/docs/database/admin/retrieve-data#section-event-guarantees which basically saves eliminates the replay thrash a bit, but your reducer will need to handle some of that.
tldr: It's firebase, but I'll leave this in case someone needs it
If I delete a notification or try to add one it calls both seemingly in a random order which causes problems. If I remove the depth specifier it works 100% as expected.