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
| File | Purpose |
| ------ | --------- |
/var/www/comercialrs/src/components/automations/AutomationsPanel.tsx | UAZAPI config UI, "Testar conexΓ£o" button |
/var/www/comercialrs/src/components/settings/CrmSalesTab.tsx | CRM 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:
- - Is the instance status "connected"?
- - Any error logs in UAZAPI dashboard?
- - Has the number been banned before this test?
- - The test function is working correctly (it sent a message, got banned as result)
- - The ban is from Meta, not from the code
If number already banned: