mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
Previously, after one request was marked as processed, we would synchronously queue another task to process the next request. This would mean that two open requests on the same database could interleave. This was especially problematic when one of the requests would cause the database to upgrade, since the second open request would begin processing before the upgradeneeded event fired, causing an exception to be thrown in the second open(). The solution is to explicitly check for continuation conditions after events have been fired in order to ensure that every step for the request is completed before starting any further request processing. For connection requests, the spec states: > Open requests are processed in a connection queue. The queue contains > all open requests associated with an storage key and a name. Requests > added to the connection queue processed in order and each request > must run to completion before the next request is processed. An open > request may be blocked on other connections, requiring those > connections to close before the request can complete and allow > further requests to be processed. For requests against a transaction, the spec states: > Once the transaction has been started the implementation can begin > executing the requests placed against the transaction. Requests must > be executed in the order in which they were made against the > transaction. Likewise, their results must be returned in the order > the requests were placed against a specific transaction. There is no > guarantee about the order that results from requests in different > transactions are returned. In the process of reworking it to use this approach, I've added a bunch of new tests that cover things that our imported WPTs weren't checking. With the fix for serializing connection requests, we can now fully download the assets for the emscripten-compiled asm.js games in the Humble Mozilla Bundle, particularly FTL: Faster Than Light. There were no regressions in our test suite. One web platform test, 'idbindex_reverse_cursor.any.html', has one newly-failing subtest, but the subtest was apparently only passing by chance due synchronous execution of requests. A few web platform tests that were added in a prior commit improved. The delete-request-queue.any.html test has stopped crashing, and the close-in-upgrade-needed.any.html test has stopped flaking, so they are both imported here as well. Incidentally fixes #7512, for which a crash test has been added.
5 lines
72 B
Plaintext
5 lines
72 B
Plaintext
put.success
|
|
second put threw: TransactionInactiveError
|
|
tx.complete
|
|
DONE
|