Skip to content

Conversation

@nolanlawson
Copy link
Member

@nolanlawson nolanlawson commented Aug 8, 2025

As far as I can tell, this line about changing the transaction's state to inactive upon abort() is non-observable and superfluous. The reason it's superfluous is because it's immediately followed by the "abort a transaction" steps, which change the state to "finished" on step 3, and steps 1-2 do not contain user-observable hooks (e.g. errors, listeners, etc.):

To abort a transaction with the transaction to abort, and error, run these steps:

  1. All the changes made to the database by the transaction are reverted. For upgrade transactions this includes changes to the set of object stores and indexes, as well as the change to the version. Any object stores and indexes which were created during the transaction are now considered deleted for the purposes of other algorithms.

  2. If transaction is an upgrade transaction, run the steps to abort an upgrade transaction with transaction.

    NOTE: This reverts changes to all connection, object store handle, and index handle instances associated with transaction.

  3. Set transaction’s state to finished.

Looking at the various browser implementations, it seems that they already ignore this step in practice:

  1. Gecko does not set the state to inactive and directly calls AbortInternal which immediately sets mReadyState to "finished".
  2. WebKit does not set the state to inactive and directly calls abortInternal(). It doesn't seem to set the state to inactive during this process.
  3. Chromium also does not set the state to inactive and calls StartAborting which also doesn't seem to set the state to inactive.

The exception I can find is Ladybird, which does set the state to inactive, but then immediately sets the state to finished which seems to illustrate that the inactive step is unnecessary.

The following tasks have been completed:

  • Confirmed there are no ReSpec/BikeShed errors or warnings.
  • Modified Web platform tests (link to pull request) (N/A - not observable)

Implementation commitment:


Preview | Diff

@nolanlawson
Copy link
Member Author

Since I'm no longer an employee of a W3C member org, I am happy if someone else merges this one-line code change in their own PR. 🙂

@SteveBeckerMSFT
Copy link
Collaborator

Thanks for the change. I created a new PR for this:

#467

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants