From 7b364aff119d313ef87d572b9fc59290a49f0209 Mon Sep 17 00:00:00 2001 From: ngqile Date: Wed, 2 Dec 2026 12:10:39 +0800 Subject: [PATCH] docs(whatsapp): record the live check Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs --- docs/deployment.md | 2 +- openspec/changes/add-whatsapp-inbox/tasks.md | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/deployment.md b/docs/deployment.md index 742d1c6..23e516b 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -382,7 +382,7 @@ data: - Lists and chats refresh by polling (30 s for the list and the badge, 10 s for an open chat), not instantly. - Meta keeps media for about 30 days; older photos and documents show "Media expired". - The chat list shows the contact's WhatsApp name and number, not the lead's name; the chat itself links to the lead. - - For a WhatsApp admin the sidebar badge counts unread messages in every chat they can see, not only their own. + - For a WhatsApp admin the sidebar badge counts unread messages in every chat they can see, not only their own. For a super admin it counts every company, whichever company is picked in the header. - A super admin who syncs templates with no company picked gets nothing back; pick the company first (the inbox does this by itself when syncing from a chat). - A send that Meta accepts without a message id is stored as failed. A send that never gets an answer stays "Sending"; nothing sweeps it. - Media is streamed with `;charset=UTF-8` added to its content type; browsers ignore it. diff --git a/openspec/changes/add-whatsapp-inbox/tasks.md b/openspec/changes/add-whatsapp-inbox/tasks.md index 008f7e8..d3e5d8e 100644 --- a/openspec/changes/add-whatsapp-inbox/tasks.md +++ b/openspec/changes/add-whatsapp-inbox/tasks.md @@ -82,7 +82,7 @@ Verify commands: - [x] 6.1 `docs/deployment.md`: the environment per company, the SQL order, the Meta setup steps (webhook URL, verify token, `messages` subscription, templates), and granting the modules. - Also: the webhook's own Traefik route, the role pairing, the go-live limits, the 503 behaviour, and the client-address note for rate limits. -- [ ] 6.2 Live check on the local stack with the mock: +- [x] 6.2 Live check on the local stack with the mock: - inbound for INS and CV, kept apart; - an unknown sender; - automatic owner, and manual reassign that sticks; @@ -95,4 +95,16 @@ Verify commands: - the unread badge. Use Playwright at 1280 and 360 px. + - Done 2026-12-02 as super admin, with `BO_WHATSAPP` granted to a test role for the check and revoked after. All items passed: + - INS and CV lists apart under the company picker; + - an unknown sender with no lead link; + - the automatic owner through the counter notify; a salesperson without `BO_WHATSAPP` leaves the chat unassigned; + - a manual owner that stays when the salesperson changes; + - disabling that owner sends the chat to Unassigned and clears the manual flag; + - window closed (last inbound aged in the DB): template-only footer; + - the template picker keeps Send disabled while a parameter is empty; + - start from an event lead row opens the new chat; + - a failed send shows "Not delivered: Message undeliverable (131026)" with Retry; + - the unread badge. + - Earlier in 5.1: media, ticks and the 360 px layout. The staff-only view (Mine only, no owner select) is covered by tests only: no staff password was available, and staff passwords were not reset for it. The test rows were removed. - [ ] 6.3 The owner's manual click-every-button e2e on a production build covers the inbox too (record the result here).