Closed Bug 1761960 Opened 2 years ago Closed 2 years ago

Error in migrate to LSNG in case storage value is empty string

Categories

(Core :: Storage: localStorage & sessionStorage, defect, P2)

Firefox 98
defect

Tracking

()

RESOLVED DUPLICATE of bug 1758416

People

(Reporter: gshadrin, Unassigned)

References

Details

Attachments

(1 file)

Steps to reproduce:

Case 1:

  1. Use firefox 91
  2. Write in localStorage entry with value is empty string (key can be any)
  3. Update firefox to 98.0.2

Case 2 (without update version):

  1. Use firefox 98.0.2
  2. Set dom.storage.next_gen = false in about:config
  3. Write in localStorage entry with value is empty string (key can be any)
  4. Set dom.storage.next_gen = true in about:config
    After setting dom.storage.next_gen you need restart the browser

Actual results:

Any access to storage will broke with error: NS_ERROR_STORAGE_CONSTRAINT

Expected results:

Access to storage will not broke with error: NS_ERROR_STORAGE_CONSTRAINT

Our site have entry with empty value and this entry have stored in browsers of our users.
Because of this bug our users can't be used our site. Because local storage corrupted.

We haven't workaround of this problem.
I try call method clear of localStorage, but with method fall with NS_ERROR_STORAGE_CONSTRAINT too.

The only solution to the problem: recreate user profile in firefox settings. But we can't recommend this solution for our users because it will destroy all user data in the browser.

I'd be very grateful, if you give me advice about workaround inside our site.

The Bugbug bot thinks this bug should belong to the 'Core::Storage: localStorage & sessionStorage' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Storage: localStorage & sessionStorage
Product: Firefox → Core
Flags: needinfo?(jjalkanen)

Thanks for the STR! Would it be possible to get some log when the first case happens? If you do not want to share it publicly, you can send me an email. Thanks!

Severity: -- → S2
Priority: -- → P2
See Also: → 1758416
Flags: needinfo?(gshadrin)

I can share log from synthetic reproduction the bug. It full emulate scenario of ours application.

  1. I ran clear tomcat web server.

  2. I went to http://localhost:8080/ in Firefox v.91

  3. In the browser console executed script: localStorage.setItem("test", "test")

  4. Updated Firefox to v. 98.0.2

  5. In the browser console executed script: localStorage.getItem("test")
    Error:
    Exception { name: "NS_ERROR_STORAGE_CONSTRAINT", message: "", result: 2153971715, filename: "debugger eval code", lineNumber: 1, columnNumber: 0, data: null, stack: "@debugger eval code:1:14\n" }
    columnNumber: 0
    ​data: null
    ​filename: "debugger eval code"
    ​lineNumber: 1
    ​message: ""
    ​name: "NS_ERROR_STORAGE_CONSTRAINT"
    ​result: 2153971715
    stack: "@debugger eval code:1:14\n"
    ​<prototype>: ExceptionPrototype { toString: toString(), name: Getter, message: Getter, … }

  6. Same error in case execute localStorage.length

A attached the image.

Flags: needinfo?(gshadrin)
Attached image Error
Attachment #9269865 - Attachment description: Снимок экрана 2022-03-29 в 19.30.55.png → Error
Attachment #9269865 - Attachment filename: Снимок-экрана-2022-03-29-в-19.30.55.png → Error

I made a mistake in description the 3 step: In the browser console executed script: localStorage.setItem("test", "test")
value need be empty string:
In the browser console executed script: localStorage.setItem("test", "")

Thanks for the steps! Let's see if we can reproduce it too.

This was fixed in bug 1758416. Thanks a lot for exact steps to reproduce the bug.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Flags: needinfo?(jjalkanen)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: