Skip to content
This repository was archived by the owner on Jan 28, 2026. It is now read-only.

[spec] Support transactional batchUpdate()#231

Merged
xyaoinum merged 2 commits intomainfrom
yao-spec-transactional-batch-update
Mar 21, 2025
Merged

[spec] Support transactional batchUpdate()#231
xyaoinum merged 2 commits intomainfrom
yao-spec-transactional-batch-update

Conversation

@xyaoinum
Copy link
Collaborator

@xyaoinum xyaoinum commented Mar 20, 2025

The spec changes for #228

Specifically:

  • Add a "batch update entries in the database" algorithm that provides transactional support. Switch to call this algorithm for batchUpdate().
  • batchUpdate() now explicitly throws an exception when any inner method specifies the withLock option, preventing unintended behavior.
  • For headers, if with_lock is specified for any inner method, the whole batch will be ignored as well. This integrates seamlessly with the existing "handle a Shared-Storage-Write response" algorithm, which invokes batchUpdate() in the end and will trigger the failure as intended.

Preview | Diff

The spec changes for #228

Specifically:
- Add a "batch update entries in the database" algorithm that provides transactional support. Switch to call this algorithm for batchUpdate().
- `batchUpdate()` now explicitly throws an exception when any inner method specifies the `withLock` option, preventing unintended behavior.
- For headers, if `with_lock` is specified for any inner method, the whole batch will be ignored as well. This integrates seamlessly with the existing "handle a Shared-Storage-Write response" algorithm, which invokes `batchUpdate()` in the end and will trigger the failure as intended.
@xyaoinum
Copy link
Collaborator Author

@pythagoraskitty PTAL. Thanks!

Copy link
Collaborator

@pythagoraskitty pythagoraskitty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM % typo

@xyaoinum xyaoinum merged commit b8a37bd into main Mar 21, 2025
2 checks passed
github-actions bot added a commit that referenced this pull request Mar 21, 2025
SHA: b8a37bd
Reason: push, by xyaoinum

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 31, 2025
…hod locks

As part of the transactional batchUpdate() proposal (spec PR:[1]),
inner method locks are no longer permitted. This CL implements
validation in both the caller code and mojom traits.

Note that while unrecognized IDL dictionary fields are generally
allowed, strict validation is enforced for this deprecated
'withLock' field to prevent potential misuse.

[1] WICG/shared-storage#231

Bug: 404568020
Change-Id: I9dbc395445342a34a68f12b31fdc285a7576787f
aarongable pushed a commit to chromium/chromium that referenced this pull request Mar 31, 2025
…hod locks

As part of the transactional batchUpdate() proposal (spec PR:[1]),
inner method locks are no longer permitted. This CL implements
validation in both the caller code and mojom traits.

Note that while unrecognized IDL dictionary fields are generally
allowed, strict validation is enforced for this deprecated
'withLock' field to prevent potential misuse.

[1] WICG/shared-storage#231

Bug: 404568020
Change-Id: I9dbc395445342a34a68f12b31fdc285a7576787f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6393777
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Dominic Farolino <dom@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1440291}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 31, 2025
…hod locks

As part of the transactional batchUpdate() proposal (spec PR:[1]),
inner method locks are no longer permitted. This CL implements
validation in both the caller code and mojom traits.

Note that while unrecognized IDL dictionary fields are generally
allowed, strict validation is enforced for this deprecated
'withLock' field to prevent potential misuse.

[1] WICG/shared-storage#231

Bug: 404568020
Change-Id: I9dbc395445342a34a68f12b31fdc285a7576787f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6393777
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Dominic Farolino <dom@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1440291}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 31, 2025
…hod locks

As part of the transactional batchUpdate() proposal (spec PR:[1]),
inner method locks are no longer permitted. This CL implements
validation in both the caller code and mojom traits.

Note that while unrecognized IDL dictionary fields are generally
allowed, strict validation is enforced for this deprecated
'withLock' field to prevent potential misuse.

[1] WICG/shared-storage#231

Bug: 404568020
Change-Id: I9dbc395445342a34a68f12b31fdc285a7576787f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6393777
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Dominic Farolino <dom@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1440291}
@xyaoinum xyaoinum deleted the yao-spec-transactional-batch-update branch April 3, 2025 18:25
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Apr 4, 2025
…te() cannot contain inner method locks, a=testonly

Automatic update from web-platform-tests
[shared storage] Validate that batchUpdate() cannot contain inner method locks

As part of the transactional batchUpdate() proposal (spec PR:[1]),
inner method locks are no longer permitted. This CL implements
validation in both the caller code and mojom traits.

Note that while unrecognized IDL dictionary fields are generally
allowed, strict validation is enforced for this deprecated
'withLock' field to prevent potential misuse.

[1] WICG/shared-storage#231

Bug: 404568020
Change-Id: I9dbc395445342a34a68f12b31fdc285a7576787f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6393777
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Dominic Farolino <dom@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1440291}

--

wpt-commits: 86858ee83ee8acec885b42923b656a61fde7f257
wpt-pr: 51720
aosmond pushed a commit to aosmond/gecko that referenced this pull request Apr 4, 2025
…te() cannot contain inner method locks, a=testonly

Automatic update from web-platform-tests
[shared storage] Validate that batchUpdate() cannot contain inner method locks

As part of the transactional batchUpdate() proposal (spec PR:[1]),
inner method locks are no longer permitted. This CL implements
validation in both the caller code and mojom traits.

Note that while unrecognized IDL dictionary fields are generally
allowed, strict validation is enforced for this deprecated
'withLock' field to prevent potential misuse.

[1] WICG/shared-storage#231

Bug: 404568020
Change-Id: I9dbc395445342a34a68f12b31fdc285a7576787f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6393777
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Dominic Farolino <dom@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1440291}

--

wpt-commits: 86858ee83ee8acec885b42923b656a61fde7f257
wpt-pr: 51720
globau pushed a commit to globau/firefox-test that referenced this pull request Apr 8, 2025
…te() cannot contain inner method locks, a=testonly

Automatic update from web-platform-tests
[shared storage] Validate that batchUpdate() cannot contain inner method locks

As part of the transactional batchUpdate() proposal (spec PR:[1]),
inner method locks are no longer permitted. This CL implements
validation in both the caller code and mojom traits.

Note that while unrecognized IDL dictionary fields are generally
allowed, strict validation is enforced for this deprecated
'withLock' field to prevent potential misuse.

[1] WICG/shared-storage#231

Bug: 404568020
Change-Id: I9dbc395445342a34a68f12b31fdc285a7576787f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6393777
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Dominic Farolino <dom@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1440291}

--

wpt-commits: 86858ee83ee8acec885b42923b656a61fde7f257
wpt-pr: 51720
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants