This repository has been archived by the owner on Mar 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 92
Value callbacks always triggered with null first #2
Comments
Thanks for reporting, I could successfully reproduce the issue. Any idea what is causing this? |
I don't know much about Firebase's internals, but my guess would be that the initial null is what's stored locally before a sync occurs. This sort of thing happens during a transaction normally, but in that case, the SDK "knows" to run the transaction function again until data is synced with the server. |
Just pushed a fix - can you please try it and let me know if it solves the problems? Once the solution will be verified, I will release it as 0.2.0. Thanks! |
The value callbacks are working as expected now. Thanks for the quick fix! |
Great news! Released to npm as v0.2.0 |
yingray
pushed a commit
to yingray/firebase-server
that referenced
this issue
Mar 30, 2019
update package.json for publishing
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
If I listen for the value event on a node, the snapshot that's returned contains no data on the first event. So if I'm using once, the value is null. But if I use on, the callback is called twice, once with null and once again with the data.
Output:
The text was updated successfully, but these errors were encountered: