I am working with Firebase Realtime Database's Web-based interface (SDK 8.10.0) and I'm running into a very strange bug.
It only happens to Safari users on Mac (we haven't ruled out Safari on iOS yet, but it definitely doesn't happen to Chrome or Firefox users on Mac, or to anyone on PC) and it's erratic - happening maybe 20% of the time.
Here's the offending line of code:
firebase.database().ref('/userdata/' + authToken + '/user_id').once('value').then(function(snapshot) {
When this bug strikes, the entire callback function is skipped. No errors are logged. I've added lots of console logging within the block of code; none of it triggers. Console logging after the callback, in the normal flow, works as expected.
I considered the possibility that the value it's looking for has not been populated, but my understanding from the documentation is that the callback should fire regardless. I tried switching from once() to get() but it didn't help.
Any theories about the problem, or advice for gathering more information, would be appreciated.
ADDENDUM: Upgrading to version 9 of the Javascript SDK resolved this problem. Leaving this here in case someone with the same issue stumbles across this. I didn't even have to rewrite anything; v9 in compatibility mode ran perfectly with the same code.