Implement paginated queries for LOI requests to firebase - #3881
Merged
Conversation
andreia-ferreira
requested a deployment
to
e2e-approval
August 13, 2026 07:55 — with
GitHub Actions
Waiting
andreia-ferreira
requested a deployment
to
e2e-approval
August 13, 2026 09:33 — with
GitHub Actions
Waiting
shobhitagarwal1612
approved these changes
Aug 17, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3881 +/- ##
============================================
+ Coverage 68.04% 68.08% +0.04%
- Complexity 1884 1886 +2
============================================
Files 411 411
Lines 10881 10877 -4
Branches 1426 1423 -3
============================================
+ Hits 7404 7406 +2
+ Misses 2734 2733 -1
+ Partials 743 738 -5
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Towards #3866
LOIs were fetched in a single unbounded Firestore query and held entirely in memory before anything was written to the local database. For large surveys, this could use a lot of memory and significantly slow down the initial loading.
This PR introduces paginated queries, by requesting only a limited number of documents at a time and writing them to the db before fetching more. For this, the 3 LOI queries were changed to now return
Flow<List<LocationOfInterest>>and page through with orderBy(documentId()) + limit + startAfter.validateGeometrywas removed because it just checked for empty geometries, which is something that it's already done byRoomLocationOfInterestStore.insertOrUpdateAll.@shobhitagarwal1612 PTAL?