From 928f9144a52c4a226edb34d716e2b1719bde325a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noe=CC=81=20Malzieu?= Date: Wed, 20 Nov 2024 18:57:41 -0100 Subject: [PATCH 1/5] processMessage method --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index f774f1a1b..2b1bcebb0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1450,12 +1450,12 @@ export async function processConversationMessage< id: string, encryptedMessage: string ): Promise> { - const json = XMTPModule.processConversationMessage( + const json = await XMTPModule.processConversationMessage( client.inboxId, id, encryptedMessage ) - return DecodedMessage.from(json, client) + return DecodedMessage.fromObject(json, client) } export async function processWelcomeMessage< From 1a3d4dec25fc7687deb8a3104869d193d983215b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noe=CC=81=20Malzieu?= Date: Wed, 20 Nov 2024 18:59:04 -0100 Subject: [PATCH 2/5] obj --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 2b1bcebb0..21d913d39 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1450,12 +1450,12 @@ export async function processConversationMessage< id: string, encryptedMessage: string ): Promise> { - const json = await XMTPModule.processConversationMessage( + const obj = await XMTPModule.processConversationMessage( client.inboxId, id, encryptedMessage ) - return DecodedMessage.fromObject(json, client) + return DecodedMessage.fromObject(obj, client) } export async function processWelcomeMessage< From c0c727836b0fa55cf83cc6dfc483960d0a6ac46f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noe=CC=81=20Malzieu?= Date: Wed, 20 Nov 2024 19:23:04 -0100 Subject: [PATCH 3/5] 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 21d913d39..284efcac8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1450,12 +1450,12 @@ export async function processConversationMessage< id: string, encryptedMessage: string ): Promise> { - const obj = await XMTPModule.processConversationMessage( + const json = await XMTPModule.processConversationMessage( client.inboxId, id, encryptedMessage ) - return DecodedMessage.fromObject(obj, client) + return DecodedMessage.from(json, client) } export async function processWelcomeMessage< From 35cd477f7cbce82698746ec947e096c33282b608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noe=CC=81=20Malzieu?= Date: Wed, 20 Nov 2024 19:24:49 -0100 Subject: [PATCH 4/5] 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 26de287d2..9f5a619ac 100644 --- a/android/src/main/java/expo/modules/xmtpreactnativesdk/XMTPModule.kt +++ b/android/src/main/java/expo/modules/xmtpreactnativesdk/XMTPModule.kt @@ -1553,7 +1553,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.decrypt()) + DecodedMessageWrapper.encode(message.decrypt()) } } From bcfedeb15efe3f32319be64089759f536f4d8db6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noe=CC=81=20Malzieu?= Date: Wed, 20 Nov 2024 19:27:26 -0100 Subject: [PATCH 5/5] Bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 595978c2f..46125af4e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@xmtp/react-native-sdk", - "version": "0.1.0", + "version": "2.8.5", "description": "Wraps for native xmtp sdks for react native", "main": "build/index.js", "types": "build/index.d.ts",