iachat/app/javascript/dashboard/i18n/locale/en
Muhsin Keloth 66cfef9298
feat: Add WhatsApp health monitoring and self-service registration completion (#12556)
Fixes
https://linear.app/chatwoot/issue/CW-5692/whatsapp-es-numbers-stuck-in-pending-due-to-premature-registration


###  Problem  
Multiple customers reported that their WhatsApp numbers remain stuck in
**Pending** in WhatsApp Manager even after successful onboarding.

- Our system triggers a **registration call**
(`/<PHONE_NUMBER_ID>/register`) as soon as the number is OTP verified.
- In many cases, Meta hasn’t finished **display name
review/provisioning**, so the call fails with:

  ```
  code: 100, error_subcode: 2388001
  error_user_title: "Cannot Create Certificate"
error_user_msg: "Your display name could not be processed. Please edit
your display name and try again."
  ```

- This leaves the number stuck in Pending, no messaging can start until
we manually retry registration.
- Some customers have reported being stuck in this state for **7+
days**.

###  Root cause  
- We only check `code_verification_status = VERIFIED` before attempting
registration.
- We **don’t wait** for display name provisioning (`name_status` /
`platform_type`) to be complete.
- As a result, registration fails prematurely and the number never
transitions out of Pending.

### Solution  

#### 1. Health Status Monitoring  
- Build a backend service to fetch **real-time health data** from Graph
API:
  - `code_verification_status`  
  - `name_status` / `display_name_status`  
  - `platform_type`  
  - `throughput.level`  
  - `messaging_limit_tier`  
  - `quality_rating`  
- Expose health data via API
(`/api/v1/accounts/:account_id/inboxes/:id/health`).
- Display this in the UI as an **Account Health tab** with clear badges
and direct links to WhatsApp Manager.

#### 2. Smarter Registration Logic  
- Update `WebhookSetupService` to include a **dual-condition check**:  
  - Register if:  
    1. Phone is **not verified**, OR  
2. Phone is **verified but provisioning incomplete** (`platform_type =
NOT_APPLICABLE`, `throughput.level = NOT_APPLICABLE`).
- Skip registration if number is already provisioned.  
- Retry registration automatically when stuck.  
- Provide a UI banner with complete registration button so customers can
retry without manual support.

### Screenshot
<img width="2292" height="1344" alt="CleanShot 2025-09-30 at 16 01
03@2x"
src="https://github.com/user-attachments/assets/1c417d2a-b11c-475e-b092-3c5671ee59a7"
/>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2025-10-02 11:25:48 +05:30
..
advancedFilters.json feat(v4): Add new conversation filters component (#10502) 2024-11-27 20:05:54 -08:00
agentBots.json feat: Ability to reset api_access_token (#11565) 2025-05-29 14:42:13 +05:30
agentMgmt.json fix: Translate "None" option in agent assignment dropdown (#11060) 2025-03-11 14:49:27 -07:00
attributesMgmt.json fix: Translate Priority and Messages types in Automations and Macros (#11741) 2025-07-08 12:40:40 +05:30
auditLogs.json feat: Add conversation delete feature (#11677) 2025-06-05 15:53:17 -05:00
automation.json feat: Add support for labels in automations (#11658) 2025-09-18 14:17:54 +05:30
bulkActions.json chore: update interpolation syntax for i18n files (#10198) 2024-10-07 11:12:40 -07:00
campaign.json feat: WhatsApp campaigns (#11910) 2025-07-16 09:04:02 +05:30
cannedMgmt.json feat: Vite + vue 3 💚 (#10047) 2024-10-02 00:36:30 -07:00
chatlist.json feat: Adds support for telegram contact sharing (#10841) 2025-02-06 14:23:08 +05:30
components.json chore: Add "Coming Soon" overlay to voice channel selector (#11835) 2025-06-30 14:30:09 +05:30
contact.json feat: Allow creating contact notes (#12494) 2025-09-23 18:53:00 +05:30
contactFilters.json feat: Ability to filter contact based on labels (#12343) 2025-09-02 12:35:18 +05:30
contentTemplates.json feat: Add twilio content templates (#12277) 2025-08-29 16:13:25 +05:30
conversation.json feat: allow quoted email thread in reply (#12545) 2025-09-30 17:47:09 +05:30
csatMgmt.json feat: more CSAT filters (#7038) 2023-05-18 22:50:46 +05:30
customRole.json feat: Vite + vue 3 💚 (#10047) 2024-10-02 00:36:30 -07:00
datePicker.json feat: Custom date picker (#9247) 2024-04-29 14:43:57 +05:30
emoji.json feat: Adds the ability to set an emoji for help center category (#8111) 2023-10-20 13:52:30 +05:30
general.json feat: SAML feedback changes [CW-5666] (#12511) 2025-09-24 16:07:07 +05:30
generalSettings.json fix: Translate Priority and Messages types in Automations and Macros (#11741) 2025-07-08 12:40:40 +05:30
helpCenter.json feat: Allow detaching help center widget (#12459) 2025-09-17 22:27:50 +05:30
inbox.json feat: add reauth flow for wa embedded signup (#11940) 2025-08-08 01:48:45 +05:30
inboxMgmt.json feat: Add WhatsApp health monitoring and self-service registration completion (#12556) 2025-10-02 11:25:48 +05:30
index.js feat: Add the frontend support for MFA (#12372) 2025-09-18 21:16:06 +05:30
integrationApps.json chore: Update settings to match the new design (#11084) 2025-03-14 14:28:14 +05:30
integrations.json feat: allow searching captain responses [CW-5631] (#12463) 2025-09-18 14:44:56 +05:30
labelsMgmt.json feat: Vite + vue 3 💚 (#10047) 2024-10-02 00:36:30 -07:00
login.json feat: Form validation message for password input (#11705) 2025-09-29 11:12:04 +05:30
macros.json fix: Translate Priority and Messages types in Automations and Macros (#11741) 2025-07-08 12:40:40 +05:30
mfa.json feat: Add the frontend support for MFA (#12372) 2025-09-18 21:16:06 +05:30
report.json feat: label reports overview (#11194) 2025-06-11 14:35:46 +05:30
resetPassword.json feat: Support dark mode in login pages (#7420) 2023-07-01 07:49:52 +05:30
search.json feat: allow searching articles in omnisearch (#11558) 2025-05-28 13:50:50 +05:30
setNewPassword.json feat: update product copy [CWM-45] (#6372) 2023-04-25 22:02:15 -07:00
settings.json feat: Add the frontend support for MFA (#12372) 2025-09-18 21:16:06 +05:30
signup.json feat: Form validation message for password input (#11705) 2025-09-29 11:12:04 +05:30
sla.json feat: Update the design for integration page (#9825) 2024-07-24 16:35:40 -07:00
teamsSettings.json chore: update interpolation syntax for i18n files (#10198) 2024-10-07 11:12:40 -07:00
webhooks.json Feature: As a admin, I should be able to add webhooks to account (#572) 2020-02-29 17:43:49 +05:30
whatsappTemplates.json feat: Add media_name support for WhatsApp templates document files (#12462) 2025-09-18 15:25:31 +05:30