Skip to content

Commit e4ec036

Browse files
author
Greg Soltis
authored
Ensure owner lease in owner lease refresh loop (#1072)
* Ensure owner lease in owner lease refresh loop * Make it actually do the thing this time
1 parent bb97c27 commit e4ec036

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/firestore/src/local/indexeddb_persistence.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,10 @@ export class IndexedDbPersistence implements Persistence {
353353
'readwrite',
354354
ALL_STORES,
355355
txn => {
356-
// NOTE: We don't need to validate the current owner contents, since
357-
// runTransaction does that automatically.
358-
const store = txn.store<DbOwnerKey, DbOwner>(DbOwner.store);
359-
return store.put('owner', new DbOwner(this.ownerId, Date.now()));
356+
return this.ensureOwnerLease(txn).next(() => {
357+
const store = txn.store<DbOwnerKey, DbOwner>(DbOwner.store);
358+
return store.put('owner', new DbOwner(this.ownerId, Date.now()));
359+
});
360360
}
361361
);
362362

0 commit comments

Comments
 (0)