-
Notifications
You must be signed in to change notification settings - Fork 70
Description
After #458, the condition for closing with an error was changed to check the requests error.
Unfortunately that will never be true, as we pass that point before the request has its error set.
Following the flow, it seems to go like this:
open -> upgrade -> queue TASK A -> wait for finished state -> close if request's error is set
TASK A -> upgrade needed -> did throw = true -> abort -> transaction set as finished -> queue TASK B
TASK B -> request gets its error set.
Since the transaction gets marked as finished before TASK B is started (we will finish TASK A with TASK B still pending), upgrade will then check if the transaction is finished, (which it is at this point), go back to open, where step 10.8 will not see the error yet.
Possible idea for solution:
- New step after 5. in abort:
If transaction is an upgrade transaction: Set transaction's associated request's error to a newly created "AbortError" DOMException.