Skip to content

Firestore listeners miss events when app put in the background #12052

@mathone1

Description

@mathone1

Description

Using a snapshot listener, if a document is updated while the app is in the background, this update will not be retrieved.
However, if the app is back in the foreground, the listener continues to work.
Only updates that occurred while the app was in the background are lost.

This means manually implementing a wrapper to detect the state change, closing the listener when the app goes to background and reopening it when it returns to background to make sure you don't miss any updates.
This generates a cost when reopening the listener (if no update has taken place).
Can this mechanism be avoided?

Reproducing the issue

Initiate a snapshot listener, put the application in the background, modify a document and put the application back in the foreground.

Firebase SDK Version

10.15.0

Xcode Version

15.0.1

Installation Method

Swift Package Manager

Firebase Product(s)

Firestore

Targeted Platforms

iOS

Relevant Log Output

No response

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet
Replace this line with the contents of your Package.resolved.

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet
Replace this line with the contents of your Podfile.lock!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions