fix: Corrige o PR1481 by KokeroO · Pull Request #1490 · EvolutionAPI/evolution-api · GitHub
Skip to content

fix: Corrige o PR1481#1490

Merged
DavidsonGomes merged 1 commit intoEvolutionAPI:developfrom
KokeroO:develop
May 22, 2025
Merged

fix: Corrige o PR1481#1490
DavidsonGomes merged 1 commit intoEvolutionAPI:developfrom
KokeroO:develop

Conversation

@KokeroO
Copy link
Copy Markdown
Contributor

@KokeroO KokeroO commented May 22, 2025

Problema

O #1481 trouxe um erro de query na inversão da condicional.

      if (conversationId) {
        query = 'SELECT source_id FROM messages WHERE source_id = ANY($1)';
      }

      if (!conversationId) {
        query = 'SELECT source_id FROM messages WHERE source_id = ANY($1) AND conversation_id = $2';
      }

Deve ser:

      if (conversationId) {
        query = 'SELECT source_id FROM messages WHERE source_id = ANY($1) AND conversation_id = $2';
      }

      if (!conversationId) {
        query = 'SELECT source_id FROM messages WHERE source_id = ANY($1)';
      }

Summary by Sourcery

Bug Fixes:

  • Swap SQL query branches so the conversation_id clause is included when conversationId exists and omitted otherwise

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented May 22, 2025

@DavidsonGomes DavidsonGomes changed the base branch from main to develop May 22, 2025 20:08
@DavidsonGomes DavidsonGomes merged commit 0239638 into EvolutionAPI:develop May 22, 2025
1 check failed
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.

2 participants