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

JStorage does not give an indication it has run out of storage. #91

Open
rlloyd2001 opened this issue Mar 9, 2015 · 0 comments
Open

Comments

@rlloyd2001
Copy link

jStorage/jstorage.js

Lines 459 to 470 in 5f4075a

function _save() {
_dropOldEvents(); // remove expired events
try {
_storage_service.jStorage = JSON.stringify(_storage);
// If userData is used as the storage engine, additional
if (_storage_elm) {
_storage_elm.setAttribute('jStorage', _storage_service.jStorage);
_storage_elm.save('jStorage');
}
_storage_size = _storage_service.jStorage ? String(_storage_service.jStorage).length : 0;
} catch (E7) { /* probably cache is full, nothing is saved this way*/ }
}

Looking at this code, if JStorage runs out of room, it will assume IE7 and kill the exception. This should be changed to at least display a warning in the console that JStorage was unable to save because local storage is full. This would save a lot of time.

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