πŸ“„ SKILL.md

← Vault

name: comercialrs-whatsapp-uazapi-debug

description: Debug WhatsApp ban on UAZAPI "Testar conexΓ£o" in Comercial RS app

category: devops


Comercial RS β€” WhatsApp UAZAPI Ban Debug

Project Structure (VPS)

`

/var/www/documentos/ β†’ DocCorretor (Documents app, port 3010)

β”œβ”€β”€ deploy-vps/ β†’ TanStack Start (Cloudflare Workers build)

β”œβ”€β”€ deploy-vps-nodejs/ β†’ TanStack Start (Node.js build)

β”œβ”€β”€ deploy-nodejs/

β”œβ”€β”€ uploads/ β†’ Local file storage

/var/www/comercialrs/ β†’ Comercial Flow CRM (VPS, root /var/www/comercialrs/dist)

β”œβ”€β”€ src/ β†’ React frontend source

β”œβ”€β”€ supabase/

β”‚ └── functions/ β†’ Edge Functions source (NOT deployed here)

└── dist/ β†’ Built static files (nginx root)

/etc/nginx/sites-enabled/

β”œβ”€β”€ comercialrs.rochasalesseguros.com.br β†’ Static SPA, proxies to Supabase Cloud

β”œβ”€β”€ documentos.rochasalesseguros.com.br β†’ Node.js app on port 3010

β”œβ”€β”€ uazapi.rochasalesseguros.com.br

β”œβ”€β”€ chatwoot

└── n8n.rochasalesseguros.com.br

`

Key Files

FilePurpose
---------------
/var/www/comercialrs/src/components/automations/AutomationsPanel.tsxUAZAPI config UI, "Testar conexΓ£o" button
/var/www/comercialrs/src/components/settings/CrmSalesTab.tsxCRM sync config (different feature)
Supabase Edge Function: test-webhook (v2, ACTIVE)Backend for "Testar conexΓ£o" β€” sends real test message
Supabase Edge Function: uazapi-contacts (v3)Loads contacts from UAZAPI
Supabase Edge Function: uazapi-status-webhook (v3)Webhook status handler

The "Testar ConexΓ£o" Flow

1. User clicks "Testar conexΓ£o" in AutomationsPanel (UAZAPI provider)

2. Frontend calls supabase.functions.invoke('test-webhook', { body })

3. Body sent:

`json

{

"provider": "uazapi",

"uazapi_url": "https://sua-instancia.uazapi.com",

"uazapi_token": "TOKEN",

"uazapi_phone": "5511999999999",

"recipients": [{ "phone": "5511999999999", "name": "Nome" }]

}

`

4. Edge Function test-webhook sends a real WhatsApp message to test delivery

5. If number is new/restricted β†’ Meta bans it instantly

How to Download Edge Function Code

`bash

Legacy download (for functions deployed with older CLI)

supabase functions download test-webhook --project-ref dauftiqcvgaydddoxqhh --legacy-bundle

If invalid eszip v2 error: function was deployed with CLI < 1.120.0

Need to find the actual deployed code some other way (logs, inspect)

`

Diagnosing the Ban

Likely causes (NOT code bugs):

1. Number too new β€” WhatsApp Business takes time to stabilize

2. Repeated testing = spam behavior β†’ Meta ban

3. UAZAPI instance reconnecting automatically β†’ triggers Meta security

4. Multiple WhatsApp sessions on same number

5. Instance webhook misconfigured

Check UAZAPI panel first: