Skip to content

feat(whatsapp): handle account disconnects and update the connect screen - #1653

Merged
viethung0o0 merged 1 commit into
mainfrom
feat/whatsapp-account-lifecycle
Nov 5, 2026
Merged

viethung0o0 merged 1 commit into
mainfrom
feat/whatsapp-account-lifecycle

Conversation

@viethung0o0

@viethung0o0 viethung0o0 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • WhatsApp connect screen: "Continue", plus a "Connect an existing WhatsApp Business Account" option that reveals "Manual connect". "Transfer phone" is removed (Meta ends it on 2026-11-16); old requests that still send it are rejected.
  • Connect, reconnect and CAPI all use Embedded Signup v4 from one default, so moving to a newer version is a single entry.
  • Meta's account_update events are now handled: a number being moved to another device is held as "reconnecting", and a removed or disconnected account needs reconnecting, releases its quota and stops its coexist sync.
  • Events arriving late or twice are ignored, and each route only updates the numbers connected through its own Meta app.
  • The WhatsApp channel list shows the status with a Reconnect button, and /v1/connections returns the new reason.
  • Inbox and template sends wait (about 12 minutes at most) while an account is reconnecting. Flow steps and chat messages keep their current behavior.
  • The coexist history sync accepts Meta's documented request_id response as well as the old one.
  • Contacts without a name show their email or phone number in the inbox, conversation header and contact list (display only, nothing is saved).
  • Includes a migration (two nullable Connection columns, a wabaId index, one new status reason). It is not applied anywhere yet.

Validation

  • pnpm lint
  • check-types for utils, database, business, worker-config, whatsapp, worker and builder
  • vitest for whatsapp, business, utils, worker-config, worker and builder, plus the database tests that run against Postgres
  • Not yet tried in the browser or with a real Meta dialog
  • Needs before release: run the migration, re-subscribe the WhatsApp webhook fields (script plus "Fix" on each credential), and test the connect-existing flow before 2026-11-16
  • Non-Vietnamese locales still use English text for the new status messages

@github-actions github-actions Bot added the feature New feature or request label Nov 5, 2026
@viethung0o0
viethung0o0 force-pushed the feat/whatsapp-account-lifecycle branch from 695a1cc to b5c6235 Compare November 5, 2026 03:09
@viethung0o0
viethung0o0 marked this pull request as ready for review November 5, 2026 03:26
@viethung0o0
viethung0o0 merged commit 9563a72 into main Nov 5, 2026
14 checks passed
hello-jackytruong referenced this pull request in hello-jackytruong/ChatWorkAI Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants