Skip to content

Commit fe4a092

Browse files
Address transaction state edge cases (#447)
* Clarify that only inactive transactions should auto-commit. * Fix upgrade steps to correctly handle aborted transactions. Resolves #436
1 parent ee73e87 commit fe4a092

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

index.bs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ spec: ecma-262; urlPrefix: https://tc39.github.io/ecma262/
4343
spec: storage; urlPrefix: https://storage.spec.whatwg.org/
4444
type: dfn
4545
text: storage bucket; url: storage-bucket
46-
text: storage key; url: storage-key
4746
</pre>
4847

4948
<style>
@@ -1054,7 +1053,7 @@ The <dfn>lifetime</dfn> of a
10541053
stores=] and [=/indexes=].
10551054

10561055
1. The implementation must attempt to <dfn lt="commit|committed">commit</dfn>
1057-
a transaction when all [=/requests=] placed against the
1056+
an [=transaction/inactive=] transaction when all [=/requests=] placed against the
10581057
transaction have completed and their returned results handled, no
10591058
new requests have been placed against the transaction, and the
10601059
transaction has not been [=transaction/aborted=]
@@ -5290,9 +5289,10 @@ To <dfn>upgrade a database</dfn> with |connection| (a [=/connection=]), a new |v
52905289
[=firing a version change event=] named
52915290
{{IDBOpenDBRequest/upgradeneeded!!event}} at |request| with |old
52925291
version| and |version|.
5293-
1. Set |transaction|'s [=transaction/state=] to [=transaction/inactive=].
5294-
1. If |didThrow| is true, run [=abort a transaction=] with |transaction| and a newly
5295-
[=exception/created=] "{{AbortError}}" {{DOMException}}.
5292+
1. If |transaction|'s [=transaction/state=] is [=transaction/active=], then:
5293+
1. Set |transaction|'s [=transaction/state=] to [=transaction/inactive=].
5294+
1. If |didThrow| is true, run [=abort a transaction=] with |transaction| and a newly
5295+
[=exception/created=] "{{AbortError}}" {{DOMException}}.
52965296

52975297
1. Wait for |transaction| to [=transaction/finish=].
52985298

@@ -6362,7 +6362,7 @@ steps may throw an exception.
63626362
<!-- Binary -->
63636363
: If |input| is a [=buffer source type=]
63646364
::
6365-
1. If |input| is [[=BufferSource/detached=]] then return invalid.
6365+
1. If |input| is [=BufferSource/detached=] then return invalid.
63666366

63676367
1. Let |bytes| be the result of
63686368
[=/get a copy of the buffer source|getting a copy of the bytes held by the buffer source=]
@@ -6718,6 +6718,8 @@ For the revision history of the second edition, see [that document's Revision Hi
67186718
* Updated [=convert a value to a key=] to return invalid for detached array buffers. (<#417>)
67196719
* Updated {{IDBFactory/open()}} to set its request's [=request/processed flag=] to true.
67206720
* Don't include databases that aren't done being created in {{IDBFactory/databases()}}. (<#442>)
6721+
* Clarify that only [=transaction/inactive=] [=/transactions=] should attempt to auto-commit. (<#436>)
6722+
* Correct [=/upgrade a database=] steps to handle aborted transactions. (<#436>)
67216723

67226724
<!-- ============================================================ -->
67236725
# Acknowledgements # {#acknowledgements}

0 commit comments

Comments
 (0)