Skip to content

fix(events): correct GROUP_UPDATE typo to GROUPS_UPDATE#2652

Open
fabi125 wants to merge 1 commit into
evolution-foundation:developfrom
fabi125:fix/groups-update-events
Open

fix(events): correct GROUP_UPDATE typo to GROUPS_UPDATE#2652
fabi125 wants to merge 1 commit into
evolution-foundation:developfrom
fabi125:fix/groups-update-events

Conversation

@fabi125

@fabi125 fabi125 commented Jul 19, 2026

Copy link
Copy Markdown

📋 Description

In src/api/types/wa.types.ts the event is defined as groups.update, but in the configuration its often referred to as the singular GROUP_UPDATE, the env vars that are being read are a mix of both. This fixes this so groups.update events are being correctly sent to receivers.

🔗 Related Issue

n/a

🧪 Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧹 Code cleanup
  • 🔒 Security fix

🧪 Testing

Previously there was no way to get groups.update events to be sent to a webhook receiver, now this works as expected.

  • Manual testing completed
  • Functionality verified in development environment
  • No breaking changes introduced
  • Tested with different connection types (if applicable)

📸 Screenshots (if applicable)

n/a

✅ Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have manually tested my changes thoroughly
  • I have verified the changes work with different scenarios
  • Any dependent changes have been merged and published

📝 Additional Notes

Summary by Sourcery

Align event configuration to use the plural GROUPS_UPDATE name consistently for group update events

Bug Fixes:

  • Fix misnamed GROUP_UPDATE configuration flags so groups.update events are correctly enabled across messaging backends

Enhancements:

  • Normalize instance schema and controller-allowed event lists to use GROUPS_UPDATE for group update events

Deployment:

  • Update Docker Swarm environment variables to use the GROUPS_UPDATE event flag name

@sourcery-ai

sourcery-ai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Standardizes the GROUPS_UPDATE event name across configuration, validation schemas, integration controller, and deployment defaults so that groups.update events can be correctly enabled and delivered via all transports.

Sequence diagram for GROUPS_UPDATE event flow after standardization

sequenceDiagram
  participant Env as EnvVars
  participant Config as ConfigService
  participant EventCtrl as EventController
  participant Receiver as WebhookReceiver

  Env->>Config: RABBITMQ_EVENTS_GROUPS_UPDATE
  Config->>Config: set eventsRabbitmq.GROUPS_UPDATE
  EventCtrl->>Config: get eventsRabbitmq
  alt GROUPS_UPDATE enabled
    EventCtrl-->>Receiver: groups.update event
  end
Loading

File-Level Changes

Change Details Files
Standardize the group update event flag from GROUP_UPDATE to GROUPS_UPDATE everywhere it is surfaced in configuration and validation.
  • Rename GROUP_UPDATE to GROUPS_UPDATE in event configuration types for RabbitMQ, NATS, Kafka, Pusher, and Webhook and align their environment variable bindings
  • Update instance JSON schema allowed event names to use GROUPS_UPDATE instead of GROUP_UPDATE across all relevant arrays
  • Adjust Docker Swarm evolution_api_v2 service environment example to expose RABBITMQ_EVENTS_GROUPS_UPDATE instead of the singular variant
  • Update EventController allowed events list to reference GROUPS_UPDATE so webhook and other integrations recognize the correct event name
src/config/env.config.ts
src/validate/instance.schema.ts
Docker/swarm/evolution_api_v2.yaml
src/api/integrations/event/event.controller.ts
.env.example

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • Since the env var and config keys for this event were renamed from GROUP_UPDATE to GROUPS_UPDATE, consider temporarily supporting both names (with a clear precedence) to avoid silently breaking existing deployments that still use the old env var.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Since the env var and config keys for this event were renamed from GROUP_UPDATE to GROUPS_UPDATE, consider temporarily supporting both names (with a clear precedence) to avoid silently breaking existing deployments that still use the old env var.

## Individual Comments

### Comment 1
<location path="src/validate/instance.schema.ts" line_range="81" />
<code_context>
     'CHATS_DELETE',
     'GROUPS_UPSERT',
-    'GROUP_UPDATE',
+    'GROUPS_UPDATE',
     'GROUP_PARTICIPANTS_UPDATE',
     'CONNECTION_UPDATE',
</code_context>
<issue_to_address>
**issue (bug_risk):** Updating the allowed event value to `GROUPS_UPDATE` may break clients still sending `GROUP_UPDATE`.

This aligns with the config rename, but any client still sending `GROUP_UPDATE` will now fail validation. If backward compatibility is needed, consider temporarily accepting both values and mapping `GROUP_UPDATE` to `GROUPS_UPDATE` internally, then deprecating the old value later.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

'CHATS_DELETE',
'GROUPS_UPSERT',
'GROUP_UPDATE',
'GROUPS_UPDATE',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Updating the allowed event value to GROUPS_UPDATE may break clients still sending GROUP_UPDATE.

This aligns with the config rename, but any client still sending GROUP_UPDATE will now fail validation. If backward compatibility is needed, consider temporarily accepting both values and mapping GROUP_UPDATE to GROUPS_UPDATE internally, then deprecating the old value later.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not familiar enough with the code to know if this is really needed here. i'll leave it up to the human reviewer :)

@dpaes

dpaes commented Jul 20, 2026

Copy link
Copy Markdown

please, send to develop (we dont accept to main) @fabi125

@fabi125
fabi125 force-pushed the fix/groups-update-events branch from dcbafe8 to 831407e Compare July 20, 2026 17:50
@fabi125
fabi125 marked this pull request as draft July 20, 2026 17:53
@fabi125
fabi125 changed the base branch from main to develop July 20, 2026 17:54
@fabi125
fabi125 marked this pull request as ready for review July 20, 2026 17:54
@fabi125

fabi125 commented Jul 20, 2026

Copy link
Copy Markdown
Author

please, send to develop (we dont accept to main) @fabi125

oops, sorry. rebased and updated the PR

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Renaming the config fields and env vars from GROUP_UPDATE to GROUPS_UPDATE is potentially breaking for existing deployments; consider temporarily supporting both names (e.g., fallback reads of the old env var) to ease migration.
  • This typo suggests event names are duplicated across multiple places (types, schema, config, env); consider centralizing these event keys in a shared enum/constant to avoid future mismatches.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Renaming the config fields and env vars from GROUP_UPDATE to GROUPS_UPDATE is potentially breaking for existing deployments; consider temporarily supporting both names (e.g., fallback reads of the old env var) to ease migration.
- This typo suggests event names are duplicated across multiple places (types, schema, config, env); consider centralizing these event keys in a shared enum/constant to avoid future mismatches.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@dpaes

dpaes commented Jul 20, 2026

Copy link
Copy Markdown

@gomessguii @pastoriniMatheus review

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