Use base64 strings for incoming message cache instead of binary

This commit is contained in:
Scott Nonnenberg 2018-08-09 17:28:51 -07:00
parent 9eefc0c29b
commit 7983300f4a
7 changed files with 62 additions and 28 deletions

View file

@ -86,6 +86,11 @@ async function migrateToSQL({
forEach(array, item => {
// In the new database, we can't store ArrayBuffers, so we turn these two fields
// into strings like MessageReceiver now does before save.
// Need to set it to version two, since we're using Base64 strings now
// eslint-disable-next-line no-param-reassign
item.version = 2;
if (item.envelope) {
// eslint-disable-next-line no-param-reassign
item.envelope = arrayBufferToString(item.envelope);