Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ public void assertOnlineAndOfflineResultsMatch(
@NonNull CollectionReference collection,
@NonNull Query query,
@NonNull String... expectedDocs) {
checkOnlineAndOfflineResultsMatch(collection, query, toHashedIds(expectedDocs));
// `checkOnlineAndOfflineResultsMatch` first makes sure all documents needed for
// `query` are in the cache. It does so making a `get` on the first argument.
// Since *all* composite index tests use the same collection, this is very inefficient to do.
// Therefore, we should only do so for tests where `TEST_ID_FIELD` matches the current test.
checkOnlineAndOfflineResultsMatch(this.query(collection), query, toHashedIds(expectedDocs));
}

// Asserts that the IDs in the query snapshot matches the expected Ids. The expected document
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ public static List<Object> nullList() {
* @param expectedDocs Ordered list of document keys that are expected to match the query
*/
public static void checkOnlineAndOfflineResultsMatch(
CollectionReference collection, Query query, String... expectedDocs) {
Query collection, Query query, String... expectedDocs) {
// Note: Order matters. The following has to be done in the specific order:

// 1- Pre-populate the cache with the entire collection.
Expand Down
Loading