mirror of
https://github.com/chatwoot/chatwoot.git
synced 2026-07-10 21:17:01 +08:00
https://one.newrelic.com/alerts/issue?account=3437125&duration=259200000&state=d088e9b7-d0ce-3fcf-fda5-145df8b9cb2a
## Description
Pass serialized data instead of ActiveRecord object in
dispatch_destroy_event to prevent ActiveJob::DeserializationError when
the notification is already deleted.
This error occurs frequently because RemoveDuplicateNotificationJob
deletes notifications, and by the time the async EventDispatcherJob
runs, the record no longer exists.
## Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
## How Has This Been Tested?
## Checklist:
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented on my code, particularly in hard-to-understand
areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Avoids ActiveJob deserialization failures by sending serialized data
for notification deletion and updating the listener accordingly.
>
> - `Notification#dispatch_destroy_event` now dispatches
`NOTIFICATION_DELETED` with serialized `notification_data` (`id`,
`user_id`, `account_id`) instead of the AR object
> - `ActionCableListener#notification_deleted` reads
`notification_data`, finds `User`/`Account`, computes
`unread_count`/`count` via `NotificationFinder`, and broadcasts using
the user’s pubsub token
> - Specs updated to pass `notification_data` and assert payload
(including `unread_count`/`count`)
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
|
||
|---|---|---|
| .. | ||
| channel | ||
| concerns | ||
| integrations | ||
| access_token.rb | ||
| account_user.rb | ||
| account.rb | ||
| agent_bot_inbox.rb | ||
| agent_bot.rb | ||
| application_record.rb | ||
| article.rb | ||
| assignment_policy.rb | ||
| attachment.rb | ||
| automation_rule.rb | ||
| campaign.rb | ||
| canned_response.rb | ||
| category.rb | ||
| contact_inbox.rb | ||
| contact.rb | ||
| conversation_participant.rb | ||
| conversation.rb | ||
| csat_survey_response.rb | ||
| custom_attribute_definition.rb | ||
| custom_filter.rb | ||
| dashboard_app.rb | ||
| data_import.rb | ||
| email_template.rb | ||
| folder.rb | ||
| inbox_assignment_policy.rb | ||
| inbox_member.rb | ||
| inbox.rb | ||
| installation_config.rb | ||
| integrations.rb | ||
| jsonb_attributes_length_validator.rb | ||
| kbase.rb | ||
| label.rb | ||
| macro.rb | ||
| mention.rb | ||
| message.rb | ||
| note.rb | ||
| notification_setting.rb | ||
| notification_subscription.rb | ||
| notification.rb | ||
| platform_app_permissible.rb | ||
| platform_app.rb | ||
| portal.rb | ||
| related_category.rb | ||
| reporting_event.rb | ||
| super_admin.rb | ||
| team_member.rb | ||
| team.rb | ||
| user.rb | ||
| webhook.rb | ||
| working_hour.rb | ||