46
46
using firebase::firestore::auth::User;
47
47
using firebase::firestore::model::SnapshotVersion;
48
48
using firebase::firestore::model::DocumentKeySet;
49
+ using firebase::firestore::model::TargetId;
49
50
50
51
NS_ASSUME_NONNULL_BEGIN
51
52
@@ -56,7 +57,7 @@ @interface FSTLocalStoreTests ()
56
57
57
58
@property (nonatomic , strong , readonly ) NSMutableArray <FSTMutationBatch *> *batches;
58
59
@property (nonatomic , strong , readwrite , nullable ) FSTMaybeDocumentDictionary *lastChanges;
59
- @property (nonatomic , assign , readwrite ) FSTTargetID lastTargetID;
60
+ @property (nonatomic , assign , readwrite ) TargetId lastTargetID;
60
61
61
62
@end
62
63
@@ -144,7 +145,7 @@ - (void)rejectMutation {
144
145
self.lastChanges = [self .localStore rejectBatchID: batch.batchID];
145
146
}
146
147
147
- - (FSTTargetID )allocateQuery : (FSTQuery *)query {
148
+ - (TargetId )allocateQuery : (FSTQuery *)query {
148
149
FSTQueryData *queryData = [self .localStore allocateQuery: query];
149
150
self.lastTargetID = queryData.targetID ;
150
151
return queryData.targetID ;
@@ -240,7 +241,7 @@ - (void)testHandlesSetMutationThenDocument {
240
241
FSTAssertContains (FSTTestDoc (" foo/bar" , 0 , @{@" foo" : @" bar" }, YES ));
241
242
242
243
FSTQuery *query = FSTTestQuery (" foo" );
243
- FSTTargetID targetID = [self allocateQuery: query];
244
+ TargetId targetID = [self allocateQuery: query];
244
245
245
246
[self
246
247
applyRemoteEvent: FSTTestUpdateRemoteEvent (FSTTestDoc (" foo/bar" , 2 , @{@" it" : @" changed" }, NO ),
@@ -254,7 +255,7 @@ - (void)testHandlesAckThenRejectThenRemoteEvent {
254
255
255
256
// Start a query that requires acks to be held.
256
257
FSTQuery *query = FSTTestQuery (" foo" );
257
- FSTTargetID targetID = [self allocateQuery: query];
258
+ TargetId targetID = [self allocateQuery: query];
258
259
259
260
[self writeMutation: FSTTestSetMutation (@" foo/bar" , @{@" foo" : @" bar" })];
260
261
FSTAssertChanged (@[ FSTTestDoc (" foo/bar" , 0 , @{@" foo" : @" bar" }, YES ) ]);
@@ -285,7 +286,7 @@ - (void)testHandlesDeletedDocumentThenSetMutationThenAck {
285
286
if ([self isTestBaseClass ]) return ;
286
287
287
288
FSTQuery *query = FSTTestQuery (" foo" );
288
- FSTTargetID targetID = [self allocateQuery: query];
289
+ TargetId targetID = [self allocateQuery: query];
289
290
290
291
[self applyRemoteEvent: FSTTestUpdateRemoteEvent (FSTTestDeletedDoc (" foo/bar" , 2 ), @[ @(targetID) ],
291
292
@[])];
@@ -318,7 +319,7 @@ - (void)testHandlesSetMutationThenDeletedDocument {
318
319
if ([self isTestBaseClass ]) return ;
319
320
320
321
FSTQuery *query = FSTTestQuery (" foo" );
321
- FSTTargetID targetID = [self allocateQuery: query];
322
+ TargetId targetID = [self allocateQuery: query];
322
323
323
324
[self writeMutation: FSTTestSetMutation (@" foo/bar" , @{@" foo" : @" bar" })];
324
325
FSTAssertChanged (@[ FSTTestDoc (" foo/bar" , 0 , @{@" foo" : @" bar" }, YES ) ]);
@@ -334,7 +335,7 @@ - (void)testHandlesDocumentThenSetMutationThenAckThenDocument {
334
335
335
336
// Start a query that requires acks to be held.
336
337
FSTQuery *query = FSTTestQuery (" foo" );
337
- FSTTargetID targetID = [self allocateQuery: query];
338
+ TargetId targetID = [self allocateQuery: query];
338
339
339
340
[self applyRemoteEvent: FSTTestAddedRemoteEvent (FSTTestDoc (" foo/bar" , 2 , @{@" it" : @" base" }, NO ),
340
341
@[ @(targetID) ])];
@@ -377,7 +378,7 @@ - (void)testHandlesPatchMutationThenDocumentThenAck {
377
378
FSTAssertNotContains (@" foo/bar" );
378
379
379
380
FSTQuery *query = FSTTestQuery (" foo" );
380
- FSTTargetID targetID = [self allocateQuery: query];
381
+ TargetId targetID = [self allocateQuery: query];
381
382
382
383
[self applyRemoteEvent: FSTTestAddedRemoteEvent (FSTTestDoc (" foo/bar" , 1 , @{@" it" : @" base" }, NO ),
383
384
@[ @(targetID) ])];
@@ -410,7 +411,7 @@ - (void)testHandlesPatchMutationThenAckThenDocument {
410
411
FSTAssertNotContains (@" foo/bar" );
411
412
412
413
FSTQuery *query = FSTTestQuery (" foo" );
413
- FSTTargetID targetID = [self allocateQuery: query];
414
+ TargetId targetID = [self allocateQuery: query];
414
415
415
416
[self applyRemoteEvent: FSTTestUpdateRemoteEvent (FSTTestDoc (" foo/bar" , 1 , @{@" it" : @" base" }, NO ),
416
417
@[ @(targetID) ], @[])];
@@ -437,7 +438,7 @@ - (void)testHandlesDocumentThenDeleteMutationThenAck {
437
438
if ([self isTestBaseClass ]) return ;
438
439
439
440
FSTQuery *query = FSTTestQuery (" foo" );
440
- FSTTargetID targetID = [self allocateQuery: query];
441
+ TargetId targetID = [self allocateQuery: query];
441
442
442
443
[self applyRemoteEvent: FSTTestUpdateRemoteEvent (FSTTestDoc (" foo/bar" , 1 , @{@" it" : @" base" }, NO ),
443
444
@[ @(targetID) ], @[])];
@@ -463,7 +464,7 @@ - (void)testHandlesDeleteMutationThenDocumentThenAck {
463
464
if ([self isTestBaseClass ]) return ;
464
465
465
466
FSTQuery *query = FSTTestQuery (" foo" );
466
- FSTTargetID targetID = [self allocateQuery: query];
467
+ TargetId targetID = [self allocateQuery: query];
467
468
468
469
[self writeMutation: FSTTestDeleteMutation (@" foo/bar" )];
469
470
FSTAssertRemoved (@[ @" foo/bar" ]);
@@ -491,7 +492,7 @@ - (void)testHandlesDocumentThenDeletedDocumentThenDocument {
491
492
if ([self isTestBaseClass ]) return ;
492
493
493
494
FSTQuery *query = FSTTestQuery (" foo" );
494
- FSTTargetID targetID = [self allocateQuery: query];
495
+ TargetId targetID = [self allocateQuery: query];
495
496
496
497
[self applyRemoteEvent: FSTTestUpdateRemoteEvent (FSTTestDoc (" foo/bar" , 1 , @{@" it" : @" base" }, NO ),
497
498
@[ @(targetID) ], @[])];
@@ -524,7 +525,7 @@ - (void)testHandlesSetMutationThenPatchMutationThenDocumentThenAckThenAck {
524
525
FSTAssertContains (FSTTestDoc (" foo/bar" , 0 , @{@" foo" : @" bar" }, YES ));
525
526
526
527
FSTQuery *query = FSTTestQuery (" foo" );
527
- FSTTargetID targetID = [self allocateQuery: query];
528
+ TargetId targetID = [self allocateQuery: query];
528
529
529
530
[self applyRemoteEvent: FSTTestUpdateRemoteEvent (FSTTestDoc (" foo/bar" , 1 , @{@" it" : @" base" }, NO ),
530
531
@[ @(targetID) ], @[])];
@@ -631,7 +632,7 @@ - (void)testCollectsGarbageAfterChangeBatch {
631
632
if (![self gcIsEager ]) return ;
632
633
633
634
FSTQuery *query = FSTTestQuery (" foo" );
634
- FSTTargetID targetID = [self allocateQuery: query];
635
+ TargetId targetID = [self allocateQuery: query];
635
636
636
637
[self applyRemoteEvent: FSTTestAddedRemoteEvent (FSTTestDoc (" foo/bar" , 2 , @{@" foo" : @" bar" }, NO ),
637
638
@[ @(targetID) ])];
@@ -648,7 +649,7 @@ - (void)testCollectsGarbageAfterAcknowledgedMutation {
648
649
if (![self gcIsEager ]) return ;
649
650
650
651
FSTQuery *query = FSTTestQuery (" foo" );
651
- FSTTargetID targetID = [self allocateQuery: query];
652
+ TargetId targetID = [self allocateQuery: query];
652
653
653
654
[self applyRemoteEvent: FSTTestUpdateRemoteEvent (FSTTestDoc (" foo/bar" , 0 , @{@" foo" : @" old" }, NO ),
654
655
@[ @(targetID) ], @[])];
@@ -683,7 +684,7 @@ - (void)testCollectsGarbageAfterRejectedMutation {
683
684
if (![self gcIsEager ]) return ;
684
685
685
686
FSTQuery *query = FSTTestQuery (" foo" );
686
- FSTTargetID targetID = [self allocateQuery: query];
687
+ TargetId targetID = [self allocateQuery: query];
687
688
688
689
[self applyRemoteEvent: FSTTestUpdateRemoteEvent (FSTTestDoc (" foo/bar" , 0 , @{@" foo" : @" old" }, NO ),
689
690
@[ @(targetID) ], @[])];
@@ -718,7 +719,7 @@ - (void)testPinsDocumentsInTheLocalView {
718
719
if (![self gcIsEager ]) return ;
719
720
720
721
FSTQuery *query = FSTTestQuery (" foo" );
721
- FSTTargetID targetID = [self allocateQuery: query];
722
+ TargetId targetID = [self allocateQuery: query];
722
723
723
724
[self applyRemoteEvent: FSTTestAddedRemoteEvent (FSTTestDoc (" foo/bar" , 1 , @{@" foo" : @" bar" }, NO ),
724
725
@[ @(targetID) ])];
@@ -749,7 +750,7 @@ - (void)testThrowsAwayDocumentsWithUnknownTargetIDsImmediately {
749
750
if ([self isTestBaseClass ]) return ;
750
751
if (![self gcIsEager ]) return ;
751
752
752
- FSTTargetID targetID = 321 ;
753
+ TargetId targetID = 321 ;
753
754
[self applyRemoteEvent: FSTTestUpdateRemoteEventWithLimboTargets (FSTTestDoc (" foo/bar" , 1 , @{}, NO ),
754
755
@[], @[], @[ @(targetID) ])];
755
756
0 commit comments