fix(chatwoot): only fallback audio caption when audioMessage exists by edisonmartinsmkt · Pull Request #1435 · EvolutionAPI/evolution-api · GitHub
Skip to content

fix(chatwoot): only fallback audio caption when audioMessage exists#1435

Merged
DavidsonGomes merged 1 commit intoEvolutionAPI:developfrom
edisonmartinsmkt:fix/audio-caption-fallback
May 10, 2025
Merged

fix(chatwoot): only fallback audio caption when audioMessage exists#1435
DavidsonGomes merged 1 commit intoEvolutionAPI:developfrom
edisonmartinsmkt:fix/audio-caption-fallback

Conversation

@edisonmartinsmkt
Copy link
Copy Markdown
Contributor

@edisonmartinsmkt edisonmartinsmkt commented May 10, 2025

Context

In PR #1434 I introduced an audio-caption fallback:

audioMessage: msg.audioMessage?.caption || ''

That change unintentionally caused non-audio message types (e.g. locationMessage) to be identified as audio, resulting in empty content.

What’s Changed

  • Apply the empty-string fallback only when msg.audioMessage is defined.
  • Ensure other message types continue to render their own content.
  • Add tests to verify that location and other non-audio messages are unaffected by this fallback.

Verification

  • ✅ Audio messages without captions now correctly yield ''.
  • ✅ Location and other message types preserve their content as expected.

Summary by Sourcery

Add NATS integration for event streaming, enhance WhatsApp Business catalog/collections support, improve event and message handling, and address security and infrastructure updates.

New Features:

  • Add NATS integration for event streaming and management.
  • Introduce WhatsApp Business catalog and collections API endpoints.
  • Support for new event type SEND_MESSAGE_UPDATE across integrations.

Bug Fixes:

  • Fix fallback logic for audio message captions to avoid affecting non-audio messages.
  • Correct shell command usage to prevent shell injection vulnerabilities.

Enhancements:

  • Improve contact and message query performance and structure.
  • Enhance webhook authentication with JWT support.
  • Refactor event manager to support NATS and improve modularity.
  • Improve emoji validation for reactions.

Build:

  • Update Docker image references and labels to new repository and contact info.
  • Add jsonwebtoken and nats packages to dependencies.

CI:

  • Update CI workflows to use new Docker image repository.

Deployment:

  • Add support for skipping S3 bucket policy application via config.

Documentation:

  • Update README with new Docker image badge, contact info, and contributors.

Tests:

  • Add tests to verify correct handling of audio and non-audio messages in fallback logic.

Chores:

  • Add and update database migrations for NATS and WhatsApp VoIP token support.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented May 10, 2025

@DavidsonGomes DavidsonGomes changed the base branch from main to develop May 10, 2025 22:14
@DavidsonGomes DavidsonGomes merged commit ec9de49 into EvolutionAPI:develop May 10, 2025
1 check passed
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