From 64ffe9da1348156ed403d2611a4bf9e38fb6c65d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noe=CC=81=20Malzieu?= Date: Wed, 20 Nov 2024 19:01:12 -0100 Subject: [PATCH 1/3] fix(processMessage): await processMessage and handle object --- src/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 33a4ba78..fbf34863 100644 --- a/src/index.ts +++ b/src/index.ts @@ -857,8 +857,12 @@ export async function processMessage< id: ConversationId, encryptedMessage: string ): Promise> { - const json = XMTPModule.processMessage(client.inboxId, id, encryptedMessage) - return DecodedMessage.from(json, client) + const obj = await XMTPModule.processMessage( + client.inboxId, + id, + encryptedMessage + ) + return DecodedMessage.fromObject(obj, client) } export async function processWelcomeMessage< From 4dca6708a54aff6a20a4b3b7301ed1be7211558b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noe=CC=81=20Malzieu?= Date: Wed, 20 Nov 2024 19:22:32 -0100 Subject: [PATCH 2/3] we should expect the bridge to return a string --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index fbf34863..59815a0b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -857,12 +857,12 @@ export async function processMessage< id: ConversationId, encryptedMessage: string ): Promise> { - const obj = await XMTPModule.processMessage( + const json = await XMTPModule.processMessage( client.inboxId, id, encryptedMessage ) - return DecodedMessage.fromObject(obj, client) + return DecodedMessage.from(json, client) } export async function processWelcomeMessage< From 8c16cba47cc2bcea3f97347784e933c1fdbd8c15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noe=CC=81=20Malzieu?= Date: Wed, 20 Nov 2024 19:24:25 -0100 Subject: [PATCH 3/3] fixing the kotlin code to return a string --- .../src/main/java/expo/modules/xmtpreactnativesdk/XMTPModule.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/expo/modules/xmtpreactnativesdk/XMTPModule.kt b/android/src/main/java/expo/modules/xmtpreactnativesdk/XMTPModule.kt index 454c04c1..d2c608d3 100644 --- a/android/src/main/java/expo/modules/xmtpreactnativesdk/XMTPModule.kt +++ b/android/src/main/java/expo/modules/xmtpreactnativesdk/XMTPModule.kt @@ -1060,7 +1060,7 @@ class XMTPModule : Module() { val conversation = client.findConversation(id) ?: throw XMTPException("no conversation found for $id") val message = conversation.processMessage(Base64.decode(encryptedMessage, NO_WRAP)) - DecodedMessageWrapper.encodeMap(message.decode()) + DecodedMessageWrapper.encode(message.decode()) } }