From 7333eccdedafe0bedee3a7ef9f3ba9b5c232d3c6 Mon Sep 17 00:00:00 2001 From: Renato Alcara Date: Sat, 25 Apr 2026 18:06:58 -0300 Subject: [PATCH] fix(tctoken): add carousel exception to AB prop 10518 gate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Defensive: if WhatsApp ever flips AB prop 10518 (privacy_token_sending_on_all_1_on_1_messages) to false, the gate added in 225b692b7c would drop the tctoken from ALL 1:1 sends — including carousel, which Pastorini CDP capture confirms requires tctoken to render correctly on Android. Match the fork's pre-PR #2339 behaviour for carousel only: always attach when a tcTokenBuffer is available. Regular 1:1 sends still honour the AB prop. --- src/Socket/messages-send.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Socket/messages-send.ts b/src/Socket/messages-send.ts index 6974809e..2356313b 100644 --- a/src/Socket/messages-send.ts +++ b/src/Socket/messages-send.ts @@ -1731,7 +1731,13 @@ export const makeMessagesSocket = (config: SocketConfig) => { // Gate inclusion on AB prop 10518 (privacy_token_sending_on_all_1_on_1_messages). // WA Web defaults to true; if the server flips it off we mirror that to avoid // divergence with the spec-compliant client. - if (tcTokenBuffer?.length && sock.serverProps.privacyTokenOn1to1) { + // + // CARROUSEL EXCEPTION: Pastorini-validated carousel stanzas REQUIRE tctoken + // (CDP capture confirms it). If the AB prop ever flips off, dropping the + // tctoken from carousel would break rendering on Android. Carousel always + // includes the tctoken when one is available, regardless of the prop — + // matching the fork's existing behaviour pre-PR #2339. + if (tcTokenBuffer?.length && (sock.serverProps.privacyTokenOn1to1 || isCarousel)) { ;(stanza.content as BinaryNode[]).push({ tag: 'tctoken', attrs: {},