Skip to content

Commit ff35d3f

Browse files
authored
library_idbfs.js: Handle transaction.onabort in reconcile() (#21326)
If the transaction aborts (which can happen due to, for example, a QuotaExceededError), `onabort` must be handled to ensure that the `callback` actually gets called.
1 parent 2185f45 commit ff35d3f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/library_idbfs.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,9 @@ addToLibrary({
269269
}
270270
};
271271

272-
transaction.onerror = (e) => {
273-
done(this.error);
272+
// transaction may abort if (for example) there is a QuotaExceededError
273+
transaction.onerror = transaction.onabort = (e) => {
274+
done(e.target.error);
274275
e.preventDefault();
275276
};
276277

0 commit comments

Comments
 (0)