Skip to content

Commit 055df3e

Browse files
Start backend query processing before local cache processing (#3422)
1 parent 10296e1 commit 055df3e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

firebase-firestore/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ by opting into a release at
88
AppCheck users that set their expiration time to under an hour.
99
- [fixed] Fixed a potential problem during Firestore's shutdown that prevented
1010
the shutdown from proceeding if a network connection was opened right before.
11+
- [changed] Queries are now send to the backend before the SDK starts local
12+
processing, which reduces overall Query latency.
1113

1214
# 24.0.1
1315
- [changed] Improved performance for databases that contain many document

firebase-firestore/src/main/java/com/google/firebase/firestore/core/SyncEngine.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,11 @@ public int listen(Query query) {
201201
hardAssert(!queryViewsByQuery.containsKey(query), "We already listen to query: %s", query);
202202

203203
TargetData targetData = localStore.allocateTarget(query.toTarget());
204+
remoteStore.listen(targetData);
205+
204206
ViewSnapshot viewSnapshot = initializeViewAndComputeSnapshot(query, targetData.getTargetId());
205207
syncEngineListener.onViewSnapshots(Collections.singletonList(viewSnapshot));
206208

207-
remoteStore.listen(targetData);
208209
return targetData.getTargetId();
209210
}
210211

0 commit comments

Comments
 (0)