Secure digital helpdesk platform
Find a file
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
apps Add user ID support for Baileys 7 LIDs and Signal UUIDs 2026-01-15 13:08:56 +01:00
docker Build updates 2026-01-14 11:01:31 +01:00
packages Add user ID support for Baileys 7 LIDs and Signal UUIDs 2026-01-15 13:08:56 +01:00
scripts WhatsApp/Signal/Formstack/admin updates 2025-11-21 14:55:28 +01:00
.dockerignore metamigo-frontend: build and run in docker 2023-06-06 07:10:28 +00:00
.editorconfig Align node and npm versions to fix overrides 2023-06-07 10:25:53 +00:00
.gitignore Add user ID support for Baileys 7 LIDs and Signal UUIDs 2026-01-15 13:08:56 +01:00
.gitlab-ci.yml Fix Docker-in-Docker connectivity for GitLab CI 2026-01-13 15:36:25 +01:00
.nvmrc Update Baileys to 7RC 2026-01-14 11:00:41 +01:00
LICENSE.md Begin addon reorganization 2023-05-03 10:36:37 +00:00
package.json Bump version to 3.4.0-beta.4 2026-01-14 11:33:11 +01:00
pnpm-lock.yaml Regenerate pnpm-lock.yaml after rebase 2026-01-14 11:02:11 +01:00
pnpm-workspace.yaml WhatsApp/Signal/Formstack/admin updates 2025-11-21 14:55:28 +01:00
README.md Dummy commit to make CI run again 2025-11-23 10:31:03 +00:00
turbo.json WhatsApp/Signal/Formstack/admin updates 2025-11-21 14:55:28 +01:00

CDR Link

CDR Link is a simple & streamlined helpdesk that lets you tag, assign and respond to your tickets. It is developed by the Center for Digital Resilience and powered by Zammad.

Key differences between CDR Link and a standard Zammad installation:

  • In addition to the full Zammad interface, CDR Link also provides a simplified 'shell' interface that focuses on the most-commonly-used functionality.
  • Additional channels to communicate with users, including Signal, Whatsapp & Twilio voice messaging.
  • More stringent privacy defaults: ticket data is never sent over email and calls to third-party services are restricted.

Developing

This is a monorepo that contains CDR Link and several supporting applications and libraries. It also includes Dockerfiles to build all of the other containers required for an installation. By tagging our own versions of these dependencies, we can make sure that different versions of the supporting containers all work together and are updated in sync.

We use Turborepo to manage development and building of the packages. To get started:

  • npm install in the root directory
  • turbo build to build all packages

To run a single package:

  • turbo dev --filter @link-stack/link