Skip to content

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

@rlloyd2001

Description

@rlloyd2001

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions