You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To avoid side effects from getters during cloning operations (part of put/add/update calls), make transactions temporarily inactive.
Implemented in Blink, pending implementation in Gecko.
Copy file name to clipboardExpand all lines: index.bs
+17-8Lines changed: 17 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -2983,7 +2983,7 @@ To <dfn>add or put</dfn> with |handle|, |value|, |key|, and |no-overwrite flag|,
2983
2983
2984
2984
1. Let |targetRealm| be a user-agent defined [=Realm=].
2985
2985
2986
-
1. Let |clone| be a [=clone=] of |value| in |targetRealm|.
2986
+
1. Let |clone| be a [=clone=] of |value| in |targetRealm| during |transaction|.
2987
2987
Rethrow any exceptions.
2988
2988
2989
2989
<details class=note>
@@ -4680,7 +4680,7 @@ invoked, must run these steps:
4680
4680
4681
4681
1. Let |targetRealm| be a user-agent defined [=Realm=].
4682
4682
4683
-
1. Let |clone| be a [=clone=] of |value| in |targetRealm|.
4683
+
1. Let |clone| be a [=clone=] of |value| in |targetRealm| during |transaction|.
4684
4684
Rethrow any exceptions.
4685
4685
4686
4686
<details class=note>
@@ -5528,8 +5528,7 @@ To <dfn>abort an upgrade transaction</dfn> with |transaction|, run these steps:
5528
5528
5529
5529
<div class=algorithm>
5530
5530
5531
-
To <dfn>fire a success event</dfn> at a |request|,
5532
-
the implementation must run these steps:
5531
+
To <dfn>fire a success event</dfn> at a |request|, run these steps:
5533
5532
5534
5533
1. Let |event| be the result of [=creating an event=] using {{Event}}.
5535
5534
@@ -5568,8 +5567,7 @@ the implementation must run these steps:
5568
5567
5569
5568
<div class=algorithm>
5570
5569
5571
-
To <dfn>fire an error event</dfn> at a |request|,
5572
-
the implementation must run these steps:
5570
+
To <dfn>fire an error event</dfn> at a |request|, run these steps:
5573
5571
5574
5572
1. Let |event| be the result of [=creating an event=] using {{Event}}.
5575
5573
@@ -5621,13 +5619,23 @@ the implementation must run these steps:
5621
5619
5622
5620
<div class=algorithm>
5623
5621
5624
-
To make a <dfn>clone</dfn> of |value| in |targetRealm|,
5625
-
the implementation must run these steps:
5622
+
To make a <dfn>clone</dfn> of |value| in |targetRealm| during |transaction|,
5623
+
run these steps:
5624
+
5625
+
1. [=/Assert=]: |transaction|'s [=transaction/state=] is [=transaction/active=].
5626
+
5627
+
1. Set |transaction|'s [=transaction/state=] to [=transaction/inactive=].
5628
+
5629
+
<aside class=note>
5630
+
The [=/transaction=] is made [=transaction/inactive=] so that getters or other side effects triggered by the cloning operation are unable to make additional requests against the transaction.
5631
+
</aside>
5626
5632
5627
5633
1. Let |serialized| be [=?=]<a abstract-op>StructuredSerializeForStorage</a>(|value|).
5628
5634
5629
5635
1. Let |clone| be [=?=]<a abstract-op>StructuredDeserialize</a>(|serialized|, |targetRealm|).
5630
5636
5637
+
1. Set |transaction|'s [=transaction/state=] to [=transaction/active=].
5638
+
5631
5639
1. Return |clone|.
5632
5640
5633
5641
</div>
@@ -6815,6 +6823,7 @@ For the revision history of the second edition, see [that document's Revision Hi
6815
6823
* Removed handling for nonstandard `lastModifiedDate` property of {{File}} objects. ([Issue #215](https://github.com/w3c/IndexedDB/issues/215))
0 commit comments