iachat/app/jobs/inboxes
Sojan Jose 656ae41b24
fix(imap): handle IMAP parser/read errors without exception tracking (#13473)
When an IMAP server returns malformed or partial protocol responses,
Inboxes::FetchImapEmailsJob can raise Net::IMAP::ResponseParseError,
Net::IMAP::ResponseReadError, or Net::IMAP::ResponseTooLargeError.
Previously these errors fell through to the generic StandardError
handler and were captured repeatedly in Sentry.

This PR updates app/jobs/inboxes/fetch_imap_emails_job.rb to treat those
parser/read exceptions as handled IMAP failures by adding them to the
existing IMAP/network rescue block, so they are logged and retried on
the next scheduled run without exception tracking noise.

fixes:
https://chatwoot-p3.sentry.io/issues/7132037793/events/104fb9b4d80a4fb6ba3861c44c6c9b83/

How to reproduce:
- Use an IMAP server/inbox that intermittently returns malformed or
truncated protocol responses during search/fetch.
- Run Inboxes::FetchImapEmailsJob for that channel and observe the
raised parser/read exception.

How this was tested:
- bundle exec ruby -c app/jobs/inboxes/fetch_imap_emails_job.rb
- bundle exec rubocop app/jobs/inboxes/fetch_imap_emails_job.rb
2026-02-07 17:30:54 -08:00
..
bulk_auto_assignment_job.rb feat: Run assignment every 15 minutes (#12334) 2025-08-29 15:10:56 -07:00
fetch_imap_email_inboxes_job.rb fix: Disable IMAP inboxes that requires authorization (#12092) 2025-08-01 16:32:29 -07:00
fetch_imap_emails_job.rb fix(imap): handle IMAP parser/read errors without exception tracking (#13473) 2026-02-07 17:30:54 -08:00
sync_widget_pre_chat_custom_fields_job.rb chore: Sync pre-chat fields after custom attribute destroy (#4456) 2022-04-18 14:06:27 +05:30
update_widget_pre_chat_custom_fields_job.rb feat: Support Regex validation for custom attributes (#7856) 2024-01-23 18:01:57 +04:00