Cimbali / CleanLinks

Converts obfuscated/nested links to genuine clean links.
https://addons.mozilla.org/en-GB/firefox/addon/clean-links-webext/
Mozilla Public License 2.0
76 stars 2 forks source link

Unable to create new rules - QuotaExceededError #116

Closed hackel closed 4 years ago

hackel commented 4 years ago

I am unable to create new CleanLinks rules (Firefox 79). The browser log shows a QuotaExceededError. I checked about:sync and discovered that CleanLinks is only using 10352 bytes. I wasn't able to discover much current information about what the limits are, but I remember uBlock Origin citing this as a reason it only implements manual syncing.

In any case, it would be better if the extension still allowed exceptions to be added locally and warned the user that syncing would no longer succeed. Currently I have no choice but to disable it entirely.

This is what I see whenever I click on the add to whitelist button:

16:11:15.688 [ClearURLs]: Save on disk. storage.js:77:13
16:11:17.495 received message 
Object { action: "check tab enabled", tab_id: 527 }
common.js:45:59
16:11:17.507 received message 
Object { action: "cleaned list", tab_id: 527 }
common.js:45:59
16:11:17.587 SyntaxError: Element.closest: '#3c3c58b1-7398-4256-9c0d-e57322904c2a_jetpack-browser-action' is not a valid selector BrowserUsageTelemetry.jsm:901
16:11:17.632 can't access property "addEventListener", target is null MessageManagerProxy.jsm:171
16:11:17.637 WebExtension context not found! ExtensionParent.jsm:1047
16:11:17.637 WebExtension context not found! ExtensionParent.jsm:1047
16:11:17.648 can't access property "addEventListener", target is null MessageManagerProxy.jsm:171
16:11:17.648 WebExtension context not found! ExtensionParent.jsm:1047
16:11:17.666 TypeError: can't access property "getActor", wgc is null ExtensionCommon.jsm:501:19
16:11:17.667 can't access property "id", sender.tab is undefined main.js:672
16:11:17.667 sendRemoveListener on closed conduit {7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}.274878069529 ConduitsChild.jsm:108
16:11:17.667 Promise resolved after context unloaded
promisify.js:12
16:11:17.668 Promise resolved after context unloaded
2 utils.js:291
16:11:17.668 uncaught exception: Object
16:11:20.207 Quota exceeded: ItemBytes ExtensionStorageSync.jsm:69
16:11:20.209 Error: QuotaExceededError: storage.sync API call exceeded its quota limitations. undefined
Cimbali commented 4 years ago

Ah tanks for reporting. That’s a bad one, I’ll try to get back to it rapidly.

Cimbali commented 4 years ago

~100KB seems to be the upper bound indeed. For reference it is explained here:

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/sync

The easiest way is to handle this issue is to fall back to local storage whenever this happens. Other approaches (that could also be complements to this approach):

Cimbali commented 4 years ago

How do you see the size of the add-on in about:sync ? I can’t seem to find it. 100KB seems very high anyway, as we only store 3 keys (configuration, rules, default_rules) and key-value pairs each have a maximal size of 8KB. As default rules are around 3KB right now, it is much more likely that we are running into the single-key 8KB limit.

While that makes things a little easier to manage (we don’t need to reserve change in the sync storage for potential configuration changes for example), it also makes compressing a less likely option.

nattofriends commented 2 years ago

Apologies for bringing up this old issue, but this is happening when I try to use CleanLinks in Firefox.

Cimbali commented 2 years ago

Thanks for reporting @nattofriends. We’re using local storage now, at least as backup, so it shouldn’t be the exact same issue. Can you open a new one with:

nattofriends commented 2 years ago

Sorry, I can create rules fine, but I can't sync them.

Cimbali commented 2 years ago

Yes so that would mean you probably hit one of the size limits, not sure which though. The requested info above would be useful to figure that out.