Skip to content

Commit 9890082

Browse files
Next bug fix
1 parent 313478c commit 9890082

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

packages/firestore/src/core/firestore_client.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,7 @@ export class FirestoreClient {
195195
});
196196

197197
// Block the async queue until initialization is done
198-
this.asyncQueue.enqueueAndForget(() => {
199-
return this.initializationDone.promise;
200-
});
198+
this.asyncQueue.enqueueAndForget(() => this.initializationDone.promise);
201199

202200
// Return only the result of enabling persistence. Note that this does not
203201
// need to await the completion of initializationDone because the result of
@@ -409,8 +407,8 @@ export class FirestoreClient {
409407
docKey: DocumentKey
410408
): Promise<Document | null> {
411409
this.verifyNotTerminated();
412-
await this.initializationDone;
413-
return enqueueReadDocumentFromLocalCache(
410+
await this.initializationDone.promise;
411+
return enqueueReadDocumentFromCache(
414412
this.asyncQueue,
415413
this.localStore,
416414
docKey
@@ -419,8 +417,8 @@ export class FirestoreClient {
419417

420418
async getDocumentsFromLocalCache(query: Query): Promise<ViewSnapshot> {
421419
this.verifyNotTerminated();
422-
await this.initializationDone;
423-
return enqueueExecuteQueryFromLocalCache(
420+
await this.initializationDone.promise;
421+
return enqueueExecuteQueryFromCache(
424422
this.asyncQueue,
425423
this.localStore,
426424
query
@@ -540,7 +538,7 @@ export function enqueueSnapshotsInSyncListen(
540538
};
541539
}
542540

543-
export async function enqueueReadDocumentFromLocalCache(
541+
export async function enqueueReadDocumentFromCache(
544542
asyncQueue: AsyncQueue,
545543
localStore: LocalStore,
546544
docKey: DocumentKey
@@ -575,7 +573,7 @@ export async function enqueueReadDocumentFromLocalCache(
575573
return deferred.promise;
576574
}
577575

578-
export async function enqueueExecuteQueryFromLocalCache(
576+
export async function enqueueExecuteQueryFromCache(
579577
asyncQueue: AsyncQueue,
580578
localStore: LocalStore,
581579
query: Query

0 commit comments

Comments
 (0)