Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full localStorage broke my element-web on Firefox #18258

Closed
Yoric opened this issue Jul 27, 2021 · 7 comments
Closed

Full localStorage broke my element-web on Firefox #18258

Yoric opened this issue Jul 27, 2021 · 7 comments
Labels
A-Storage Storage layer of the app, including IndexedDB, local storage, etc. O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Critical Prevents work, causes data loss and/or has no workaround T-Defect

Comments

@Yoric
Copy link
Contributor

Yoric commented Jul 27, 2021

Currently running develop.element.io on Firefox.

  1. A few days ago, I suddenly became unable to send messages - pressing "return" would do nothing.
  2. After this, attempting to log using develop.element.io informed me that I was using an incompatible browser.
  3. I just attempted to log into develop.element.io. One of my rooms was full of "This message is corrupted".
  4. Attempting again to log into develop.element.io informed me that I couldn't log (apologies, I didn't write down the error message).
  5. Using app.element.io, everything works.

Looking at the console, I find out that my localStorage is full. This is most likely the cause of all these issues (including the "incompatible browser": if modernizer cannot write anything to localStorage, it decides that the browser doesn't have localStorage, even if it's because localStorage is full).

@jryans
Copy link
Collaborator

jryans commented Jul 27, 2021

Is there a clear way to distinguish "full" from "broken"...? E.g. does something like await navigator.storage.estimate() say anything that might be usable as an indicator of full?

@Palid
Copy link
Contributor

Palid commented Aug 7, 2021

https://arty.name/localstorage.html The limit is around 5MB, but await navigator.storage.estimate() doesn't give any details about that, though we could use new Blob(Object.values(localStorage)) instead to verify that.
The problem is that it takes around 20ms on my machine to verify. I think the best and easiest solution for that would be to create our own abstraction over localStorage that does the new Blob stuff for all incoming data, so that we can calculate the estimated size of incoming things. Full == broken in terms of localStorage, unfortunately.

@Palid Palid added O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect A-Storage Storage layer of the app, including IndexedDB, local storage, etc. labels Aug 7, 2021
@Palid Palid added S-Critical Prevents work, causes data loss and/or has no workaround and removed S-Major Severely degrades major functionality or product features, with no satisfactory workaround labels Aug 13, 2021
@Yoric
Copy link
Contributor Author

Yoric commented Aug 16, 2021

Note that my Element is and remains broken. It would also be useful to have a way to unbreak it (a button such as "clear history").

@jryans
Copy link
Collaborator

jryans commented Aug 25, 2021

Note that my Element is and remains broken. It would also be useful to have a way to unbreak it (a button such as "clear history").

Are you able to access the Sessions view for the bad session? You could use the "Clear Cache" button in Settings -> Help -> Clear cache. This removed IndexedDB cached content for the session, but perhaps it's enough by removing storage for that domain.

@novocaine
Copy link
Contributor

novocaine commented Aug 25, 2021

Instance of #18423

@Palid
Copy link
Contributor

Palid commented Sep 2, 2021

Partial fix here: matrix-org/matrix-js-sdk#1880

@novocaine
Copy link
Contributor

I'm collecting localStorage related failures into one issue - #18423

Closing this as a duplicate - the details of this issue will be linked to it, and not lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Storage Storage layer of the app, including IndexedDB, local storage, etc. O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Critical Prevents work, causes data loss and/or has no workaround T-Defect
Projects
None yet
Development

No branches or pull requests

4 participants