link-stack/apps/bridge-worker/tasks
Darren Clarke 3d8f794cab Add user ID support for Baileys 7 LIDs and Signal UUIDs
Baileys 7 uses LIDs (Linked IDs) instead of phone numbers in remoteJid for
some messages. This caused messages to be matched to wrong tickets because
the LID was used as the sender identifier. This commit adds proper support
for both phone numbers and user IDs across WhatsApp and Signal channels.

Changes:

Database:
- Add migration for whatsapp_user_id and signal_user_id fields on users table

Zammad controllers:
- Update user lookup with 3-step fallback: phone → dedicated user_id field →
  user_id in phone field (legacy)
- Store user IDs in dedicated fields when available
- Update phone field when we receive actual phone number for legacy records
- Fix redundant condition in Signal controller

Bridge services:
- Extract both phone (from senderPn/participantPn) and LID (from remoteJid)
- Send both identifiers to Zammad via webhooks
- Use camelCase (userId) in bridge-whatsapp, convert to snake_case (user_id)
  in bridge-worker for Zammad compatibility

Baileys 7 compliance:
- Remove broken loadAllUnreadMessages() call (removed in Baileys 7)
- Return descriptive error directing users to use webhooks instead

Misc:
- Add docs/ to .gitignore
2026-01-15 13:08:56 +01:00
..
common WhatsApp/Signal/Formstack/admin updates 2025-11-21 14:55:28 +01:00
facebook WhatsApp/Signal/Formstack/admin updates 2025-11-21 14:55:28 +01:00
formstack WhatsApp/Signal/Formstack/admin updates 2025-11-21 14:55:28 +01:00
signal Add user ID support for Baileys 7 LIDs and Signal UUIDs 2026-01-15 13:08:56 +01:00
voice WhatsApp/Signal/Formstack/admin updates 2025-11-21 14:55:28 +01:00
whatsapp Add user ID support for Baileys 7 LIDs and Signal UUIDs 2026-01-15 13:08:56 +01:00
check-group-membership.ts WhatsApp/Signal/Formstack/admin updates 2025-11-21 14:55:28 +01:00
fetch-signal-messages.ts Add user ID support for Baileys 7 LIDs and Signal UUIDs 2026-01-15 13:08:56 +01:00