feat(chatwoot-adapter): self-heal @lid contact names + self-hosting docs (#609)#25
Merged
Merged
Conversation
…ocs (#609) A 1:1 chat first seen from a privacy-id (@lid) sender is seeded in Chatwoot with the bare id as its name. Once a real WhatsApp display name arrives on a later message, the Chatwoot contact is renamed to it via a new ChatwootClient.updateContact — best-effort, only when the name actually changed, never for group contacts, and never overwriting a real name with a fallback. The last-synced name is stored on the chat link to avoid redundant renames. Docs: a Self-hosted Chatwoot section (public https/tunnel requirement, large upload 502/530 guidance) and the compatibility floor corrected to 0.8.3. Folded into the unreleased v0.2.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of rmyndharis/OpenWA#609 (P1). Folds into the unreleased v0.2.0.
Contact names self-heal for
@lidchatsA 1:1 chat first seen from a privacy-id (
@lid) sender has no display name yet, so it's created in Chatwoot with the bare id. Once a real WhatsApppushNamearrives on a later message, the Chatwoot contact is renamed to it, so agents see a human name instead of an id — the same outcome a manual name-resync script produces, done inline.ChatwootClient.updateContact(contactId, name)(PUT /contacts/{id}).name; the refresh fires only when the name actually changed, so there's at most one rename per real change.pushName/namequalifies — asenderPhone/JID fallback never overwrites a real name.Docs
baseUrlmust be a publichttpsURL (LAN/localhost/host.docker.internalare rejected by the SSRF guard), how to expose a self-hosted instance via a tunnel, and how to avoid 502/530 on large media uploads.Not included (tracked in #609)
History backfill and an inbound retry/dead-letter queue are deferred: both need capabilities the plugin sandbox doesn't expose (reading message history; durable background work). They'd require a host-side change rather than an adapter-only one.
Tests
New:
updateContactPUTs the name; an@lidcontact is renamed once a realpushNamearrives; no rename when the stored name already matches; a group contact is never renamed from a member's name. Full suite green (192 tests across all plugins),tsc --noEmitclean, plugin packages, catalog up to date.