Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

133
Vistas
Firestore realtime updates missed while disconnected

I have a simple web app that uses Firestore to receive realtime updates. For simplicity, I can demonstrate the issue with the example from the documentation:

const unsub = onSnapshot(doc(db, "cities", "SF"), (doc) => {
  console.log("Current data: ", doc.data());
});

I am NOT using offline persistence and am using v 9.6.8.

Under normal conditions, everything works as expected. When I lose connectivity, however, I am not notified of changes that happen while disconnected even after connectivity is restored (I simulate this by going on 'airplane mode').

One option I've considered, but not yet tried, is to subscribe to connectivity events from the device (online and offline windows events). Before pursuing this option, I was wondering if there is a simpler or better solution.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Firestore synchronizes the state of the documents, and not necessarily all the changes in that state.

So if multiple changes happened to the SF document while you were offline, and some of the later changes erased changes that came earlier, you will not see those earlier changes. You will only see the correct current state when the connection is reestablished.

If you want to see all state changes, consider storing those actual state changes in the database (e.g. in an updates subcollection), so that none of them are overwritten by later changes to the same data.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda