diff --git a/js/modules/loki_message_api.js b/js/modules/loki_message_api.js index 0972a9831..b5ba47d0c 100644 --- a/js/modules/loki_message_api.js +++ b/js/modules/loki_message_api.js @@ -74,7 +74,7 @@ const fetch = async (url, options = {}) => { } try { result = JSON.parse(result); - } catch(e) { + } catch (e) { log.warn(`Could not parse string to json ${result}`, e); } } diff --git a/libloki/test/snode_channel_test.js b/libloki/test/snode_channel_test.js index d6cd918a9..9960dde68 100644 --- a/libloki/test/snode_channel_test.js +++ b/libloki/test/snode_channel_test.js @@ -98,8 +98,14 @@ describe('Snode Channel', () => { senderPubKey, snodePrivKey ); - const encryptedArrayBuffer = dcodeIO.ByteBuffer.wrap(encrypted, 'base64').toArrayBuffer(); - const decrypted = await libloki.crypto.DHDecrypt(symmetricKey, encryptedArrayBuffer); + const encryptedArrayBuffer = dcodeIO.ByteBuffer.wrap( + encrypted, + 'base64' + ).toArrayBuffer(); + const decrypted = await libloki.crypto.DHDecrypt( + symmetricKey, + encryptedArrayBuffer + ); const textDecoder = new TextDecoder(); const messageReceived = textDecoder.decode(decrypted); assert.strictEqual(messageSent, messageReceived); @@ -124,7 +130,9 @@ describe('Snode Channel', () => { snodePrivKey ); const encrypted = await libloki.crypto.DHEncrypt(symmetricKey, data); - const encryptedBase64 = dcodeIO.ByteBuffer.wrap(encrypted).toString('base64'); + const encryptedBase64 = dcodeIO.ByteBuffer.wrap(encrypted).toString( + 'base64' + ); // message received by Loki Messenger const decrypted = await channel.decrypt(snode.address, encryptedBase64); assert.strictEqual(messageSent, decrypted);