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

Bookmarks data too large for localStorage #20

Closed
joeytwiddle opened this issue May 16, 2018 · 4 comments
Closed

Bookmarks data too large for localStorage #20

joeytwiddle opened this issue May 16, 2018 · 4 comments
Assignees
Labels

Comments

@joeytwiddle
Copy link

joeytwiddle commented May 16, 2018

Apologies, this is three different bugreports in three days!

Running the store extension on my Mac, I don't have any problem with corrupt bookmarks. But I do exceed storage capacity!

xBrowserSync.App.Background:syncBookmarks, WARNING: Error syncing bookmarks; {"stack": "...

Error: Failed to execute 'setItem' on 'Storage': Setting the value of 'xBrowserSync-cachedBookmarks' exceeded the quota.
    at Object.setInLocalStorage [as Set] (chrome-extension://lcbjdhceifofjlpecfpeimnnphbcjgnc/js/background.min.js:2732:22)
    at Object.Set (chrome-extension://lcbjdhceifofjlpecfpeimnnphbcjgnc/js/background.min.js:389:43)
    at getCachedBookmarks (chrome-extension://lcbjdhceifofjlpecfpeimnnphbcjgnc/js/background.min.js:1613:37)
    at refreshCachedBookmarks (chrome-extension://lcbjdhceifofjlpecfpeimnnphbcjgnc/js/background.min.js:1537:16)
    at chrome-extension://lcbjdhceifofjlpecfpeimnnphbcjgnc/js/background.min.js:2068:13
    at ...

..."}

(I have around 14,900 bookmarks, 6MB when exported as HTML, and my own API server with the limit set to 100MB for testing!)

I have heard people recommending to avoid localStorage when possible, because it is synchronous and is has limits (around 2MB?) in some browsers.

People recommend using something like IndexedDB instead (or ServiceWorkers Cache API). Although that's for front-end code, I'm not so sure about extensions.

@nero120
Copy link
Member

nero120 commented May 16, 2018

Don't be sorry @joeytwiddle, your efforts are definitely appreciated! Yes this is definitely a limitation that needs to be addressed, indexedDB seems to make the most sense as a replacement cache store but I'll need to consider how that will affect the mobile apps as it's unified code.

@nero120 nero120 self-assigned this May 16, 2018
@nero120 nero120 added the bug label May 16, 2018
@nero120 nero120 removed their assignment Jun 11, 2018
@nero120
Copy link
Member

nero120 commented Jul 3, 2018

Just a heads up, this should be slightly mitigated in v1.4.0 which now compresses the data before it is encrypted, typically reducing the size of the encrypted data by around 40-60%. As the bookmarks data is cached in local storage in encrypted form, you should be able to store far more bookmarks before hitting the local storage quota. 😄

@nero120
Copy link
Member

nero120 commented Oct 31, 2018

This will be resolved by adding the unlimitedStorage manifest permission once storage.local API has been implemented (see #38).

@nero120 nero120 self-assigned this Oct 31, 2018
@nero120 nero120 added this to the v1.4.1 milestone Oct 31, 2018
@nero120
Copy link
Member

nero120 commented Feb 4, 2019

This is resolved by d28125b and 7147c02 adding the unlimitedStorage manifest permission.

@nero120 nero120 closed this as completed Feb 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants