Skip to content

Commit

Permalink
library_idbfs.js: Handle transaction.onabort in reconcile() (emsc…
Browse files Browse the repository at this point in the history
…ripten-core#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.
  • Loading branch information
past-due authored and mrolig5267319 committed Feb 23, 2024
1 parent c717638 commit 4de8218
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/library_idbfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,9 @@ addToLibrary({
}
};

transaction.onerror = (e) => {
done(this.error);
// transaction may abort if (for example) there is a QuotaExceededError
transaction.onerror = transaction.onabort = (e) => {
done(e.target.error);
e.preventDefault();
};

Expand Down

0 comments on commit 4de8218

Please sign in to comment.