-
Notifications
You must be signed in to change notification settings - Fork 97
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
Make maxTabs configurable based on available storage quota, instead of using an hardcoded limit. #479
Conversation
Thank you for this! How does Tab Wrangler recover or prevent going over the storage quota? It would be great to use as much of the storage space as possible, but I want to avoid users ending up with a dead Tab Wrangler because their average I intentionally capped max tabs at something much smaller than the max storage space because according to the |
Good question, I haven't tried to check tabwrangler behaviour after exceeding the quota (I just aimed to stay just below the quota)
This makes me think that upon this condition, Tabwrangler would still be able to persist the list of saved tabs after trimming, and so a simple end-user fix would be to lower the amount of saved tabs (thus triggering a trim). But of course, this relies on the storage error being bubbled up to the UI (I'll try to verify this assumption, but cannot guarantee when I'll be able to do this) |
Ok so, I confirmed that this is actually how it works. I modified tabwrangler to not enforce the limit (which on my system is estimated to be about 17000 tabs). I generated an export/import file with a list of saved tabs close to the limit, and then I opened a bunch of 30/50 groups of bookmarks, to let tabwrangler wrangle them. I checked that the storage used increased gradually, with After that, the used bytes was still barely below the quota limit (becaused it failed to write). This of course means that the wrangled tabs would be lost, but IMO that's ok, because:
I also reproduced it while I didn't have the Tabwranglers options page open, and I've still been able to observe the I then decreased the limit to 16001 (not 16000 unlike my comment in the console) and confirmed that, upon the next wrangle attempt, it trimmed away all the extra 2000 tabs, and the newly wrangled tabs are successfully saved. |
@berdario Thank you for the investigation. I will review again and get this merged. |
Thanks again for all this work. The code is straightforward, you added the test, and the comments are useful. Merging! |
I recently started to use Tabwrangler, but I soon realised that I exceeded 2700 tabs wrangled... I wanted to check/review old tabs that got wrangled, but I unfortunately realised that they got trimmed away, because of the 1000 tabs limit.
I then tried to increase this limit, but disappointingly realised that the default is also the maximum value accepted by Tabwrangler 😞
I'm using tabwrangler to avoid having to remember about tidying up old tabs before the systems starts to become unresponsive, and avoid worrying about losing old context/state by just getting rid of all old tabs (evicting the oldest ones first makes a lot of sense). Knowing that I wouldn't be able to go back and inspect what has been added to the corral brought the worry back (which is why I kept Tabwrangler paused for the last couple of months).
1000 tabs seems a relatively low amount in 2024, so I decided to look into how much each tab weighs (in my experience, little more than 500 bytes each on average), how much storage quota the browser can make available to us and make the maxTabs setting configurable based on that.
While I was at it, I also added a logging statement for when Tabwrangler is finally forced to trim its corral (so at least this operation is not completely silent, and people might open the console to check what has been lost).