Skip to content

Commit 48a6324

Browse files
committed
local store tests PASS
1 parent 667c398 commit 48a6324

File tree

5 files changed

+163
-99
lines changed

5 files changed

+163
-99
lines changed

packages/firestore/src/core/pipeline_run.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ function evaluateDocuments(
234234
return input.filter(input => {
235235
return (
236236
input.isFoundDocument() &&
237-
stage.docPaths.includes(input.key.path.canonicalString())
237+
stage.docPaths.includes(input.key.path.toStringWithLeadingSlash())
238238
);
239239
});
240240
}

packages/firestore/src/local/local_store_impl.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -952,24 +952,6 @@ export function localStoreAllocateTarget(
952952
target: Target | Pipeline
953953
): Promise<TargetData> {
954954
const localStoreImpl = debugCast(localStore, LocalStoreImpl);
955-
if (targetIsPipelineTarget(target)) {
956-
return localStoreImpl.persistence.runTransaction(
957-
'Allocate pipeline target',
958-
'readwrite',
959-
txn => {
960-
return localStoreImpl.targetCache
961-
.allocateTargetId(txn)
962-
.next(targetId => {
963-
return new TargetData(
964-
target,
965-
targetId,
966-
TargetPurpose.Listen,
967-
txn.currentSequenceNumber
968-
);
969-
});
970-
}
971-
);
972-
}
973955

974956
return localStoreImpl.persistence
975957
.runTransaction('Allocate target', 'readwrite', txn => {

packages/firestore/src/local/memory_persistence.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ export class MemoryEagerDelegate implements MemoryReferenceDelegate {
298298
const changeBuffer = cache.newChangeBuffer();
299299
return PersistencePromise.forEach(
300300
this.orphanedDocuments,
301-
(path: string) => {
301+
(path: string): PersistencePromise<void> => {
302302
const key = DocumentKey.fromPath(path);
303303
return this.isReferenced(txn, key).next(isReferenced => {
304304
if (!isReferenced) {

packages/firestore/src/model/path.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ export class ResourcePath extends BasePath<ResourcePath> {
217217
return this.canonicalString();
218218
}
219219

220+
toStringWithLeadingSlash(): string {
221+
return `/${this.canonicalString()}`;
222+
}
223+
220224
/**
221225
* Returns a string representation of this path
222226
* where each path segment has been encoded with

0 commit comments

Comments
 (0)