File tree 3 files changed +7
-3
lines changed
3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,11 @@ - (NSString *)toHashedId:(NSString *)docId {
125
125
- (void )assertOnlineAndOfflineResultsMatch : (FIRCollectionReference *)collection
126
126
withQuery : (FIRQuery *)query
127
127
expectedDocs : (NSArray <NSString *> *)expectedDocs {
128
- [self checkOnlineAndOfflineCollection: collection
128
+ // `checkOnlineAndOfflineCollection` first makes sure all documents needed for
129
+ // `query` are in the cache. It does so making a `get` on the first argument.
130
+ // Since *all* composite index tests use the same collection, this is very inefficient to do.
131
+ // Therefore, we should only do so for tests where `TEST_ID_FIELD` matches the current test.
132
+ [self checkOnlineAndOfflineCollection: [self compositeIndexQuery: collection]
129
133
query: query
130
134
matchesResult: [self toHashedIds: expectedDocs]];
131
135
}
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ extern "C" {
130
130
131
131
- (void )enableNetwork ;
132
132
133
- - (void )checkOnlineAndOfflineCollection : (FIRCollectionReference *)collection
133
+ - (void )checkOnlineAndOfflineCollection : (FIRQuery *)collection
134
134
query : (FIRQuery *)query
135
135
matchesResult : (NSArray *)expectedDocs ;
136
136
Original file line number Diff line number Diff line change @@ -636,7 +636,7 @@ - (void)enableNetwork {
636
636
* @param query The query to check
637
637
* @param expectedDocs Ordered list of document keys that are expected to match the query
638
638
*/
639
- - (void )checkOnlineAndOfflineCollection : (FIRCollectionReference *)collection
639
+ - (void )checkOnlineAndOfflineCollection : (FIRQuery *)collection
640
640
query : (FIRQuery *)query
641
641
matchesResult : (NSArray *)expectedDocs {
642
642
// Note: Order matters. The following has to be done in the specific order:
You can’t perform that action at this time.
0 commit comments