Re: [w3c/IndexedDB] Wait loop questions (Issue #436)

During the firing the version change event (10.5), script may make additional requests. These would keep the transaction alive, so going inactive at 10.6 would not cause the transaction to auto-commit. So waiting for the transaction to finish in step 11 is intentional.

In the case where no requests are made (e.g. your code example), the relevant prose is in the [transaction lifetime](https://w3c.github.io/IndexedDB/#transaction-lifetime) definition: _"The implementation must attempt to commit a transaction when all requests placed against the transaction have completed and their returned results handled, no new requests have been placed against the transaction, and the transaction has not been aborted"_ The intention is that once we reach a state where all existing requests are completed and new requests can be made, the transaction should attempt to commit.

The statement could be made more explicit e.g. by stating "The implementation must attempt to commit a transaction when **it is inactive**, all requests..."

Making the whole transaction lifecycle more algorithmic would also be nice. :)








-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/IndexedDB/issues/436#issuecomment-2573630815
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/IndexedDB/issues/436/2573630815@github.com>

Received on Monday, 6 January 2025 18:01:48 UTC