Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

143
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda