Skip to content

Commit bd85150

Browse files
authored
Fix #2822: consistent write timing between refs and WriteBatch (#2823)
1 parent 1d7f06c commit bd85150

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/firestore/src/api/database.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -948,12 +948,14 @@ export class WriteBatch implements firestore.WriteBatch {
948948
return this;
949949
}
950950

951-
async commit(): Promise<void> {
951+
commit(): Promise<void> {
952952
this.verifyNotCommitted();
953953
this._committed = true;
954954
if (this._mutations.length > 0) {
955955
return this._firestore.ensureClientConfigured().write(this._mutations);
956956
}
957+
958+
return Promise.resolve();
957959
}
958960

959961
private verifyNotCommitted(): void {

0 commit comments

Comments
 (0)