You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Important: This bug happened with Firestore in Flutter, it was already reported in the Flutterfire repository, but as Flutterfire is only calling the native SDKs, that issue was closed.
I have a single listener that is listening to a collection, retrieving up to 1000 documents (using where and orderBy) alongside other really smaller listeners and fetches from Firestore. If we use the app with a good network everything works fine, but when the device is on an Edge connection, the big listener returns a cached result, but for 3-4 minutes all the others Firestore queries stop working (all the futures that are waiting for a Firestore fetch won't complete until those 3-4 minutes passed).
Reproducing the issue
Set the connection to Edge connection in iOS.
Create a Firestore listener that listen to 1000 documents.
After the declaration of the listener, add another Firestore request (like a fetch)
Run the app and see how none of the other Firestore requests finishes until a couple of minutes pass.
If you remove the big listener and run the app again, all the requests will complete in just a couple seconds.
Firebase SDK Version
10.20
Xcode Version
15.2
Installation Method
CocoaPods
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.
Firestore SDKs will buffer results from multiple queries running simultaneously and raise the snapshots (call the lister provided to addSnapshotListener or return results of getDocuments) once the data for all queries is received. This ensures queries give a consistent view of the data in the database.
Based on what you have described, it sounds like the query for 1000 documents is running for a very long time on a slower network connection, possibly timing out. It is possible to avoid this delay from synchronized query results by changing how you call the SDK. For example, it may be possible for you to run the small queries first before starting the big query, break up the large query into multiple paged queries, or even use a second Firestore instance for the large queries. Here's another discussion that dives deeper on this topic: firebase/firebase-js-sdk#6520.
Also, if you can provide logs from the Firestore SDK when this issue occurs, then we can dive deeper and confirm that the big query is indeed running for a long time and timing out.
Description
Important: This bug happened with Firestore in Flutter, it was already reported in the Flutterfire repository, but as Flutterfire is only calling the native SDKs, that issue was closed.
I have a single listener that is listening to a collection, retrieving up to 1000 documents (using where and orderBy) alongside other really smaller listeners and fetches from Firestore. If we use the app with a good network everything works fine, but when the device is on an Edge connection, the big listener returns a cached result, but for 3-4 minutes all the others Firestore queries stop working (all the futures that are waiting for a Firestore fetch won't complete until those 3-4 minutes passed).
Reproducing the issue
Firebase SDK Version
10.20
Xcode Version
15.2
Installation Method
CocoaPods
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
snippetReplace this line with the contents of your Package.resolved.
If using CocoaPods, the project's Podfile.lock
Expand
Podfile.lock
snippetThe text was updated successfully, but these errors were encountered: