Skip to content

send: use a fresh sender key for every broadcast list message - #2

Open
ADAMAYAMEOGO wants to merge 1 commit into
devlikeapro:fork-main-2026-10-13from
ADAMAYAMEOGO:fix/broadcast-list-rotation-2026-10-13
Open

ADAMAYAMEOGO wants to merge 1 commit into
devlikeapro:fork-main-2026-10-13from
ADAMAYAMEOGO:fix/broadcast-list-rotation-2026-10-13

Conversation

@ADAMAYAMEOGO

Copy link
Copy Markdown

Needed to send to phone-created broadcast lists from GOWS (devlikeapro/waha#468).

When a linked device sends to one of the account's broadcast lists, the phone only records the message as sent (in the list and in each recipient's chat) when it can't decrypt the fan-out copy and gets the message through a retry instead. Answering that retry also hands the phone the list's sender key (handleRetryReceipt attaches a SenderKeyDistributionMessage for group and broadcast chats), so from then on it decrypts the fan-out copy directly and the following messages never show up on the phone. Recipients are not affected.

This resets the sender key before each message to a non-status broadcast list. Statuses and groups are unchanged. Recipients get the new key with each message anyway, since sendGroup sends the SenderKeyDistributionMessage to every participant device every time, and sends are serialized by messageSendLock.

Tested with consecutive messages to a phone-created list, on a personal and a WhatsApp Business account: without the change only the first message after a key change shows up on the phone, with it every message does.

Based on fork-main-2026-10-13. It replaces #1, which targeted fork-main-2026-09-10. GOWS will need its whatsmeow replace bumped to include this.

When another device of the account sends to one of its broadcast lists,
the phone only records the message as sent (in the list and in each
recipient's chat) if it can't decrypt the fan-out copy: it then asks for
a retry and gets the message encrypted for it alone. If it holds the
list's sender key, it decrypts the fan-out copy directly and never shows
the message. Answering a retry hands it the current sender key
(handleRetryReceipt attaches a SenderKeyDistributionMessage for group
and broadcast chats), so only the first message after a key change
shows up on the phone.

Resetting the sender key before each message to a (non-status) broadcast
list keeps the phone on the retry path. Recipients are not affected:
sendGroup sends the SenderKeyDistributionMessage to every participant
device with each message anyway. Statuses and groups are unchanged.

Tested with WAHA/GOWS on a personal and a WhatsApp Business account,
with consecutive messages to a phone-created list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant