[w3c/IndexedDB] Can a "committing" transaction be aborted? (Issue #437)

The spec says:

> The abort() method steps are:
> 
> If [this](https://webidl.spec.whatwg.org/#this)'s [state](https://w3c.github.io/IndexedDB/#transaction-state) is [committing](https://w3c.github.io/IndexedDB/#transaction-committing) or [finished](https://w3c.github.io/IndexedDB/#transaction-finished), then [throw](https://webidl.spec.whatwg.org/#dfn-throw) an "[InvalidStateError](https://webidl.spec.whatwg.org/#invalidstateerror)" [DOMException](https://webidl.spec.whatwg.org/#idl-DOMException).

However, the spec also says

> A transaction can be aborted at any time before it is [finished](https://w3c.github.io/IndexedDB/#transaction-finished), even if the transaction isn’t currently [active](https://w3c.github.io/IndexedDB/#transaction-active) or hasn’t yet [started](https://w3c.github.io/IndexedDB/#transaction-start).

Both of these texts were added at the same time, [here](https://github.com/w3c/IndexedDB/commit/671f315528f210e4c9ccd62e6420c502dad0693c).

FWIW it appears that Chromium still allows a `committing` (but not `finished`) transaction to be aborted via `abort()`.


==========

tangentially, regarding spec language, sometimes I see wording like

> If [this](https://webidl.spec.whatwg.org/#this)'s [done flag](https://w3c.github.io/IndexedDB/#request-done-flag) is false, then [throw](https://webidl.spec.whatwg.org/#dfn-throw) an "[InvalidStateError](https://webidl.spec.whatwg.org/#invalidstateerror)" [DOMException](https://webidl.spec.whatwg.org/#idl-DOMException).
> 
> Otherwise, return [this](https://webidl.spec.whatwg.org/#this)'s [result](https://w3c.github.io/IndexedDB/#request-result), or undefined if the request resulted in an error.

And other times I see wording that omits the "otherwise". Is it correct to assume that "throw" implies that the next steps won't happen, and therefore the "otherwise" is unnecessary?

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

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

Received on Thursday, 9 January 2025 20:34:05 UTC