Messages addressed to `@s.whatsapp.net` never deliver after re-pairing (status ERROR), while `@lid` works
Mantenedores costumam responder em até 5 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 45/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Pouca atividade
- Stack de tecnologia
- postgresql, redis, typescript
Direção de pesquisa
Start with POST /message/sendText/{instance}, MessageUpdate handling, and the Baileys LIDMappingStore.getLIDsForPNs and signalStorage.resolveLIDSignalAddress paths described in the issue. Reproduce the phone-number and @lid comparison across a re-pair, then inspect the mapping and USync trace output. Done means phone-number sends deliver after re-pairing without ending in ERROR, with the existing LID behavior preserved.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Summary
After re-pairing an instance, every message sent with a phone number as the
recipient ends in ERROR in MessageUpdate and is never delivered. The same
instance, at the same moment, delivers normally when the recipient is addressed
by LID. Before the re-pairing, the very same instance delivered fine to phone
numbers.
This is not a banned/limited number: sending manually from the WhatsApp app of
the sender phone to a fresh recipient works (see "What we ruled out").
Environment
| Image | evoapicloud/evolution-api:v2.3.7 (built 2025-12-05) |
| Evolution | 2.3.7 |
| Baileys | 7.0.0-rc.9 |
| Database | PostgreSQL (DATABASE_PROVIDER=postgresql) |
| Cache | Redis, CACHE_REDIS_ENABLED=true, CACHE_REDIS_SAVE_INSTANCES=true |
| Instance settings | syncFullHistory: false, groupsIgnore: true, rejectCall: true |
| Pairing | QR code |
Steps to reproduce
- Pair an instance by QR.
- Send messages with
POST /message/sendText/{instance}using
{"number": "<E.164 digits>", "text": "..."}. They deliver. - Log out and re-pair the same instance (any reason — we hit it after
recreating the container). - Send again, same endpoint, same payload shape, to recipients that have never
messaged the sender.
Expected: delivery, as before the re-pairing.
Actual: the API returns 200 with status: PENDING and a key.id; the
message shows up in the manager; and MessageUpdate records ERROR. Nothing
arrives.
Evidence
Counting the whole instance history, split at the moment of the re-pairing.
Recipients are distinct people across many area codes; the "after" batch is a
single campaign of 46 messages.
| address | outcome | count | |
|---|---|---|---|
| before | phone (@s.whatsapp.net) |
DELIVERY_ACK | 7 |
| before | phone | SERVER_ACK | 6 |
| before | phone | READ | 3 |
| before | phone | ERROR | 10 |
| before | LID (@lid) |
DELIVERY_ACK + READ | 4 |
| after | phone | ERROR | 62 |
| after | phone | any success | 0 |
| after | LID | DELIVERY_ACK / READ / SERVER_ACK | 3 |
The LID sends in the "after" row were made minutes apart from failing phone
sends, on the same process, to the same person — one address works, the other
does not.
Two more observations that may help:
- Incoming messages from that same person arrive with
remoteJidas
<id>@lid, never as<phone>@s.whatsapp.net. - A send that eventually delivered recorded
ERROR,ERROR, then
DELIVERY_ACK— a retry path exists and sometimes succeeds, but for
recipients with no prior conversation it never did.
What we ruled out
- Number health / spam restriction. Sending by hand, from the WhatsApp app
of the sender number to a recipient that never talked to it, delivers
normally. The account is fine. - Credentials / connectivity.
connectionStatusisopen, the API accepts
every request, and/chat/whatsappNumbersanswers correctly for the same
numbers that fail to receive (exists: true). - Disk / temp files. Host at 39% usage; container
/tmpclean. - Recipient-specific issue. The failing batch spans 46 different recipients
in unrelated area codes.
Where we think it goes wrong
In baileys 7.0.0-rc.9, LIDMappingStore.getLIDsForPNs looks up the cache, then
keys.get('lid-mapping', …), and only then falls back to USync via
pnToLIDFunc. signalStorage.resolveLIDSignalAddress uses that mapping to pick
the Signal session address on loadSession/storeSession.
Our reading is that the mapping is lost with the re-pairing and is not rebuilt
for recipients that never messaged the instance, so encryption keeps using the
PN address and the server rejects it. We could not confirm this from logs
because LOG_BAILEYS=error hides the trace line
(No LID mapping found for PN user …; batch getting from USync), and raising it
requires a restart, which on a production instance costs another pairing.
Happy to run any diagnostic that helps — we have a reproducible environment and
the full Message/MessageUpdate history.
Impact
Any deployment using phone numbers as recipients — which is the documented and
natural way to use sendText — silently stops delivering after a re-pair. The
API keeps answering 200, so monitoring based on the HTTP response reports
success while nothing reaches anyone. In our case a campaign of 46 messages
reported "sent" and delivered zero.
- Linguagem predominante
- TypeScript
- Estrelas
- 9.9k
- Forks
- 7.4k
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de evolution-foundation/evolution-api
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
evolution-foundation/evolution-api#2723 ·
Mantenedores costumam responder em até 5 dias
-
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 88/100
evolution-foundation/evolution-api#2704 ·
Mantenedores costumam responder em até 5 dias
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
evolution-foundation/evolution-api#2702 · 2 comentários · 3 reações ·
Mantenedores costumam responder em até 5 dias
-
[BUG] Cloud API: a single unknown wamid in a `statuses` batch silently drops the whole batch (`return` instead of `continue`)Talvez já em andamento @vin1i assumiu há 60 dias. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
evolution-foundation/evolution-api#2700 · 1 comentário ·
Mantenedores costumam responder em até 5 dias
-
[BUG] Chatwoot integration duplicates messages when a device re-delivers the same key.id — getExistingSourceIds exists but is never called on the live pathTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
evolution-foundation/evolution-api#2675 ·
Mantenedores costumam responder em até 5 dias
Todas as issues de evolution-foundation/evolution-api
Issues semelhantes
-
[Bug]: Pen taps on sidebar rows start a drag and lose their clickTalvez já em andamento @makhnatkin assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
b310-digital/teammapper#1515 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 79/100
puckeditor/puck#1884 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
outline/outline#14378 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
nicobailon/pi-web-access#642 ·
Mantenedores costumam responder em até 1 dia