Skip to content

notification for entering and exiting offline mode #7954

@michaelAtCoalesce

Description

@michaelAtCoalesce

Operating System

Mac OS X

Browser Version

web and node sdk's

Firebase SDK Version

10.1.0

Firebase SDK Product:

Firestore

Describe your project's tooling

we use both firebase-js web-sdk and firebase node admin sdk.

Describe the problem

we are investigating some situations recently where firestore will say that it is in offline mode , and also, some situations where simple get() calls are returning data from the cache, instead of live data from the server

is there a way to get a callback when firestore either enters or exists an offline mode? we seem to get this on issuing a get(),
@firebase/firestore: Firestore (10.1.0): Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds. FirebaseError: [code=unavailable]: Failed to get document because the client is offline.

or sometimes we will get cached data when doing a get() on a document, and instead of finding out on the action, it would be helpful to get a notification that we've entered an offline mode for our observability purposes.

Steps and code to reproduce issue

recently, firestore appears to be getting transient connectivity issues.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions