Make `IndexedDB` the default persistent store

This commit is contained in:
JC Brand 2021-08-31 11:41:28 +02:00
parent 90ea092e4d
commit 353a90788c
4 changed files with 14 additions and 6 deletions

View File

@ -46,6 +46,15 @@
### Breaking Changes
The default persistent store, set via the [persistent_store](https://conversejs.org/docs/html/configuration.html#persistent-store),
is now IndexedDB. This main advantage of using IndexedDB is that it doesn't
have a fixed size limit. We don't provide a tool to migrate data from
localStorage to IndexedDB. For almost all data this is not a problem since
the data can be fetched again from the XMPP server. However,
decrypted OMEMO messages cannot be fetched again from the server, since the
double ratchet makes it impossible to again decrypt them. This means your
decrypted OMEMO history will be lost in the transition.
The [afterMessageBodyTransformed](https://conversejs.org/docs/html/api/-_converse.html#event:afterMessageBodyTransformed) and [beforeMessageBodyTransformed](https://conversejs.org/docs/html/api/-_converse.html#event:beforeMessageBodyTransformed) events now has a different signatures.
When leaving a MUC, the message history is deleted. This means that decrypted
OMEMO messages are gone and cannot be recovered on that device. See [muc_clear_messages_on_leave](https://conversejs.org/docs/html/configuration.html#muc-clear-messages-on-leave).

View File

@ -16,7 +16,7 @@
<script src="dist/converse.js"></script>
</head>
<body class="reset" style="background-color: #211018;">
<body class="reset" style="background-color: var(--global-background-color)">
<div id="conversejs-bg"></div>
<script>
@ -36,9 +36,8 @@
muc_respect_autojoin: true,
muc_show_logs_before_join: true,
notify_all_room_messages: ['discuss@conference.conversejs.org'],
persistent_store: 'IndexedDB',
// theme: 'concord',
// view_mode: 'fullscreen',
theme: 'concord',
view_mode: 'fullscreen',
websocket_url: 'wss://conversejs.org/xmpp-websocket',
// websocket_url: 'ws://chat.example.org:5380/xmpp-websocket',
whitelisted_plugins: ['converse-debug'],

View File

@ -39,7 +39,7 @@ export const DEFAULT_SETTINGS = {
],
nickname: undefined,
password: undefined,
persistent_store: 'localStorage',
persistent_store: 'IndexedDB',
rid: undefined,
root: window.document,
sid: undefined,

View File

@ -622,7 +622,7 @@ async function _initConverse (settings) {
'discover_connection_methods': false,
'enable_smacks': false,
'i18n': 'en',
// 'persistent_store': 'IndexedDB',
'persistent_store': 'localStorage',
'loglevel': 'warn',
'no_trimming': true,
'play_sounds': false,