Repository navigation
fix(read-state): validar histórico original antes de modificar chats - #2
Draft
alpesdigital-adm wants to merge 1 commit into
Draft
alpesdigital-adm wants to merge 1 commit into
alpesdigital-adm wants to merge 1 commit into
Conversation
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.
Os comandos de leitura aceitavam um único cursor enviado pelo cliente, inclusive outbound, e o comando de não lido completava timestamps ausentes com a hora atual. O contrato agora aceita
lastMessagese valida a sequência completa até a última mensagem recebida antes de chamar o SDK.São rejeitados intervalos incompletos, mensagens de chats diferentes, IDs repetidos e timestamps inválidos ou fora de ordem. O uso legado de
readMessagespara recibos continua disponível;lastMessagesingular só altera o chat quando já representa um intervalo inbound válido.Validação: 9 testes do contrato passaram localmente com Baileys rc13, incluindo falha antes de efeitos do SDK; TypeScript e lint dos arquivos alterados passaram. O CRM complementar passou em 32 testes focados.
Cliente complementar: https://github.com/alpesdigital-adm/pegasus-crm/pull/24
Este PR fica em rascunho, sem deploy nem reativação. Em 2026-09-28, a sessão usada na validação anterior recebeu 401/device_removed; a causa não foi determinada. A produção mantém b24f9d0 e o CRM suspende comandos de leitura com
EVOLUTION_READ_STATE_SYNC_ENABLED=0. A validação no aparelho permanece pendente; não repetir testes em outra conta ativa de produção.