Two changes to fix carousel rendering on WhatsApp Web/Desktop:
1. Added carouselCardType: 1 (HSCROLL_CARDS) to carouselMessage - this
proto field tells the client how to render carousel cards. Without it,
Web/Desktop doesn't know to render horizontal scrollable cards.
2. Removed viewOnceMessage wrapper - confirmed it causes error 479
rejection from linked devices (Web/Desktop). Carousel works as
direct interactiveMessage on phone; carouselCardType should fix Web.
https://claude.ai/code/session_01EK9NpViRCtda1WAvFd8ptR
WhatsApp Web/Desktop requires interactiveMessage to be wrapped inside
viewOnceMessage.message to render carousels fully. Without the wrapper,
only the header/body text is shown. The previous error 479 was caused by
missing messageVersion and empty messageParamsJson in cards, not by the
viewOnceMessage wrapper itself. Those card fixes are preserved.
https://claude.ai/code/session_01EK9NpViRCtda1WAvFd8ptR
Each carousel card's nativeFlowMessage was missing messageVersion and
had empty string '' for messageParamsJson instead of '{}'. This caused
error 479 on linked devices (Web/Desktop) while phone rendered OK.
https://claude.ai/code/session_01EK9NpViRCtda1WAvFd8ptR
Carousels wrapped in viewOnceMessage cause error 479 rejection.
Pastorini sends carousel as direct interactiveMessage which works
on all platforms including WhatsApp Web/Desktop.
https://claude.ai/code/session_01EK9NpViRCtda1WAvFd8ptR
The <bot biz_bot="1"/> node prevents WhatsApp Web/Desktop from rendering
ALL native_flow button types, not just CTA. Quick_reply buttons had the
same issue: visible on smartphone only.
Confirmed: removing bot node fixes rendering on Web/Desktop for both
CTA buttons and quick_reply buttons.
https://claude.ai/code/session_01EK9NpViRCtda1WAvFd8ptR
Empty name '' is rejected by WhatsApp server (error 405 in ack).
Reverted to 'mixed' which delivers successfully.
The key fix remains: no bot node for CTA-only buttons (Web compatibility).
https://claude.ai/code/session_01EK9NpViRCtda1WAvFd8ptR
- Changed native_flow name from 'mixed' to '' (empty) for all regular buttons
(both CTA and quick_reply), matching WhatsApp client traffic analysis
- Only special flows (payment_info, mpm, order_details) get specific names
- Fixed variable scope: moved hasCTA/hasQuickReply/isCTAOnly before if/else block
to ensure they're accessible for bot node conditional logic
- Removed duplicate CTA_BUTTON_NAMES/allButtonNames declarations
https://claude.ai/code/session_01EK9NpViRCtda1WAvFd8ptR
- Detect button types (CTA vs quick_reply) in nativeFlowMessage to set
appropriate native_flow name attribute: '' for CTA-only, 'quick_reply'
for quick_reply-only, 'mixed' for combinations
- Skip bot node injection for CTA-only buttons (cta_url, cta_copy, cta_call)
as the bot node prevents WhatsApp Web from rendering CTA buttons
- Keep bot node for quick_reply buttons which need it for response handling
https://claude.ai/code/session_01EK9NpViRCtda1WAvFd8ptR
Validates sections, rows, and string lengths before sending:
- Max 10 sections, 10 rows/section, 30 total rows
- Section title max 24 chars, row title max 24 chars
- Row description max 72 chars, row ID max 200 chars
- buttonText max 20 chars
- At least 1 section and 1 row per section required
Applied to all 3 list message paths: generateListMessage,
generateListMessageLegacy, and inline sections handler.
https://claude.ai/code/session_01SJdSHiUxtwzV8bb5dedodb
When title is not provided, the text was used as fallback for both
title and description, causing the header to appear twice. Now title
only uses an explicit title field, description uses text.
https://claude.ai/code/session_01SJdSHiUxtwzV8bb5dedodb
PRODUCT_LIST type requires WhatsApp Business catalog data and causes
error 479 for regular menu lists. SINGLE_SELECT is the correct type
for interactive menu lists with sections/rows.
https://claude.ai/code/session_01SJdSHiUxtwzV8bb5dedodb
getButtonType was returning undefined for listMessage, preventing
the existing product_list biz node from being injected. Changes:
- getButtonType returns 'list' for message.listMessage (line 632)
- getButtonType returns 'list' for innerMessage.listMessage (line 675)
- Exclude list messages from bot node injection (line 1325)
https://claude.ai/code/session_01SJdSHiUxtwzV8bb5dedodb
The viewOnceMessage > interactiveMessage > nativeFlowMessage wrapper with
single_select button was causing error 479 even with correct biz node.
WhatsApp requires the message to be in direct listMessage format (legacy)
paired with biz > list (type=product_list, v=2) node.
This matches the Pastorini implementation which sends:
- messageKeys: ['listMessage'] (NOT viewOnceMessage)
- biz > list (type=product_list, v=2)
The conversion extracts sections from nativeFlowMessage's single_select
buttonParamsJson and creates a proper listMessage with SINGLE_SELECT type.
https://claude.ai/code/session_01SJdSHiUxtwzV8bb5dedodb
The listMessage was getting error 405 because the biz node used
'interactive > native_flow' structure which is wrong for list messages.
Changed to use 'biz > list (type=product_list, v=2)' structure which
matches the Pastorini reference implementation and works on both
smartphone and web WhatsApp.
Changes:
- Differentiate biz node based on message type (list vs interactive)
- For listMessage/nativeList: use biz > list (type=product_list, v=2)
- For other interactive: keep biz > interactive > native_flow
- Skip bot node injection for list messages
- All listMessages (SINGLE_SELECT + PRODUCT_LIST) now get biz node
- Add diagnostic logging matching Pastorini format
https://claude.ai/code/session_01SJdSHiUxtwzV8bb5dedodb
Error 479 persisted even with correct listType. The issue is that
listMessage (legacy format) does NOT need biz node injection at all.
The biz node was causing the error. listMessage works natively without it.
Changes:
- getButtonType() returns undefined for message.listMessage
- No biz node is injected for list messages
- Keep listType as PRODUCT_LIST (from previous commit)
This should allow listMessage to be delivered without error 479.
https://claude.ai/code/session_01Vgu4xrsj8aUVCHWb4pmQPF
Error 479 was still occurring even with legacy listMessage format.
The issue is that listType must be PRODUCT_LIST (not SINGLE_SELECT)
to match the biz node type="product_list" v="2" that we're injecting.
This matches pastorini's working implementation exactly:
- listMessage with listType: PRODUCT_LIST
- biz node with type="product_list" v="2"
https://claude.ai/code/session_01Vgu4xrsj8aUVCHWb4pmQPF
The modern interactiveMessage format was causing error 479 (message rejection).
Switched to legacy listMessage format that matches pastorini's working implementation.
Changes:
1. **messages.ts**: Changed nativeList to use generateListMessageLegacy()
- Creates listMessage directly (not viewOnceMessage wrapper)
- Uses SINGLE_SELECT type (standard list)
2. **messages-send.ts**: Inject correct biz node for listMessage
- For buttonType === 'list': <biz><list type="product_list" v="2">
- Matches pastorini's working structure
- Removed checks that skipped biz node for listMessage
Why this works:
- Legacy listMessage + product_list biz node = accepted by WhatsApp
- Modern interactiveMessage + native_flow biz node = error 479
- This matches the pastorini implementation that works on Web/iOS/Android
https://claude.ai/code/session_01Vgu4xrsj8aUVCHWb4pmQPF
After testing, messages with list-specific biz node structure were not being
delivered. Analysis of the issue revealed that list messages with nativeFlowMessage
should NOT have biz node injection, similar to product lists.
Changes:
- Modified getButtonType() to detect list buttons (single_select/multi_select)
- Return undefined for list buttons to skip biz node injection
- Applied to both direct interactiveMessage and viewOnceMessage wrapped messages
- Simplified biz node injection logic since lists now skip it
This approach aligns with how product lists are handled (no biz node) and
should allow list messages to be delivered successfully on all platforms.
Previous attempt used custom biz node structure which caused delivery failures.
This conservative approach avoids biz node entirely for lists.
https://claude.ai/code/session_01Vgu4xrsj8aUVCHWb4pmQPF
Previously, list messages were using the same biz node structure as other
interactive messages (<biz><interactive type="native_flow">), which only
worked on Android. The Web and iOS clients require a different structure
for list messages.
Changes:
- Detect list messages using isListNativeFlow() check
- For list messages: inject <biz><list type="single_select" v="2">
- For other interactive messages: keep existing <biz><interactive> structure
- Add logging to distinguish list-specific biz node injection
This matches the structure used by other implementations (e.g., pastorini)
where the biz node contains a direct <list> tag instead of <interactive>.
Tested structure:
{
tag: 'biz',
content: [{
tag: 'list',
attrs: { type: 'single_select', v: '2' }
}]
}
This should resolve the issue where list messages were only displaying
on Android but not appearing on Web or iOS clients.
https://claude.ai/code/session_01Vgu4xrsj8aUVCHWb4pmQPF
* feat(signal): add RetryReason enum and MAC error-based session recreation
* feat(signal): add identity change detection with automatic session clearing
* fix(signal): integrate identity change detection with pkmsg decryption
This completes the identity change detection implementation by actually
calling saveIdentity() during pkmsg decryption, which is CRITICAL for
the feature to work.
Changes:
- Add extractIdentityFromPkmsg() function that parses PreKeyWhisperMessage
protobuf to extract sender's identity key (33 bytes)
- Call saveIdentity() BEFORE decryption in decryptMessage() for pkmsg type
- Log when identity change is detected
Flow:
1. Receive pkmsg from sender
2. Extract identity key from PreKeyWhisperMessage protobuf
3. Call storage.saveIdentity() which compares with stored key
4. If key changed → session is cleared atomically
5. Decryption proceeds with re-established session
This matches WhatsApp Web's behavior where extractIdentityKey is called
before handleNewSession (GysEGRAXCvh.js:40917, 48815).
Ref: WhatsApp Web's extractIdentityKey (GysEGRAXCvh.js:48976-48998)
Fixed TypeScript compilation error when using Sharp library:
- Changed lib.sharp(buffer) to lib.sharp.default(buffer)
- Dynamic imports return module with .default property
- Affects both WebP conversion and thumbnail generation
Error fixed:
TS2349: This expression is not callable.
Type '{ default: typeof sharp; ... }' has no call signatures.
https://claude.ai/code/session_01FaRqGuPecEyPx1qiuRV8Ye
* feat: replace async crypto with sync Rust WASM for app state sync
* fix: remove unecessary buffer copying
* fix: update whatsapp-rust-bridge to version 0.5.2 and refactor async calls to sync. HKDF and MD5 in rust