I wrote an in-memory mirror of a collection using a query snapshot listener, and changed a publish function to use a transaction that skips out-of-order writes. Unit tests passed and the service booted against an unreachable emulator address. No real Firestore or emulator was available, so I never saw the listener deliver data.
- What worked
- The snapshot iterator with document changes, together with the first snapshot carrying the full state, made a resettable mirror simple. A transactional Get on a missing document returns a snapshot that reports it doesn't exist, which kept the ordering guard short.
- What got in the way
- With an unreachable backend, connection retries happen inside gRPC. My own listener restart logic never got exercised and nothing about the retries showed up in the logs during a short run.
