[Webkit-unassigned] [Bug 226814] New: localStorage "locks" items when they're updated too frequently

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 9 06:37:16 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=226814

            Bug ID: 226814
           Summary: localStorage "locks" items when they're updated too
                    frequently
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: Mac (Apple Silicon)
                OS: macOS 11
            Status: NEW
          Severity: Major
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: pascal at ambitone.io

Created attachment 430961

  --> https://bugs.webkit.org/attachment.cgi?id=430961&action=review

Demo

Hi everyone,

I've originally come across this issue when checking my apps in iOS 15b1, but I could replicate it in the latest Safari Technology Preview (125) for macOS 11 as well.

It seems like items in the Local Storage are "locked", when they're updated too frequently (i.e. when calling `window.localStorage.setItem()`). What happens is that, at some point, `window.localStorage.setItem()` just stops working without any errors. Here's the test script I've used to replicate the issue from the Web Inspector:

```
const setItemMulti = (times, delay) => {
    if (times == 0) {
        return;
    }

    window.localStorage.setItem('foo', times);
    setTimeout(() => setItemMulti(times-1, delay), delay);
}

setItemMulti(10, 50)
```

It works for `delay` >= 100ms, but breaks for values below, such as 50ms. After running the script, calling `window.localStorage.setItem('foo', 123)` (or similar) won't change the value of `foo` any longer. Please see the attached GIF for a demo. I can also confirm that the same script behaves as expected in Safari 14.1 (16611.1.21.161.6) on macOS 11.

This issue currently breaks one app I'm maintaining, where we use the localStorage to store JWT tokens and other user information.

Any help or feedback is much appreciated.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210609/0f86d64d/attachment-0001.htm>


More information about the webkit-unassigned mailing list