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

Many data loss and IndexedDB problems may by due to how firefox frees space, and could be fixed by adding the "unlimitedStorage" permission #860

Closed
gantheaume opened this issue Sep 1, 2021 · 1 comment

Comments

@gantheaume
Copy link

gantheaume commented Sep 1, 2021

Over the years, I hit several of the issues one can find here: saves disappearing, sessions not saving, backup restoration randomly restoring some sessions and not others.
Then, they all solved themselves once I upgraded to a bigger SSD.

I did a bit of research, and said simply I found out that firefox has a policy of clearing its storage such that it never takes more than 50% of the available capacity of the partition it's running from:
https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Browser_storage_limits_and_eviction_criteria#storage_limits

So the reason for all my problems with TSM was that I was working from a disk in tight free space. I never had any other problems after it stopped being the case. This seems stupidly simple said like this, but when one has several hundreds of saved sessions, and still several gigabytes of free space, the connection isn't always obvious. TSM would suddenly start to refuse to save sessions. And I'd realise days after, once I needed them. And then TSM would have less and less sessions listed over time (as my partition would fill itself a bit more). Then the backups I tried restoring would work, but then a good fraction of the sessions would disappear again..

Anyway, it seems there is a simple fix: to request the unlimitedStorage permission:
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions#unlimited_storage
For example, multi-account containers just dit it:
mozilla/multi-account-containers#2079
I found there a link to a more detailed explanation:
https://bugzilla.mozilla.org/show_bug.cgi?id=1720487#c1
This could as well fix other IndexedDB problems I suppose? As one would stop having some stored elements randomly deleted (right?).

I searched through the bugs a bit, and here are some that may be related to this issue:
#358
#398
#508
#550
#629
#637
#670
#677
...
But I could be wrong here

Hope this is enough; should I detail more some point or another?

And thanks for developing this extention @sienori, I don't know what I would have done without it.
Keep the good work going :)

@gantheaume gantheaume changed the title Many data loss and IndexedDB problems may by due to how firefox frees space, and could be fixed by adding the "unlimitedstorage" permission Many data loss and IndexedDB problems may by due to how firefox frees space, and could be fixed by adding the "unlimitedStorage" permission Sep 1, 2021
@sienori
Copy link
Owner

sienori commented Sep 8, 2021

Thanks for the detailed report! It was very helpful.
I added the code to persist the IndexedDB. 630a835
This is expected to solve the problem of lost sessions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants