Add support for comment events to the outgoing webhook#146
Conversation
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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).
| acccount_user_id: adapter_outgoing_event.comment.account_user_id, | |
| account_user_id: adapter_outgoing_event.comment.account_user_id, |
|
|
||
| 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) |
There was a problem hiding this comment.
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.
| ["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 |
No description provided.