0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 13:08:40 +08:00
discourse/plugins/automation/app/jobs
Gabriel Grubba 6e69e6029d
FIX: Destroy pending PM after an unexpected send error (#40461)
Previously, when `Scriptable::Utils.send_pm` raised an unexpected error,
`Jobs::DiscourseAutomation::Tracker#send_pending_pm` only logged it and
left the `PendingPm` row intact, so the scheduled job re-processed the
same failing PM every minute indefinitely.

This change destroys the pending PM in the generic `rescue` block —
mirroring the existing `ActiveRecord::RecordNotSaved` handling — so a
permanently-failing PM is removed after one attempt instead of looping
forever.

Resolves https://patch.discourse.org/patch-triage/14

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 10:02:51 -03:00
..
regular/discourse_automation FIX: use next instead of return in sidekiq_retry_in blocks (#39529) 2026-04-24 16:59:49 +02:00
scheduled/discourse_automation FIX: Destroy pending PM after an unexpected send error (#40461) 2026-06-02 10:02:51 -03:00