diff --git a/native/handlers/peer-to-peer-message-handler.js b/native/handlers/peer-to-peer-message-handler.js --- a/native/handlers/peer-to-peer-message-handler.js +++ b/native/handlers/peer-to-peer-message-handler.js @@ -27,6 +27,7 @@ } } else if (message.type === peerToPeerMessageTypes.ENCRYPTED_MESSAGE) { try { + await commCoreModule.initializeCryptoAccount(); const decrypted = await commCoreModule.decrypt( message.encryptedContent, message.senderInfo.deviceID, @@ -42,6 +43,7 @@ ); } } else if (message.type === peerToPeerMessageTypes.REFRESH_KEY_REQUEST) { + await commCoreModule.initializeCryptoAccount(); const [ { userID, deviceID, accessToken }, notificationsOneTimeKeys, diff --git a/native/profile/tunnelbroker-menu.react.js b/native/profile/tunnelbroker-menu.react.js --- a/native/profile/tunnelbroker-menu.react.js +++ b/native/profile/tunnelbroker-menu.react.js @@ -73,6 +73,7 @@ if (!currentUserID) { return; } + await commCoreModule.initializeCryptoAccount(); const encrypted = await commCoreModule.encrypt( `Encrypted message to ${recipient}`, recipient, diff --git a/native/utils/crypto-utils.js b/native/utils/crypto-utils.js --- a/native/utils/crypto-utils.js +++ b/native/utils/crypto-utils.js @@ -50,6 +50,7 @@ throw new Error('CommServicesAuthMetadata is missing'); } + await commCoreModule.initializeCryptoAccount(); const keysResponse = await commRustModule.getInboundKeysForUser( userID, deviceID, @@ -112,6 +113,7 @@ throw new Error('CommServicesAuthMetadata is missing'); } + await commCoreModule.initializeCryptoAccount(); const keysResponse = await commRustModule.getOutboundKeysForUser( userID, deviceID,