Skip to content

Start backend query processing before local cache processing #3422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions firebase-firestore/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ by opting into a release at
AppCheck users that set their expiration time to under an hour.
- [fixed] Fixed a potential problem during Firestore's shutdown that prevented
the shutdown from proceeding if a network connection was opened right before.
- [changed] Queries are now send to the backend before the SDK starts local
processing, which reduces overall Query latency.

# 24.0.1
- [changed] Improved performance for databases that contain many document
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,11 @@ public int listen(Query query) {
hardAssert(!queryViewsByQuery.containsKey(query), "We already listen to query: %s", query);

TargetData targetData = localStore.allocateTarget(query.toTarget());
remoteStore.listen(targetData);

ViewSnapshot viewSnapshot = initializeViewAndComputeSnapshot(query, targetData.getTargetId());
syncEngineListener.onViewSnapshots(Collections.singletonList(viewSnapshot));

remoteStore.listen(targetData);
return targetData.getTargetId();
}

Expand Down