From 384690f84d6e07103ce05aaed3b501d888c5198a Mon Sep 17 00:00:00 2001 From: maaz519 Date: Sat, 25 Jul 2026 17:47:16 +0530 Subject: [PATCH] fix(messenger): sent messages no longer show Seen instantly (SDK 0.1.14) Receipts now prefer userId over the IIOS actor UUID, so the SDK can actually tell your own read receipt from the other party's. Co-Authored-By: Claude Opus 4.8 --- package-lock.json | 8 ++++---- package.json | 2 +- src/lib/crm-messaging-adapter.ts | 4 +++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index d814095..d9033e2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@huggingface/transformers": "^4.2.0", "@imgly/background-removal": "^1.7.0", "@insignia/iios-kernel-client": "^0.1.4", - "@insignia/iios-messaging-ui": "^0.1.13", + "@insignia/iios-messaging-ui": "^0.1.14", "@photo-gallery/sdk": "file:./vendor/photo-gallery-sdk", "@tensorflow-models/coco-ssd": "^2.2.3", "@tensorflow/tfjs": "^4.22.0", @@ -1087,9 +1087,9 @@ } }, "node_modules/@insignia/iios-messaging-ui": { - "version": "0.1.13", - "resolved": "https://git.lynkedup.cloud/api/packages/insignia/npm/%40insignia%2Fiios-messaging-ui/-/0.1.13/iios-messaging-ui-0.1.13.tgz", - "integrity": "sha512-ZJxn/E7P5mx/rCFjbXlCetl75KWStqSAeZHqvV4zKuYhPw6aDtOW5hVZW7x05qTyYvkHFdZlx+DkT1j0aalCzw==", + "version": "0.1.14", + "resolved": "https://git.lynkedup.cloud/api/packages/insignia/npm/%40insignia%2Fiios-messaging-ui/-/0.1.14/iios-messaging-ui-0.1.14.tgz", + "integrity": "sha512-ywm0DuOxoddlmi48tU27N3jtTF3pMGwnw9M/BhluPPcnJSlwy6aN03BynCGkWRrkXrxGY7c+3G1EMX/eUr7Ffw==", "peerDependencies": { "@insignia/iios-kernel-client": "*", "react": ">=18", diff --git a/package.json b/package.json index 3f51e70..f7cfebc 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "@huggingface/transformers": "^4.2.0", "@imgly/background-removal": "^1.7.0", "@insignia/iios-kernel-client": "^0.1.4", - "@insignia/iios-messaging-ui": "^0.1.13", + "@insignia/iios-messaging-ui": "^0.1.14", "@photo-gallery/sdk": "file:./vendor/photo-gallery-sdk", "@tensorflow-models/coco-ssd": "^2.2.3", "@tensorflow/tfjs": "^4.22.0", diff --git a/src/lib/crm-messaging-adapter.ts b/src/lib/crm-messaging-adapter.ts index f1c4aca..16a5c73 100644 --- a/src/lib/crm-messaging-adapter.ts +++ b/src/lib/crm-messaging-adapter.ts @@ -69,7 +69,9 @@ export class CrmMessagingAdapter implements MessagingAdapter { }); socket.on("typing", (e) => this.emit(e.threadId, { kind: "typing", userId: e.userId })); // Receipts carry no threadId → fan to all open threads; the UI filters by messageId. - socket.on("receipt", (e) => this.broadcast({ kind: "receipt", messageId: e.interactionId, actorId: e.actorId })); + // Prefer userId: the SDK compares this against currentActorId(), which is a userId. e.actorId + // is an IIOS actor UUID, so using it made "is this my own receipt?" always answer no. + socket.on("receipt", (e) => this.broadcast({ kind: "receipt", messageId: e.interactionId, actorId: e.userId ?? e.actorId })); socket.on("annotation", (e) => { if (e.type !== REACTION) return; this.setReactionUsers(e.interactionId, e.value, e.users);