fix(ui_firestore): keep loaded pages while the next page is only in cache - #709
Conversation
There was a problem hiding this comment.
Code Review
This pull request upgrades the google_sign_in dependency to version 7.1.0 across packages and updates the Google authentication provider and buttons to support the new API, including adding support for serverClientId and handling separate authentication and authorization steps. Additionally, it improves FirestoreQueryBuilder to prevent list shrinking and scroll resetting by keeping current pages until the server responds when a new listener emits from the local cache. Feedback suggests wrapping the initialization and sign-out process in a try-catch block to prevent potential exceptions from blocking the main logout flow.
0641025 to
4764095
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request improves the FirestoreQueryBuilder in firebase_ui_firestore to prevent list shrinking and scroll position resets when fetching subsequent pages. It retains current documents until the server responds or the user writes locally, ignoring smaller cached results while waiting for the server. It also optimizes the handling of metadata-only events and simplifies state updates on errors. Additionally, comprehensive widget tests have been added to verify these behaviors, and mock classes in tests have been updated accordingly. There are no review comments, and I have no further feedback to provide.
russellwheatley
left a comment
There was a problem hiding this comment.
One thing on the shrink check.
… while fetching more
Fixes #238.
Stops
FirestoreQueryBuilderfrom rendering a partial cache snapshot while fetching the next page, which shrank the list, sethasMoreto false and reset the scroll position on web.Changes
includeMetadataChangesis set.isFetchingandisFetchingMoreon every event and error, so a query change mid-fetch no longer leavesfetchMorestuck.