@@ -56,10 +56,10 @@ - (void)testRaisesCollectionEvents {
56
56
NSMutableArray <FSTViewSnapshot *> *otherAccum = [NSMutableArray array ];
57
57
58
58
FSTQuery *query = FSTTestQuery (" rooms" );
59
- FSTDocument *doc1 = FSTTestDoc (" rooms/Eros" , 1 , @{@" name" : @" Eros" }, NO );
60
- FSTDocument *doc2 = FSTTestDoc (" rooms/Hades" , 2 , @{@" name" : @" Hades" }, NO );
61
- FSTDocument *doc2prime =
62
- FSTTestDoc ( " rooms/Hades " , 3 , @{ @" name " : @" Hades " , @" owner " : @" Jonny " }, NO );
59
+ FSTDocument *doc1 = FSTTestDoc (" rooms/Eros" , 1 , @{@" name" : @" Eros" }, FSTDocumentStateSynced );
60
+ FSTDocument *doc2 = FSTTestDoc (" rooms/Hades" , 2 , @{@" name" : @" Hades" }, FSTDocumentStateSynced );
61
+ FSTDocument *doc2prime = FSTTestDoc ( " rooms/Hades " , 3 , @{ @" name " : @" Hades " , @" owner " : @" Jonny " },
62
+ FSTDocumentStateSynced );
63
63
64
64
FSTQueryListener *listener = [self listenToQuery: query accumulatingSnapshots: accum];
65
65
FSTQueryListener *otherListener = [self listenToQuery: query accumulatingSnapshots: otherAccum];
@@ -133,8 +133,8 @@ - (void)testMutingAsyncListenerPreventsAllSubsequentEvents {
133
133
NSMutableArray <FSTViewSnapshot *> *accum = [NSMutableArray array ];
134
134
135
135
FSTQuery *query = FSTTestQuery (" rooms/Eros" );
136
- FSTDocument *doc1 = FSTTestDoc (" rooms/Eros" , 3 , @{@" name" : @" Eros" }, NO );
137
- FSTDocument *doc2 = FSTTestDoc (" rooms/Eros" , 4 , @{@" name" : @" Eros2" }, NO );
136
+ FSTDocument *doc1 = FSTTestDoc (" rooms/Eros" , 3 , @{@" name" : @" Eros" }, FSTDocumentStateSynced );
137
+ FSTDocument *doc2 = FSTTestDoc (" rooms/Eros" , 4 , @{@" name" : @" Eros2" }, FSTDocumentStateSynced );
138
138
139
139
__block FSTAsyncQueryListener *listener =
140
140
[[FSTAsyncQueryListener alloc ] initWithExecutor: _executor.get ()
@@ -171,8 +171,8 @@ - (void)testDoesNotRaiseEventsForMetadataChangesUnlessSpecified {
171
171
NSMutableArray <FSTViewSnapshot *> *fullAccum = [NSMutableArray array ];
172
172
173
173
FSTQuery *query = FSTTestQuery (" rooms" );
174
- FSTDocument *doc1 = FSTTestDoc (" rooms/Eros" , 1 , @{@" name" : @" Eros" }, NO );
175
- FSTDocument *doc2 = FSTTestDoc (" rooms/Hades" , 2 , @{@" name" : @" Hades" }, NO );
174
+ FSTDocument *doc1 = FSTTestDoc (" rooms/Eros" , 1 , @{@" name" : @" Eros" }, FSTDocumentStateSynced );
175
+ FSTDocument *doc2 = FSTTestDoc (" rooms/Hades" , 2 , @{@" name" : @" Hades" }, FSTDocumentStateSynced );
176
176
177
177
FSTListenOptions *options = [[FSTListenOptions alloc ] initWithIncludeQueryMetadataChanges: YES
178
178
includeDocumentMetadataChanges: NO
@@ -207,10 +207,12 @@ - (void)testRaisesDocumentMetadataEventsOnlyWhenSpecified {
207
207
NSMutableArray <FSTViewSnapshot *> *fullAccum = [NSMutableArray array ];
208
208
209
209
FSTQuery *query = FSTTestQuery (" rooms" );
210
- FSTDocument *doc1 = FSTTestDoc (" rooms/Eros" , 1 , @{@" name" : @" Eros" }, YES );
211
- FSTDocument *doc2 = FSTTestDoc (" rooms/Hades" , 2 , @{@" name" : @" Hades" }, NO );
212
- FSTDocument *doc1Prime = FSTTestDoc (" rooms/Eros" , 1 , @{@" name" : @" Eros" }, NO );
213
- FSTDocument *doc3 = FSTTestDoc (" rooms/Other" , 3 , @{@" name" : @" Other" }, NO );
210
+ FSTDocument *doc1 =
211
+ FSTTestDoc (" rooms/Eros" , 1 , @{@" name" : @" Eros" }, FSTDocumentStateLocalMutations);
212
+ FSTDocument *doc2 = FSTTestDoc (" rooms/Hades" , 2 , @{@" name" : @" Hades" }, FSTDocumentStateSynced);
213
+ FSTDocument *doc1Prime =
214
+ FSTTestDoc (" rooms/Eros" , 1 , @{@" name" : @" Eros" }, FSTDocumentStateSynced);
215
+ FSTDocument *doc3 = FSTTestDoc (" rooms/Other" , 3 , @{@" name" : @" Other" }, FSTDocumentStateSynced);
214
216
215
217
FSTListenOptions *options = [[FSTListenOptions alloc ] initWithIncludeQueryMetadataChanges: NO
216
218
includeDocumentMetadataChanges: YES
@@ -256,11 +258,15 @@ - (void)testRaisesQueryMetadataEventsOnlyWhenHasPendingWritesOnTheQueryChanges {
256
258
NSMutableArray <FSTViewSnapshot *> *fullAccum = [NSMutableArray array ];
257
259
258
260
FSTQuery *query = FSTTestQuery (" rooms" );
259
- FSTDocument *doc1 = FSTTestDoc (" rooms/Eros" , 1 , @{@" name" : @" Eros" }, YES );
260
- FSTDocument *doc2 = FSTTestDoc (" rooms/Hades" , 2 , @{@" name" : @" Hades" }, YES );
261
- FSTDocument *doc1Prime = FSTTestDoc (" rooms/Eros" , 1 , @{@" name" : @" Eros" }, NO );
262
- FSTDocument *doc2Prime = FSTTestDoc (" rooms/Hades" , 2 , @{@" name" : @" Hades" }, NO );
263
- FSTDocument *doc3 = FSTTestDoc (" rooms/Other" , 3 , @{@" name" : @" Other" }, NO );
261
+ FSTDocument *doc1 =
262
+ FSTTestDoc (" rooms/Eros" , 1 , @{@" name" : @" Eros" }, FSTDocumentStateLocalMutations);
263
+ FSTDocument *doc2 =
264
+ FSTTestDoc (" rooms/Hades" , 2 , @{@" name" : @" Hades" }, FSTDocumentStateLocalMutations);
265
+ FSTDocument *doc1Prime =
266
+ FSTTestDoc (" rooms/Eros" , 1 , @{@" name" : @" Eros" }, FSTDocumentStateSynced);
267
+ FSTDocument *doc2Prime =
268
+ FSTTestDoc (" rooms/Hades" , 2 , @{@" name" : @" Hades" }, FSTDocumentStateSynced);
269
+ FSTDocument *doc3 = FSTTestDoc (" rooms/Other" , 3 , @{@" name" : @" Other" }, FSTDocumentStateSynced);
264
270
265
271
FSTListenOptions *options = [[FSTListenOptions alloc ] initWithIncludeQueryMetadataChanges: YES
266
272
includeDocumentMetadataChanges: NO
@@ -293,10 +299,12 @@ - (void)testMetadataOnlyDocumentChangesAreFilteredOutWhenIncludeDocumentMetadata
293
299
NSMutableArray <FSTViewSnapshot *> *filteredAccum = [NSMutableArray array ];
294
300
295
301
FSTQuery *query = FSTTestQuery (" rooms" );
296
- FSTDocument *doc1 = FSTTestDoc (" rooms/Eros" , 1 , @{@" name" : @" Eros" }, YES );
297
- FSTDocument *doc2 = FSTTestDoc (" rooms/Hades" , 2 , @{@" name" : @" Hades" }, NO );
298
- FSTDocument *doc1Prime = FSTTestDoc (" rooms/Eros" , 1 , @{@" name" : @" Eros" }, NO );
299
- FSTDocument *doc3 = FSTTestDoc (" rooms/Other" , 3 , @{@" name" : @" Other" }, NO );
302
+ FSTDocument *doc1 =
303
+ FSTTestDoc (" rooms/Eros" , 1 , @{@" name" : @" Eros" }, FSTDocumentStateLocalMutations);
304
+ FSTDocument *doc2 = FSTTestDoc (" rooms/Hades" , 2 , @{@" name" : @" Hades" }, FSTDocumentStateSynced);
305
+ FSTDocument *doc1Prime =
306
+ FSTTestDoc (" rooms/Eros" , 1 , @{@" name" : @" Eros" }, FSTDocumentStateSynced);
307
+ FSTDocument *doc3 = FSTTestDoc (" rooms/Other" , 3 , @{@" name" : @" Other" }, FSTDocumentStateSynced);
300
308
301
309
FSTQueryListener *filteredListener =
302
310
[self listenToQuery: query accumulatingSnapshots: filteredAccum];
@@ -325,8 +333,8 @@ - (void)testWillWaitForSyncIfOnline {
325
333
NSMutableArray <FSTViewSnapshot *> *events = [NSMutableArray array ];
326
334
327
335
FSTQuery *query = FSTTestQuery (" rooms" );
328
- FSTDocument *doc1 = FSTTestDoc (" rooms/Eros" , 1 , @{@" name" : @" Eros" }, NO );
329
- FSTDocument *doc2 = FSTTestDoc (" rooms/Hades" , 2 , @{@" name" : @" Hades" }, NO );
336
+ FSTDocument *doc1 = FSTTestDoc (" rooms/Eros" , 1 , @{@" name" : @" Eros" }, FSTDocumentStateSynced );
337
+ FSTDocument *doc2 = FSTTestDoc (" rooms/Hades" , 2 , @{@" name" : @" Hades" }, FSTDocumentStateSynced );
330
338
FSTQueryListener *listener =
331
339
[self listenToQuery: query
332
340
options: [[FSTListenOptions alloc ] initWithIncludeQueryMetadataChanges: NO
@@ -366,8 +374,8 @@ - (void)testWillRaiseInitialEventWhenGoingOffline {
366
374
NSMutableArray <FSTViewSnapshot *> *events = [NSMutableArray array ];
367
375
368
376
FSTQuery *query = FSTTestQuery (" rooms" );
369
- FSTDocument *doc1 = FSTTestDoc (" rooms/Eros" , 1 , @{@" name" : @" Eros" }, NO );
370
- FSTDocument *doc2 = FSTTestDoc (" rooms/Hades" , 2 , @{@" name" : @" Hades" }, NO );
377
+ FSTDocument *doc1 = FSTTestDoc (" rooms/Eros" , 1 , @{@" name" : @" Eros" }, FSTDocumentStateSynced );
378
+ FSTDocument *doc2 = FSTTestDoc (" rooms/Hades" , 2 , @{@" name" : @" Hades" }, FSTDocumentStateSynced );
371
379
FSTQueryListener *listener =
372
380
[self listenToQuery: query
373
381
options: [[FSTListenOptions alloc ] initWithIncludeQueryMetadataChanges: NO
0 commit comments