LibWeb: Don't set a transaction request's error until after JS finishes

Otherwise, the JS can't access the `result` property anymore.
This commit is contained in:
Zaggy1024
2026-03-04 22:27:05 -06:00
committed by Gregory Bertilson
parent 30e21c2790
commit 9ec949980a
Notes: github-actions[bot] 2026-03-05 23:42:50 +00:00
3 changed files with 37 additions and 7 deletions

View File

@@ -602,13 +602,6 @@ void abort_a_transaction(GC::Ref<IDBTransaction> transaction, GC::Ptr<WebIDL::DO
// 5. Set transactions error to error.
transaction->set_error(error);
// FIXME: https://github.com/w3c/IndexedDB/issues/473
// x. If transaction is an upgrade transaction:
if (transaction->is_upgrade_transaction()) {
// 1. Set transaction's associated request's error to a newly created "AbortError" DOMException.
transaction->associated_request()->set_error(WebIDL::AbortError::create(transaction->realm(), "Upgrade transaction was aborted"_utf16));
}
// 6. For each request of transactions request list,
for (auto const& request : transaction->request_list()) {
// FIXME: abort the steps to asynchronously execute a request for request,
@@ -654,6 +647,10 @@ void abort_a_transaction(GC::Ref<IDBTransaction> transaction, GC::Ptr<WebIDL::DO
// 3. Set requests result to undefined.
request->set_result(JS::js_undefined());
// FIXME: https://github.com/w3c/IndexedDB/issues/473
// x. Set transaction's associated request's error to a newly created "AbortError" DOMException.
request->set_error(WebIDL::AbortError::create(transaction->realm(), "Upgrade transaction was aborted"_utf16));
// 4. Set requests processed flag to false.
// FIXME: request->set_processed(false);