lmaccherone/node-localstorage

Using a shared folder as localStorage location might throw QUOTA_EXCEEDED_ERR

pvrobays opened this issue · 3 comments

When using a shared folder as LocalStorage location path, the calculations of the _bytesInUse will also take into account the file size of files that are not part of the LocalStorage. Therefor this might throw a QUOTA_EXCEEDED_ERR error, while the LocalStorage used is not exceeding the quota.

Workaround: don't use a shared folder as the LocalStorage location path; or define a larger quota.

Thanks for the comment. Do you think simply adding the guidance in your workaround to the limitations section of the README.md would serve as adequately addressing this issue?

Hi @lmaccherone
That would definitely help an might avoid some people making the same mistake.

However if possible, I would look for a permanent fix? In my case this happened on a production application; with 200k downloads each week I can't imagine I'm the only one bumping into this issue. Some people will definitely overlook the guidance in the README.md.

I decided that I can't "fix" this because, in order for it to behave like a browser, the storage has to persist across runs. I understand that most folks use it as a client-side test runner for browser-targeted code, but some folks use it as a key-value store with a familiar API. So, I simply added a note about this issue in the Limitations section of the README.md.