From c23093a04dab664532d2a85650578be5894a79d9 Mon Sep 17 00:00:00 2001 From: setkyar Date: Thu, 15 Oct 2026 11:11:11 +0700 Subject: [PATCH] fix(web): use contact id for conversation takeover --- apps/web/src/pages/ChatPage.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/web/src/pages/ChatPage.tsx b/apps/web/src/pages/ChatPage.tsx index 3a82e979..ad99619c 100644 --- a/apps/web/src/pages/ChatPage.tsx +++ b/apps/web/src/pages/ChatPage.tsx @@ -299,9 +299,13 @@ export function ChatPage() { // about the surviving customer gates the wrong conversation: a thread // assigned to someone else shows a live composer, and one assigned to this // user shows the take-over bar that assigning cannot clear. - const { access: composerAccess } = useComposerAccess( - activeThread?.contactId ?? selectedChatId ?? null, - ); + // Contact reads accept a conversation UUID and resolve it to a contact, but + // contact mutations do not. Keep the thread's real contact UUID once it has + // been resolved so Take over/Unblock never POST a conversation UUID to a + // `/contacts/:id/*` route (which responds with "Contact not found"). + const composerContactId = + activeThread?.contactId ?? selectedContact?.id ?? selectedChatId ?? null; + const { access: composerAccess } = useComposerAccess(composerContactId); const canSend = composerAccess.kind === "sendable"; // The thread's own JID decides this. A merged customer's surviving contact // may be neutral and JID-less, which read as "not a group" and stripped @@ -450,7 +454,7 @@ export function ChatPage() {