diff --git a/docs/source/configuration.rst b/docs/source/configuration.rst index d6f19c25d5..40b0938cb3 100644 --- a/docs/source/configuration.rst +++ b/docs/source/configuration.rst @@ -1634,7 +1634,7 @@ persistent_store ---------------- * Default: ``localStorage`` -* Valid options: ``localStorage``, ``IndexedDB``, ``sessionStorage``, ``BrowserExtLocal``, ``BrowserExtSync`` +* Valid options: ``localStorage``, ``IndexedDB``, ``sessionStorage``, ``BrowserExtLocal``, ``BrowserExtSync``, ``none`` Determines which store is used for storing persistent data. @@ -1656,6 +1656,8 @@ Items in sync storage are synced by the browser and are available across all ins BrowserExtLocal represents the local storage area. Items in local storage are local to the machine the extension was installed on +When using ``persistent_store: 'none'`` Converse will store data in-memory thus clearing all data across page reloads. +It is useful if memory storage limitations are beinig reached and refetching data anew after a reload is acceptable. push_app_servers ---------------- diff --git a/src/headless/core.js b/src/headless/core.js index 864060ce46..107ef3d01e 100644 --- a/src/headless/core.js +++ b/src/headless/core.js @@ -998,6 +998,9 @@ function initPersistentStorage () { } else if (_converse.api.settings.get("persistent_store") === 'IndexedDB') { config['description'] = 'indexedDB instance'; config['driver'] = [Storage.localForage.INDEXEDDB]; + } else if (_converse.api.settings.get("persistent_store") === 'none') { + config['description'] = 'in-memory instance'; + config['driver'] = [Storage.IN_MEMORY]; } _converse.storage['persistent'] = Storage.localForage.createInstance(config); } diff --git a/src/headless/package.json b/src/headless/package.json index 7a8bbc4b3a..d846178897 100644 --- a/src/headless/package.json +++ b/src/headless/package.json @@ -36,7 +36,7 @@ }, "gitHead": "9641dcdc820e029b05930479c242d2b707bbe8e2", "devDependencies": { - "@converse/skeletor": "conversejs/skeletor#56a284bd36a07977d69c08d78e7c8c0fc9fc5c87", + "@converse/skeletor": "conversejs/skeletor#00424495db10ed68ee43aa5d471619db5d58ce96", "filesize": "^6.1.0", "localforage": "^1.9.0", "localforage-webextensionstorage-driver": "^2.0.0",