Skip to content

Add support for comment events to the outgoing webhook#146

Merged
armiiller merged 3 commits intomainfrom
feat-comment-events-outgoing-webhook
Dec 20, 2025
Merged

Add support for comment events to the outgoing webhook#146
armiiller merged 3 commits intomainfrom
feat-comment-events-outgoing-webhook

Conversation

@armiiller
Copy link
Collaborator

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for comment events (created, updated, and destroyed) to the outgoing webhook integration, enabling webhooks to be triggered when comments are created, updated, or deleted.

  • Adds three new event types for comment lifecycle events
  • Extends the OutgoingEvent model to support comment-specific attributes
  • Implements data serialization for comment events including nested account_user and user information

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
config/locales/en.yml Adds English translations for comment event options and hints
app/views/pager_tree/integrations/outgoing_webhook/v3/_show_options.html.erb Adds comment event options to the show view
app/views/pager_tree/integrations/outgoing_webhook/v3/_form_options.html.erb Adds comment event options to the form view
app/models/pager_tree/integrations/outgoing_webhook/v3.rb Implements comment event options, validations, and webhook payload serialization logic
app/models/pager_tree/integrations/outgoing_event.rb Adds account_id and item_id attributes to support comment.destroyed events
app/models/pager_tree/integrations/live_call_routing/twilio/v3.rb Refactors source_id check from interest filter to processing method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

commentable_type: adapter_outgoing_event.comment.commentable_type,
commentable_id: adapter_outgoing_event.comment.commentable_id,
parent_id: adapter_outgoing_event.comment.parent_id,
acccount_user_id: adapter_outgoing_event.comment.account_user_id,
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

There's a typo in the key name. It should be "account_user_id" but is currently spelled as "acccount_user_id" (with three 'c's instead of two).

Suggested change
acccount_user_id: adapter_outgoing_event.comment.account_user_id,
account_user_id: adapter_outgoing_event.comment.account_user_id,

Copilot uses AI. Check for mistakes.

def adapter_outgoing_interest?(event_name)
["alert_acknowledged", "alert_dropped"].include?(event_name) && adapter_alert.source_id == id
["alert_acknowledged", "alert_dropped"].include?(event_name)
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The check for adapter_alert.source_id == id has been moved from adapter_outgoing_interest? to adapter_process_outgoing. This changes the behavior - previously the integration would not express interest in the event if source_id didn't match, but now it expresses interest and then bails out during processing. This could lead to unnecessary event processing overhead and potential null pointer errors if adapter_alert is not set when adapter_outgoing_interest? is called.

Suggested change
["alert_acknowledged", "alert_dropped"].include?(event_name)
return false unless ["alert_acknowledged", "alert_dropped"].include?(event_name)
return false unless respond_to?(:adapter_alert) && adapter_alert
adapter_alert.source_id == id

Copilot uses AI. Check for mistakes.
@armiiller armiiller merged commit dc1666a into main Dec 20, 2025
2 checks 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.

1 participant