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

Uncaught (in promise) Error: QUOTA_BYTES_PER_ITEM quota exceeded #1

Open
josheverett opened this issue Apr 16, 2022 · 0 comments
Open

Comments

@josheverett
Copy link
Owner

Trying to import ~1000 movies quickly revealed an overlooked problem: chrome.storage.sync.QUOTA_BYTES_PER_ITEM is ~8kb.

Which means with the current implementation, you can store at most ~200 ratings before hitting this limit. Whoops.

There are strategies to seamlessly work around this, such as https://github.com/dtuit/chrome-storage-largeSync.

But I'd really like to avoid external dependencies.

One way to solve this is with a modified version of the proposed improved data compression format (as outlined in the relevant code comments). That proposal would still store all data under a single iseentit key, so would not avoid this bug. But if the top-level keys are years, then 200 movies per year could be stored, which is certainly sufficient unless you happen to be Richard Roeper.

The question to bikeshed over is the best way (primarily from a compression perspective) to disambiguate FILM and SERIES in the stored data. Storing this in the ratings records themselves would significantly reduce the theoretical ~2000 rating limit (imposed by chrome.storage.sync's global limit). Off the top of my head, the best solution I can think of is to have the too-level keys be something like FILM:2010. Little ugly but it gets the job done.

Try not to make this a breaking change if possible. When the extension boots up, the first thing it should do is detect the old data format. If found: translate to the new format, chrome.storage.sync.set() the data, then just window.location.reload(). It's a one-time thing whatever.

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

No branches or pull requests

1 participant