Repository navigation
feat(whatsapp): read routing roles and keep ownership on partner template echoes - #1668
Merged
Merged
Conversation
viethung0o0
marked this pull request as ready for review
November 8, 2026 08:23
viethung0o0
force-pushed
the
feat/whatsapp-routing-roles
branch
from
November 8, 2026 08:24
cbc5416 to
3b644d0
Compare
hello-jackytruong
referenced
this pull request
in hello-jackytruong/ChatWorkAI
Nov 22, 2026
…late echoes (#1668)
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.
Summary
Aligns WhatsApp Conversation Routing with Meta's partner guides: a partner's template no longer takes our thread, Meta's non-owner send rejection is recognised, and each number now shows the routing roles Meta assigned to this app.
Changes
standbyis stored but no longer flips the thread to standby (templates never change ownership); a free-form echo still does131070(Service send without ownership) is a permanent refusal: no retry, the thread is marked standby and the composer locksGET /{phone_number_id}/routing_rolesclient; everythread_controlcall logs Meta'srequest_idorfbtrace_idIntegrationWhatsapp.routingRolessnapshot ({ enabled, roles, isStandby, checkedAt }), stored only when newer than what is already theresyncRoutingRoles/findRoutingRoles/findRoutingRolesByInboxon the WhatsApp integration servicewhatsappChannels.getRoutingRolesandwhatsappChannels.syncRoutingRoles(whatsapp-channels routing-roles list|sync)Test plan
pnpm lintpnpm check-typespnpm testandpnpm --filter worker test:db(new:whatsapp-conversation-routing.chain,conversation-routing-api,error-mapper-thread-control,integration-whatsapp-routing-roles.service,routing-roles-section)20261108054403_whatsapp_routing_rolesbefore applying it