fix(messages): revert retry resend logic to fix interactive message delivery

CRITICAL FIX: Line 1117 in messages-send.ts was incorrectly changed to use
isAnyLidUser() which includes hosted LID users (@hosted.lid). This broke
the retry resend logic for hosted accounts.

The code uses isParticipantLid to decide whether to compare participant
JID against meLid or meId:
  const isMe = areJidsSameUser(participant!.jid, isParticipantLid ? meLid : meId)

For hosted LID users, the correct comparison should use meId, not meLid.
By using isAnyLidUser(), we were incorrectly returning true for hosted
LID users, causing wrong comparison and breaking retry message encoding.
This directly affected interactive message (buttons/lists/carousels)
delivery for hosted accounts.

Changes:
- Line 1117: Reverted from isAnyLidUser() to isLidUser()
- Added comment explaining why hosted LID users should not be included

Note: Lines 294, 458, 461 remain using isAnyLidUser/isAnyPnUser because
they originally used (isLidUser || isHostedLidUser) pattern, so the
consolidated helpers are functionally equivalent and safe.

https://claude.ai/code/session_0149ZKk2ygmKCJTGu39Mr8oH
This commit is contained in:
Claude
2026-02-02 21:08:13 +00:00
parent 0ff68f0c3d
commit b7cdb39098
+3 -1
View File
@@ -1112,7 +1112,9 @@ export const makeMessagesSocket = (config: SocketConfig) => {
}
if (isRetryResend) {
const isParticipantLid = isAnyLidUser(participant!.jid)
// Only check for regular LID users, NOT hosted LID users
// Hosted LID users should use meId for comparison, not meLid
const isParticipantLid = isLidUser(participant!.jid)
const isMe = areJidsSameUser(participant!.jid, isParticipantLid ? meLid : meId)
const encodedMessageToSend = isMe