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

Add in_memory storage option #2356

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/headless/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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") === 'in_memory') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer none to in_memory for the config setting value.

It's more semantic because strictly speaking, there is no persistent storage in this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense :)

config['description'] = 'in-memory instance';
config['driver'] = [Storage.IN_MEMORY];
}
_converse.storage['persistent'] = Storage.localForage.createInstance(config);
}
Expand Down
2 changes: 1 addition & 1 deletion src/headless/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down