Update for Shared Storage feature in M138: sharedStorage.batchUpdate()

41 views
Skip to first unread message

Kasper Kulikowski

unread,
May 14, 2025, 5:31:23 PMMay 14
to Shared Storage API announcements

Hey all,


We're introducing a change to the Shared Storage API in M138:  sharedStorage.batchUpdate().


Batch update

Starting from M138 all updates within a batchUpdate() call will be executed as a single unit of work. If any method fails, none of them will be committed.

You can only apply the withLock option for batchUpdate() to the entire batch. Applying withLock to any individual method object within the batch throws an exception.



sharedStorage.batchUpdate([

    new SharedStorageSetMethod('key1', 'value1', {withLock:'lock'}), //throws exception

    new SharedStorageSetMethod('key2', 'value2')

], { withLock: 'modify-lock' });



We’ve updated the Shared Storage Implementation documentation to reflect these changes and provide additional details on using batchUpdate() and the Web Locks API.


If you have any questions or comments, reply to this post or open an issue in the Privacy Sandbox Dev Support repository on GitHub.
Reply all
Reply to author
Forward
0 new messages