Skip to content

Commit 64586d2

Browse files
ehsannasjeremyjiang-dev
authored andcommitted
Better comment about not returning partial batch overlays. (#3405)
1 parent 2f6b6d2 commit 64586d2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

firebase-firestore/src/main/java/com/google/firebase/firestore/local/SQLiteDocumentOverlayCache.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ public Map<DocumentKey, Overlay> getOverlays(
120120
return result;
121121
}
122122

123-
// Finish batch
123+
// This function should not return partial batch overlays, even if the number of overlays in the
124+
// result set exceeds the given `count` argument. Since the `LIMIT` in the above query might
125+
// result in a partial batch, the following query appends any remaining overlays for the last
126+
// batch.
124127
DocumentKey key = lastOverlay[0].getKey();
125128
String encodedCollectionPath = EncodedPath.encode(key.getCollectionPath());
126129
db.query(

0 commit comments

Comments
 (0)