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
metadata in QuerySnapshot is an existing Firestore feature in other platforms but it's not there in Flutter.
The Flutter cloud_firestore library's QuerySnapshot object needs to provide a metadata field that indicates whether the query result is coming from the cache or the server. The individual DocumentSnapshot objects in QuerySnapshot have this metadata field; however, when the query result is empty, we don't get any DocumentSnapshot objects and we have no idea whether the QuerySnapshot came from the cache (offline) or from the server.
Android and Web already have metadata in QuerySnapshot. I didn't check other platforms.
I was hoping I could fix it myself and provide a PR, however it seems we just don't get that data under the hood. When I set a breakpoint here, I see that data, which is the result of Query#getDocuments has only these fields:
The metadatas field is related to the individual DocumentSnapshots. When the query result is empty, all of these lists are empty as well. Hence the lack of metadata about our query.
It seems this is coming from a platform channel, so definitely it must be using Android Firebase libraries. However, as I said above, Android libraries havemetadata for QuerySnapshot but Flutter, which seems to be using the Android libraries through a platform channel does not have it. Is this because the Flutter plugin is using an old version of the Android library?
The current way to add Firebase to Flutter does not have anything about Android Firebase library versions. Only classpath 'com.google.gms:google-services:3.2.1' seems to be a versioned thing, is it what's holding this back? I tried 4.2.0 but it's the same.
Here is a relevant discussion in Slack. I'd appreciate any suggestion.
The text was updated successfully, but these errors were encountered:
Looks like when parsing the QuerySnapshot the metadata of the QuerySnapshot is not included in the data that is passed back to the Dart side. I don't see any reason we could not add a field for this.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
metadata
inQuerySnapshot
is an existing Firestore feature in other platforms but it's not there in Flutter.The Flutter cloud_firestore library's
QuerySnapshot
object needs to provide ametadata
field that indicates whether the query result is coming from the cache or the server. The individualDocumentSnapshot
objects inQuerySnapshot
have thismetadata
field; however, when the query result is empty, we don't get anyDocumentSnapshot
objects and we have no idea whether theQuerySnapshot
came from the cache (offline) or from the server.Android and Web already have
metadata
inQuerySnapshot
. I didn't check other platforms.I was hoping I could fix it myself and provide a PR, however it seems we just don't get that data under the hood. When I set a breakpoint here, I see that
data
, which is the result ofQuery#getDocuments
has only these fields:The
metadatas
field is related to the individualDocumentSnapshot
s. When the query result is empty, all of these lists are empty as well. Hence the lack of metadata about our query.It seems this is coming from a platform channel, so definitely it must be using Android Firebase libraries. However, as I said above, Android libraries have
metadata
forQuerySnapshot
but Flutter, which seems to be using the Android libraries through a platform channel does not have it. Is this because the Flutter plugin is using an old version of the Android library?The current way to add Firebase to Flutter does not have anything about Android Firebase library versions. Only
classpath 'com.google.gms:google-services:3.2.1'
seems to be a versioned thing, is it what's holding this back? I tried 4.2.0 but it's the same.Here is a relevant discussion in Slack. I'd appreciate any suggestion.
The text was updated successfully, but these errors were encountered: