Skip to content

fix(baileys): remove dangling maxRetries ref in message-update log#1

Merged
jpavrdev merged 1 commit into
mainfrom
fix/baileys-maxretries-undeclared
May 14, 2026
Merged

fix(baileys): remove dangling maxRetries ref in message-update log#1
jpavrdev merged 1 commit into
mainfrom
fix/baileys-maxretries-undeclared

Conversation

@jpavrdev
Copy link
Copy Markdown
Owner

@jpavrdev jpavrdev commented May 14, 2026

Problema

Build falha com erro de TypeScript:

src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts(1802,64): error TS2304: Cannot find name 'maxRetries'.

Linha problemática:

if (!findMessage?.id) {
  this.logger.verbose(
    `Original message not found for update after ${maxRetries} retries. Skipping. ...`,
  );
  continue;
}

A variável maxRetries não é declarada em lugar nenhum do arquivo. É o único uso. Provavelmente órfão de uma versão antiga com loop de retry que foi removido no merge cad92bd Merge branch 'evolution-foundation:main' into main.

No upstream a linha equivalente não tem maxRetries:

this.logger.warn(`Original message not found for update. Skipping. Key: ${JSON.stringify(key)}`);

Fix

Remove apenas a interpolação inválida. Preserva o resto da mensagem que o fork havia enriquecido e mantém logger.verbose.

-                `Original message not found for update after ${maxRetries} retries. Skipping. This is expected for protocol messages or ephemeral events not saved to the database. Key: ${JSON.stringify(key)}`,
+                `Original message not found for update. Skipping. This is expected for protocol messages or ephemeral events not saved to the database. Key: ${JSON.stringify(key)}`,

Validação

grep -c "maxRetries" src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts
# 0 (era 1)

Build TS passa. Comportamento funcional inalterado.

Build falhava com TS2304: Cannot find name 'maxRetries' porque o log no
handler de messages.update referenciava ${maxRetries}, mas nenhuma
variável ou loop de retry foi introduzido. Provavelmente regressão do
merge cad92bd com upstream.

Mantém a mensagem do fork sem a interpolação inválida.
@jpavrdev jpavrdev force-pushed the fix/baileys-maxretries-undeclared branch from c58f990 to afdc786 Compare May 14, 2026 12:40
@jpavrdev jpavrdev merged commit e05fca3 into main May 14, 2026
@jpavrdev jpavrdev deleted the fix/baileys-maxretries-undeclared branch May 14, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant