From c738d18da375478cb05461d01e896acce631c6dc Mon Sep 17 00:00:00 2001 From: Roy Hashimoto Date: Fri, 3 Nov 2023 08:19:50 -0700 Subject: [PATCH] Fix microtask starvation race. --- src/examples/IDBContext.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/examples/IDBContext.js b/src/examples/IDBContext.js index 1f74c8a9..48c962f8 100644 --- a/src/examples/IDBContext.js +++ b/src/examples/IDBContext.js @@ -126,6 +126,7 @@ export class IDBContext { async sync() { // Wait until all transactions since the previous sync have committed. // Throw if any transaction failed. + await this.#runChain; await this.#putChain; this.#putChain = Promise.resolve(); }