Repository navigation
Conversation
The runtime config var NODE_OPTIONS=--max-old-space-size=384 (set to contain R14 on the 512MB dyno) leaks into the Heroku Node buildpack build phase, capping tsc+tsup at 384MB and causing a JS heap OOM. Override NODE_OPTIONS inline in the build script so the build gets 2048MB; start:prod keeps the inherited 384MB ceiling at runtime. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…k fetchInstances token Three contained, verified fixes for open upstream issues that affect the Radar de Ingressos (inbound reading) and SafetySwap (outbound delivery), all on the live messages.upsert / fetch path, with src diverging from upstream. - evolution-foundation#2773: unwrap ephemeralMessage / viewOnce envelopes before content handling. Baileys delivers disappearing/view-once messages with the real content nested; Evolution never called normalizeMessageContent on the live path, so getContentType() reported `ephemeralMessage`, the text->conversation flattening and isMedia checks never fired, and the message was stored/webhooked with its text buried. Any offer sent in a chat with disappearing messages on was invisible to the radar. - evolution-foundation#2705: getMessage() returned { conversation: '' } on a DB miss. Baileys treats any truthy return as "found" and relays the empty envelope to satisfy a retry, burning one attempt and leaving the recipient stuck on "Waiting for this message" forever. Return undefined instead so Baileys falls through to its resend path. (full=true already returned undefined.) - evolution-foundation#2677: fetchInstances returned the instance `token` (auth hash) unconditionally; AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES was only ever applied to the webhook apiKey field, never this HTTP response. Mask the token when the flag is false. Real exposure on a shared multi-instance server. Validated with tsc --noEmit, eslint and npm run build. Baileys-coupled paths (evolution-foundation#2773, evolution-foundation#2705) still want a live smoke test on a real instance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Owner
Author
|
Conteúdo (os 3 fixes: evolution-foundation#2773, evolution-foundation#2705, evolution-foundation#2677) já incorporado na |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Três correções contidas e verificadas no código deste fork, no caminho ao vivo
messages.upsert/ fetch, que afetam o Radar de Ingressos (leitura de entrada) e o SafetySwap (entrega de envio).O que entra (3 issues confirmadas)
1. evolution-foundation#2773 — mensagens temporárias (disappearing) somem para o consumidor · Radar
O Baileys entrega mensagens temporárias / view-once com o conteúdo real aninhado em
ephemeralMessage.message; ele só desembrulha sob demanda vianormalizeMessageContent, que o Evolution nunca chama no caminho ao vivo. Resultado:getContentType()reportaephemeralMessage, o achatamentoextendedTextMessage → conversatione os checks deisMedianão disparam, e a mensagem chega ao webhook/banco com o texto/mídia enterrados. Toda oferta postada num grupo com mensagens temporárias ligadas era invisível ao radar.Fix: desembrulhar
ephemeralMessage/viewOnce*logo após o guard deeditedMessage(que continua tratado à parte), antes de qualquer manuseio de conteúdo.2. evolution-foundation#2705 — getMessage vazio no miss trava a entrega em "Waiting for this message" · SafetySwap
getMessage()devolvia{ conversation: '' }quando a linha não existia no banco. O Baileys trata qualquer retorno truthy como "mensagem encontrada" e retransmite o envelope vazio para satisfazer o pedido de retry — queima uma das tentativas e deixa o destinatário preso para sempre em "Waiting for this message".Fix: retornar
undefinedno miss, para o Baileys cair no caminho de reenvio/placeholder. (O caminhofull=truejá retornava undefined; mudança só no caminho usado no callback do Baileys.)3. evolution-foundation#2677 — fetchInstances vaza o
tokenda instância · SegurançafetchInstancesdevolvia otoken(hash de auth = apikey) incondicionalmente. A flagAUTHENTICATION_EXPOSE_IN_FETCH_INSTANCESsó era aplicada ao campoapiKeydo webhook, nunca a esta resposta HTTP. Exposição real num servidor que hospeda várias instâncias.Fix: mascarar o
token(→null) quando a flag éfalse(default seguro).O que NÃO entra (e por quê)
patches/baileys+7.0.0-rc.9.patch(handleStatus+ws.on('CB:status')).Validação
tsc --noEmit✅ ·eslint✅ ·npm run build✅Arquivos
src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts(Incoming messages are dropped when the contact has disappearing messages enabled (v2.3.7, Baileys) — no messages.upsert, not stored evolution-foundation/evolution-api#2773, getMessage() returns { conversation: '' } on miss — Baileys relays an empty message and burns the retry, leaving "Waiting for this message" forever evolution-foundation/evolution-api#2705)src/api/services/monitor.service.ts(AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=false does not mask instance token evolution-foundation/evolution-api#2677)🤖 Generated with Claude Code