Skip to content

fix(whatsapp): resolve LID sender IDs to phone numbers in bridge payload (#3219 salvage) - #56999

Merged
teknium1 merged 2 commits into
mainfrom
salvage/3219-whatsapp-lid
Jul 2, 2026
Merged

teknium1 merged 2 commits into
mainfrom
salvage/3219-whatsapp-lid

Conversation

@teknium1

@teknium1 teknium1 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

WhatsApp LID sender IDs (@lid) are now resolved to phone numbers in the bridge message payload, so phone-based allowlists (WHATSAPP_ALLOWED_USERS) match senders whose messages arrive under Meta's anonymized LID addressing.

Salvage of #3219 — commit authored by Roger Smith (@r0gersm1th), PR by @ajmeese7; cherry-picked onto current main with commit authorship preserved (the PR's two other commits were merge-from-main noise).

Changes

  • scripts/whatsapp-bridge/bridge.js: resolve senderId/senderName/chatName through the existing lidToPhone map before building the event payload
  • scripts/release.py: AUTHOR_MAP entry

Validation

Result
node --check bridge.js syntax ok
lidToPhone map + rebuild-on-creds-update already present on main; change slots into current const event block unchanged

Infographic

infographic

Nous Research

@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery platform/whatsapp WhatsApp Business adapter P2 Medium — degraded but workaround exists sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages labels Jul 2, 2026
…age payload

WhatsApp has migrated to Linked Identity Device (LID) format for user
IDs (e.g. 244645917392975@lid instead of 18505551234@s.whatsapp.net).

The bridge already resolves LIDs to phone numbers for its own allowlist
check via buildLidMap(), but the senderId field in the message payload
sent to the gateway still contained the raw LID. This caused the
gateway's WHATSAPP_ALLOWED_USERS check to reject all messages as
unauthorized, since the LID numbers don't match the phone numbers in
the allowlist.

Fix: resolve LID → phone in the senderId, senderName, and chatName
fields of the event payload before sending to the gateway, using the
existing lidToPhone mapping.
@teknium1
teknium1 force-pushed the salvage/3219-whatsapp-lid branch from bd6db28 to 0fbac26 Compare July 2, 2026 11:36
@teknium1
teknium1 force-pushed the salvage/3219-whatsapp-lid branch from 0fbac26 to a9922d9 Compare July 2, 2026 11:37
@teknium1
teknium1 merged commit 44650a5 into main Jul 2, 2026
31 checks passed
@teknium1
teknium1 deleted the salvage/3219-whatsapp-lid branch July 2, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/whatsapp WhatsApp Business adapter sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants