Skip to content

Commit 6ceeab8

Browse files
committed
library_idbfs.js: Handle transaction.onabort in reconcile()
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 0671dfc commit 6ceeab8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/library_idbfs.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,12 @@ addToLibrary({
280280
}
281281
};
282282

283+
// transaction may abort if (for example) there is a QuotaExceededError
284+
transaction.onabort = (e) => {
285+
done(event.target.error); // DOMException
286+
e.preventDefault();
287+
};
288+
283289
// sort paths in ascending order so directory entries are created
284290
// before the files inside them
285291
create.sort().forEach((path) => {

0 commit comments

Comments
 (0)