aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source/Local/FSTLevelDBQueryCache.mm
diff options
context:
space:
mode:
authorGravatar Greg Soltis <gsoltis@google.com>2018-05-08 10:49:54 -0700
committerGravatar GitHub <noreply@github.com>2018-05-08 10:49:54 -0700
commitdddd75037ddd0937f2526ae7b43b62f571b22f49 (patch)
tree8397a40f214a9fc730b49b987669f2c40c03ea42 /Firestore/Source/Local/FSTLevelDBQueryCache.mm
parentae5f163b8480310d38cf5589fe58cde6fb060c6e (diff)
Introduce ReferenceDelegates (#1222)
* Bump sequence number on resume token refresh * Style * Fix comment formatting * Add FSTReferenceDelegate definition and documentation * Add methods to return nil for delegates, wire up inMemoryPins * Add hook for removing a reference * Start work on reference delegates * Fix up tests to support adding documents at a sequence number * Implement removing references * Remove from target when dropped from local view * Fix warning * Add hooks for removal from mutation queue * Add hooks for limbo document updates * Style * Drop commented-out code * Fixup after merging master * Drop sequence number plumbing * Style * Drop errant semicolon
Diffstat (limited to 'Firestore/Source/Local/FSTLevelDBQueryCache.mm')
-rw-r--r--Firestore/Source/Local/FSTLevelDBQueryCache.mm4
1 files changed, 3 insertions, 1 deletions
diff --git a/Firestore/Source/Local/FSTLevelDBQueryCache.mm b/Firestore/Source/Local/FSTLevelDBQueryCache.mm
index 97b218d..68b6f98 100644
--- a/Firestore/Source/Local/FSTLevelDBQueryCache.mm
+++ b/Firestore/Source/Local/FSTLevelDBQueryCache.mm
@@ -294,7 +294,8 @@ using firebase::firestore::model::DocumentKeySet;
[FSTLevelDBTargetDocumentKey keyWithTargetID:targetID documentKey:key], emptyBuffer);
self->_db.currentTransaction->Put(
[FSTLevelDBDocumentTargetKey keyWithDocumentKey:key targetID:targetID], emptyBuffer);
- }
+ [self->_db.referenceDelegate addReference:key target:targetID];
+ };
}
- (void)removeMatchingKeys:(const DocumentKeySet &)keys forTargetID:(FSTTargetID)targetID {
@@ -303,6 +304,7 @@ using firebase::firestore::model::DocumentKeySet;
[FSTLevelDBTargetDocumentKey keyWithTargetID:targetID documentKey:key]);
self->_db.currentTransaction->Delete(
[FSTLevelDBDocumentTargetKey keyWithDocumentKey:key targetID:targetID]);
+ [self->_db.referenceDelegate removeReference:key target:targetID];
[self.garbageCollector addPotentialGarbageKey:key];
}
}