From d53de5b12253a0576cb098d1a5dbb2558973d2dc Mon Sep 17 00:00:00 2001 From: Wahyu Saputra Date: Thu, 11 Dec 2025 12:25:40 +0700 Subject: [PATCH 1/9] fix: patch Baileys to filter sender from senderKeyJids in LID groups Baileys v6.7.19 includes sender's own devices in senderKeyJids when sending to LID-addressed groups, causing WhatsApp to reject with 'not-acceptable' error. This patch filters sender's own devices from the senderKeyJids list before sending group messages, following the same pattern Baileys uses for non-group messages (meJids vs otherJids filtering). Changes: - Add Baileys patch in patches/baileys+6.7.19+lid-group-send.patch - Update Dockerfile to apply patch after npm ci - Extract meUser from meId and meLid from authState.creds - Skip sender's own devices in senderKeyJids loop Fixes: #issue-number Related: WhiskeySockets/Baileys#1690, #1768 --- CHANGELOG.md | 2 +- Dockerfile | 4 ++++ patches/baileys+6.7.19+lid-group-send.patch | 22 +++++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 patches/baileys+6.7.19+lid-group-send.patch diff --git a/CHANGELOG.md b/CHANGELOG.md index 3449ad1ba..936e5ac8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ### Widget Works Modification -* [WIDGET-WORKS] Silence "Parent message not found" warnings during history sync to prevent CPU overload and subsequent 401 disconnects. +* [WIDGET-WORKS] Patch Baileys to filter sender's own devices from senderKeyJids in LID group messages (fixes "not-acceptable" error preventing group message sends). * [WIDGET-WORKS] Fix `PrismaClientValidationError` in `messages.update` (missing `Message` relation) by guarding `messageUpdate.create` calls. * [WIDGET-WORKS] Guard `messages.update` cache cleanup with a derived key and optional `MESSAGE_UPDATE_CACHE_DELETE_DISABLED` flag to prevent cache.delete crash-loops. * [WIDGET-WORKS] Save messages before Chatwoot sync in `/message/sendText` to avoid missing `chatwootMessageId` and log async sync failures. diff --git a/Dockerfile b/Dockerfile index 2f30eea09..b46d34d36 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,10 @@ COPY ./tsup.config.ts ./ RUN npm ci --silent +# [WIDGET-WORKS] Apply Baileys patch for LID group send fix +COPY ./patches ./patches +RUN patch -p0 < patches/baileys+6.7.19+lid-group-send.patch || echo "Patch already applied or failed" + COPY ./src ./src COPY ./public ./public COPY ./prisma ./prisma diff --git a/patches/baileys+6.7.19+lid-group-send.patch b/patches/baileys+6.7.19+lid-group-send.patch new file mode 100644 index 000000000..e3e29d7f1 --- /dev/null +++ b/patches/baileys+6.7.19+lid-group-send.patch @@ -0,0 +1,22 @@ +diff --git a/node_modules/baileys/lib/Socket/messages-send.js b/node_modules/baileys/lib/Socket/messages-send.js +index 1234567..abcdefg 100644 +--- a/node_modules/baileys/lib/Socket/messages-send.js ++++ b/node_modules/baileys/lib/Socket/messages-send.js +@@ -360,8 +360,14 @@ export const makeMessagesSocket = (config) => { + meId + }); + const senderKeyJids = []; +- // ensure a connection is established with every device ++ // [WIDGET-WORKS] Filter sender's own devices from senderKeyJids (LID group send fix) ++ // Same pattern as non-group path (line ~396) - fixes "not-acceptable" error ++ const { user: meUser } = jidDecode(meId); ++ const meLid = authState.creds?.me?.lid?.split(':')[0]?.split('@')[0]; ++ // ensure a connection is established with every device + for (const { user, device } of devices) { ++ // [WIDGET-WORKS] Skip sender's own devices ++ if (user === meUser || user === meLid) { ++ continue; ++ } + const jid = jidEncode(user, groupData?.addressingMode === 'lid' ? 'lid' : 's.whatsapp.net', device); + if (!senderKeyMap[jid] || !!participant) { + senderKeyJids.push(jid); From 38b013764a1741ca0448a436f31b74ae0803d06e Mon Sep 17 00:00:00 2001 From: Wahyu Saputra Date: Thu, 11 Dec 2025 12:55:55 +0700 Subject: [PATCH 2/9] fix(docker): install patch binary in Alpine for Baileys patch application Alpine Linux does not include 'patch' by default. Without this, the Baileys LID group send patch would silently fail during build, leaving the fix unapplied in production images. Changes: - Add 'patch' to apk install list - Remove '|| echo' fallback to fail fast on patch errors --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index b46d34d36..2369f31b0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM node:20-alpine AS builder RUN apk update && \ - apk add --no-cache git ffmpeg wget curl bash openssl + apk add --no-cache git ffmpeg wget curl bash openssl patch LABEL version="2.3.2" description="Api to control whatsapp features through http requests." LABEL maintainer="Davidson Gomes" git="https://github.com/DavidsonGomes" @@ -17,7 +17,7 @@ RUN npm ci --silent # [WIDGET-WORKS] Apply Baileys patch for LID group send fix COPY ./patches ./patches -RUN patch -p0 < patches/baileys+6.7.19+lid-group-send.patch || echo "Patch already applied or failed" +RUN patch -p0 < patches/baileys+6.7.19+lid-group-send.patch COPY ./src ./src COPY ./public ./public From ea6b54d6dfea8fdf5bac5945448fab8748b62c85 Mon Sep 17 00:00:00 2001 From: Wahyu Saputra Date: Thu, 11 Dec 2025 13:02:31 +0700 Subject: [PATCH 3/9] Fix patch strip level for Baileys LID group fix --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2369f31b0..28e04b249 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ RUN npm ci --silent # [WIDGET-WORKS] Apply Baileys patch for LID group send fix COPY ./patches ./patches -RUN patch -p0 < patches/baileys+6.7.19+lid-group-send.patch +RUN patch -p1 < patches/baileys+6.7.19+lid-group-send.patch COPY ./src ./src COPY ./public ./public From b1c030c3c72ebab18bc5cdfd6ed251a6c88e305b Mon Sep 17 00:00:00 2001 From: Wahyu Saputra Date: Thu, 11 Dec 2025 13:13:30 +0700 Subject: [PATCH 4/9] fix(patch): correct patch format and strip level - Use unified diff format without git headers - Change from -p1 to -p0 for correct path stripping - Ensures patch applies correctly during Docker build --- Dockerfile | 2 +- patches/baileys+6.7.19+lid-group-send.patch | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 28e04b249..2369f31b0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ RUN npm ci --silent # [WIDGET-WORKS] Apply Baileys patch for LID group send fix COPY ./patches ./patches -RUN patch -p1 < patches/baileys+6.7.19+lid-group-send.patch +RUN patch -p0 < patches/baileys+6.7.19+lid-group-send.patch COPY ./src ./src COPY ./public ./public diff --git a/patches/baileys+6.7.19+lid-group-send.patch b/patches/baileys+6.7.19+lid-group-send.patch index e3e29d7f1..5584e773c 100644 --- a/patches/baileys+6.7.19+lid-group-send.patch +++ b/patches/baileys+6.7.19+lid-group-send.patch @@ -1,8 +1,6 @@ -diff --git a/node_modules/baileys/lib/Socket/messages-send.js b/node_modules/baileys/lib/Socket/messages-send.js -index 1234567..abcdefg 100644 --- a/node_modules/baileys/lib/Socket/messages-send.js +++ b/node_modules/baileys/lib/Socket/messages-send.js -@@ -360,8 +360,14 @@ export const makeMessagesSocket = (config) => { +@@ -360,8 +360,14 @@ meId }); const senderKeyJids = []; From e5ffef64c3fa1152e480c0b3e12b1194b7a7ca0e Mon Sep 17 00:00:00 2001 From: Wahyu Saputra Date: Thu, 11 Dec 2025 15:20:48 +0700 Subject: [PATCH 5/9] fix(patch): complete Baileys patch with proper trailing context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes malformed patch error during Docker build by adding complete trailing context lines to the unified diff format. - Previous patch ended prematurely at line 21 causing "malformed patch at line 19" error - Added proper trailing context (lines showing unchanged code after modifications) - Patch now correctly shows 8→14 line transformation (adding 6 lines of sender filtering) - Updated documentation with deployment issues encountered and solutions Related to LID group send failure fix for "not-acceptable" error. --- ...1-12-25-group-chat-not-acceptable-error.md | 184 ++++++++++++++++++ patches/baileys+6.7.19+lid-group-send.patch | 15 +- 2 files changed, 192 insertions(+), 7 deletions(-) create mode 100644 docs/troubleshooting/11-12-25-group-chat-not-acceptable-error.md diff --git a/docs/troubleshooting/11-12-25-group-chat-not-acceptable-error.md b/docs/troubleshooting/11-12-25-group-chat-not-acceptable-error.md new file mode 100644 index 000000000..62d607bcd --- /dev/null +++ b/docs/troubleshooting/11-12-25-group-chat-not-acceptable-error.md @@ -0,0 +1,184 @@ +# Group Chat "not-acceptable" Error - LID Group Send Failure + +**Date:** December 11, 2025 +**Status:** PATCH FIXED - Ready for deployment to staging +**Severity:** HIGH - Blocking group message sends +**Last Updated:** 2025-12-11 (Patch file format corrected) + +## Summary +Instance `6287777635515` cannot send messages to LID-addressed group `120363407389509612@g.us`. Baileys includes sender's own devices in sender key distribution, causing WhatsApp to reject with "not-acceptable". + +## Affected Resources +- **Group:** `120363407389509612@g.us` (Test Group Chat) +- **Addressing Mode:** LID (`@lid` JIDs) +- **Instances:** `6287777635515` (inbox 1), `6287785582370` (inbox 16) +- **Conversations:** 400 (inbox 1), 401 (inbox 16) + +## Timeline +- **03:49:01** - First error from `6287785582370` +- **03:49:30** - Error from `6287777635515` +- **04:08:36** - Error persists (both instances) +- **04:15:46** - After removing `6287785582370` from group, error continues +- **04:16:38** - After restarting instance, error still occurs (msg 3065674, 3065679) + +## Root Cause: Baileys Sender Key Bug with LID Groups + +### The Core Issue +When sending to LID-addressed groups, Baileys includes **the sender's own devices** in the sender key distribution list. WhatsApp's server rejects this with "Internal Server Error" → "not-acceptable". + +### Evidence (Post-Removal, 04:15:50 UTC) +```json +{ + "senderKeyJids": [ + "219232478433331:30@s.whatsapp.net", // Admin device ✅ + "22033668821180@s.whatsapp.net", // SENDER ITSELF ❌ + "22033668821180:87@s.whatsapp.net", // SENDER devices ❌ + "22033668821180:95@s.whatsapp.net", // SENDER devices ❌ + "22033668821180:98@s.whatsapp.net" // SENDER devices ❌ + ], + "msg": "sending new sender key" +} +``` +**Sender:** `6287777635515` (LID: `22033668821180`) +**Problem:** Baileys trying to send sender keys to sender's own JID/devices + +### Group Configuration +- **Addressing Mode:** LID +- **Participants (3):** + 1. `219232478433331@lid` → `6287791121908@s.whatsapp.net` (admin) + 2. `161663189794896@lid` → `6287785582370@s.whatsapp.net` (member) + 3. `22033668821180@lid` → `6287777635515@s.whatsapp.net` (member) + +## What We Tested + +### ✅ Proven +1. **Typing indicator works** - Connection is fine +2. **Receiving messages works** - Decryption succeeds (with retry receipts) +3. **Error is consistent** - Both instances (`5515`, `2370`) fail identically +4. **Sender key issue** - Baileys sends keys to sender's own devices in LID groups +5. **Not cached metadata** - Restart + metadata refresh didn't fix it + +### ❌ Disproven Theories +1. **Encryption session loss** - Re-adding to group didn't fix (attempted with `2370`) +2. **Stale group metadata** - Restart forced refresh, error persists +3. **Two instances conflict** - Removing `2370` didn't fix `5515` send +4. **Container state** - Full restart didn't resolve + +### 🔍 Key Evidence +**File:** `full_send_sequence.json` (04:08:33 UTC) +```json +{"jidsRequiringFetch":["219232478433331:30@s.whatsapp.net","161663189794896:22@s.whatsapp.net","22033668821180:95@s.whatsapp.net","22033668821180:98@s.whatsapp.net"],"msg":"fetching sessions"} +{"senderKeyJids":["219232478433331@s.whatsapp.net","219232478433331:30@s.whatsapp.net","161663189794896@s.whatsapp.net","161663189794896:22@s.whatsapp.net","22033668821180@s.whatsapp.net","22033668821180:87@s.whatsapp.net","22033668821180:95@s.whatsapp.net","22033668821180:98@s.whatsapp.net"],"msg":"sending new sender key"} +``` +Sender `22033668821180` trying to establish keys with **itself**. + +## CONFIRMED: Baileys Sender Key Bug in Group Messages + +### Root Cause (Code Analysis) +**File:** `node_modules/baileys/lib/Socket/messages-send.js` + +**The Bug (lines 339-372):** +```javascript +// Line 340: Gets ALL participants including sender +const participantsList = groupData.participants.map(p => p.id); + +// Line 350: Fetches devices for ALL participants (no exclusion) +const additionalDevices = await getUSyncDevices(participantsList, ...); + +// Lines 365-372: NO SENDER FILTERING - all devices go to senderKeyJids +for (const { user, device } of devices) { + senderKeyJids.push(jid); // ← SENDER'S OWN DEVICES INCLUDED +} +``` + +**Why Non-Group Works:** +In 1:1 messages (lines 407-419), Baileys properly separates meJids vs otherJids: +```javascript +const isMe = user === meUser; +if (isMe) { meJids.push(jid); } else { otherJids.push(jid); } +``` + +**Why Group Fails:** +Group message path has NO such filtering. All participant devices go into senderKeyJids. + +### Why LID Exacerbates +- `meId` = `6287777635515@s.whatsapp.net` (phone format) +- `participantsList[i]` = `22033668821180@lid` (LID format) +- JID format mismatch would break any comparison even if filtering existed + +## Fix Implemented + +### Patch Applied: Baileys senderKeyJids Filtering +**File:** `node_modules/baileys/lib/Socket/messages-send.js` (lines 363-380) +**Patch File:** `patches/baileys+6.7.19+lid-group-send.patch` + +```javascript +const senderKeyJids = []; +// [WIDGET-WORKS] Filter sender's own devices from senderKeyJids (LID group send fix) +// Same pattern as non-group path (line ~396) - fixes "not-acceptable" error +const { user: meUser } = jidDecode(meId); +const meLid = authState.creds?.me?.lid?.split(':')[0]?.split('@')[0]; +// ensure a connection is established with every device +for (const { user, device } of devices) { + // [WIDGET-WORKS] Skip sender's own devices + if (user === meUser || user === meLid) { + continue; + } + const jid = jidEncode(user, groupData?.addressingMode === 'lid' ? 'lid' : 's.whatsapp.net', device); + if (!senderKeyMap[jid] || !!participant) { + senderKeyJids.push(jid); + senderKeyMap[jid] = true; + } +} +``` + +### Upstream Research Summary +- **Baileys v6.7.17+**: Has LID group send fixes but NOT this specific senderKeyJids filtering +- **PR #1731**: Fixes sender key initialization, NOT distribution target filtering +- **Open Issues**: #1690 (Groups Sessions – LID), #1768 (LID bugs) - ongoing +- **Conclusion**: This bug is NOT fixed upstream; patch required + +### Re-applying After npm install +```bash +# Manual patch application +patch -p0 < patches/baileys+6.7.19+lid-group-send.patch +``` + +### Deployment Issues Encountered + +**Issue 1: Missing `patch` binary in Alpine Linux (Commit: 38b01376)** +- **Problem**: Docker build failed because `node:20-alpine` base image doesn't include `patch` utility +- **Solution**: Added `patch` to `apk` install list in Dockerfile line 4 +- **Fix**: `RUN apk update && apk add --no-cache git ffmpeg wget curl bash openssl patch` + +**Issue 2: Malformed patch file format (Commit: b1c030c3)** +- **Problem**: Initial patch had git diff headers but incomplete content, causing "malformed patch at line 19" error +- **Root Cause**: Patch file ended prematurely at line 21 without proper trailing context lines +- **Solution**: Regenerated patch with complete unified diff format including 3+ lines of trailing context +- **Result**: Patch file now properly shows lines 360-367 (original 8 lines) → 360-373 (new 14 lines) + +**Verification**: +```bash +# Test patch application locally before Docker build +cd /path/to/evolution-api +patch -p0 --dry-run < patches/baileys+6.7.19+lid-group-send.patch +``` + +## Alternative Options (Not Implemented) + +### Option 2: Override cachedGroupMetadata in Evolution +Use `option.cachedGroupMetadata` callback to return participants excluding sender. +**File:** `whatsapp.baileys.service.ts:1991-1997` + +### Option 3: Report Upstream +Open issue in WhiskeySockets/Baileys with this analysis. + +## References +- Perplexity research confirms this is NOT a known documented bug +- Baileys version: Check `package.json` for exact version +- Related: Baileys issue #1854 (group send crashes, different root cause) + +## Related Files +- `src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts:1977-2053` (sendMessage) +- `node_modules/baileys/lib/Socket/messages-send.js:696` (error origin) +- `docs/troubleshooting/08-12-25-indorama-lid-conversation-split.md` (LID normalization context) diff --git a/patches/baileys+6.7.19+lid-group-send.patch b/patches/baileys+6.7.19+lid-group-send.patch index 5584e773c..f4b9c8c11 100644 --- a/patches/baileys+6.7.19+lid-group-send.patch +++ b/patches/baileys+6.7.19+lid-group-send.patch @@ -1,20 +1,21 @@ --- a/node_modules/baileys/lib/Socket/messages-send.js +++ b/node_modules/baileys/lib/Socket/messages-send.js @@ -360,8 +360,14 @@ - meId - }); - const senderKeyJids = []; + data: bytes, + meId + }); + const senderKeyJids = []; - // ensure a connection is established with every device + // [WIDGET-WORKS] Filter sender's own devices from senderKeyJids (LID group send fix) + // Same pattern as non-group path (line ~396) - fixes "not-acceptable" error + const { user: meUser } = jidDecode(meId); + const meLid = authState.creds?.me?.lid?.split(':')[0]?.split('@')[0]; + // ensure a connection is established with every device - for (const { user, device } of devices) { + for (const { user, device } of devices) { + // [WIDGET-WORKS] Skip sender's own devices + if (user === meUser || user === meLid) { + continue; + } - const jid = jidEncode(user, groupData?.addressingMode === 'lid' ? 'lid' : 's.whatsapp.net', device); - if (!senderKeyMap[jid] || !!participant) { - senderKeyJids.push(jid); + const jid = jidEncode(user, groupData?.addressingMode === 'lid' ? 'lid' : 's.whatsapp.net', device); + if (!senderKeyMap[jid] || !!participant) { + senderKeyJids.push(jid); From 518f76d2eaf9dc3c6c2a84676c5bd19a910624f0 Mon Sep 17 00:00:00 2001 From: Wahyu Saputra Date: Thu, 11 Dec 2025 15:26:49 +0700 Subject: [PATCH 6/9] fix(patch): correct indentation in Baileys patch file Fixed indentation mismatch between patch file and actual Baileys source. The patch file must match the exact spacing (20 spaces for line 360-361, 16 spaces for line 362-363) in the original Baileys file. Previous version had incorrect spacing (13-17 spaces) causing patch application to fail with "malformed patch at line 19" error. --- patches/baileys+6.7.19+lid-group-send.patch | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/patches/baileys+6.7.19+lid-group-send.patch b/patches/baileys+6.7.19+lid-group-send.patch index f4b9c8c11..bc9f3c6d3 100644 --- a/patches/baileys+6.7.19+lid-group-send.patch +++ b/patches/baileys+6.7.19+lid-group-send.patch @@ -1,21 +1,21 @@ --- a/node_modules/baileys/lib/Socket/messages-send.js +++ b/node_modules/baileys/lib/Socket/messages-send.js @@ -360,8 +360,14 @@ - data: bytes, - meId - }); - const senderKeyJids = []; + data: bytes, + meId + }); + const senderKeyJids = []; - // ensure a connection is established with every device + // [WIDGET-WORKS] Filter sender's own devices from senderKeyJids (LID group send fix) + // Same pattern as non-group path (line ~396) - fixes "not-acceptable" error + const { user: meUser } = jidDecode(meId); + const meLid = authState.creds?.me?.lid?.split(':')[0]?.split('@')[0]; + // ensure a connection is established with every device - for (const { user, device } of devices) { + for (const { user, device } of devices) { + // [WIDGET-WORKS] Skip sender's own devices + if (user === meUser || user === meLid) { + continue; + } - const jid = jidEncode(user, groupData?.addressingMode === 'lid' ? 'lid' : 's.whatsapp.net', device); - if (!senderKeyMap[jid] || !!participant) { - senderKeyJids.push(jid); + const jid = jidEncode(user, groupData?.addressingMode === 'lid' ? 'lid' : 's.whatsapp.net', device); + if (!senderKeyMap[jid] || !!participant) { + senderKeyJids.push(jid); From 1eb65c2fcea428b410c5aed2ece12b8c6d840290 Mon Sep 17 00:00:00 2001 From: Wahyu Saputra Date: Thu, 11 Dec 2025 15:38:02 +0700 Subject: [PATCH 7/9] fix(patch): remove a/b prefixes for patch -p0 compatibility The patch file had git-style a/ and b/ prefixes which don't work with patch -p0. The patch utility would look for "a/node_modules/..." which doesn't exist, causing "can't find file to patch" error during build. Fixed by removing the prefixes so patch -p0 looks for the correct path: node_modules/baileys/lib/Socket/messages-send.js --- patches/baileys+6.7.19+lid-group-send.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/baileys+6.7.19+lid-group-send.patch b/patches/baileys+6.7.19+lid-group-send.patch index 5584e773c..e69922212 100644 --- a/patches/baileys+6.7.19+lid-group-send.patch +++ b/patches/baileys+6.7.19+lid-group-send.patch @@ -1,5 +1,5 @@ ---- a/node_modules/baileys/lib/Socket/messages-send.js -+++ b/node_modules/baileys/lib/Socket/messages-send.js +--- node_modules/baileys/lib/Socket/messages-send.js ++++ node_modules/baileys/lib/Socket/messages-send.js @@ -360,8 +360,14 @@ meId }); From 4ce427b8f96600d35b45d929f60a8c2897d24324 Mon Sep 17 00:00:00 2001 From: Wahyu Saputra Date: Thu, 11 Dec 2025 15:41:38 +0700 Subject: [PATCH 8/9] fix(patch): restore missing first context line (data: bytes,) --- patches/baileys+6.7.19+lid-group-send.patch | 1 + 1 file changed, 1 insertion(+) diff --git a/patches/baileys+6.7.19+lid-group-send.patch b/patches/baileys+6.7.19+lid-group-send.patch index e69922212..19b356b8b 100644 --- a/patches/baileys+6.7.19+lid-group-send.patch +++ b/patches/baileys+6.7.19+lid-group-send.patch @@ -1,6 +1,7 @@ --- node_modules/baileys/lib/Socket/messages-send.js +++ node_modules/baileys/lib/Socket/messages-send.js @@ -360,8 +360,14 @@ + data: bytes, meId }); const senderKeyJids = []; From a8af4b3f89c11ff02c5f755e6892a7c18f61c1bc Mon Sep 17 00:00:00 2001 From: Wahyu Saputra Date: Thu, 11 Dec 2025 15:42:07 +0700 Subject: [PATCH 9/9] docs: add Issue 3 - a/b prefix fix to deployment issues --- .../11-12-25-group-chat-not-acceptable-error.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/troubleshooting/11-12-25-group-chat-not-acceptable-error.md b/docs/troubleshooting/11-12-25-group-chat-not-acceptable-error.md index 62d607bcd..8a03ab695 100644 --- a/docs/troubleshooting/11-12-25-group-chat-not-acceptable-error.md +++ b/docs/troubleshooting/11-12-25-group-chat-not-acceptable-error.md @@ -151,12 +151,18 @@ patch -p0 < patches/baileys+6.7.19+lid-group-send.patch - **Solution**: Added `patch` to `apk` install list in Dockerfile line 4 - **Fix**: `RUN apk update && apk add --no-cache git ffmpeg wget curl bash openssl patch` -**Issue 2: Malformed patch file format (Commit: b1c030c3)** +**Issue 2: Malformed patch file format (Commits: b1c030c3, 518f76d2)** - **Problem**: Initial patch had git diff headers but incomplete content, causing "malformed patch at line 19" error - **Root Cause**: Patch file ended prematurely at line 21 without proper trailing context lines - **Solution**: Regenerated patch with complete unified diff format including 3+ lines of trailing context - **Result**: Patch file now properly shows lines 360-367 (original 8 lines) → 360-373 (new 14 lines) +**Issue 3: Git-style a/b prefixes incompatible with -p0 (Commits: 98276760, 4ce427b8)** +- **Problem**: Patch file had `--- a/node_modules/...` and `+++ b/node_modules/...` headers +- **Root Cause**: With `patch -p0`, the utility looks for literal path `a/node_modules/...` which doesn't exist +- **Solution**: Removed `a/` and `b/` prefixes so patch looks for correct path `node_modules/baileys/...` +- **Result**: Patch now compatible with `-p0` flag used in Dockerfile + **Verification**: ```bash # Test patch application locally before Docker build