Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

138
Views
Why would Firebase Realtime Database's "once" Javascript function fail silently for Safari users?

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.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!