iachat/enterprise/app/services
eloijrseganfredo 14b4c83dc6
fix: Prevent AudioTranscriptionJob from crashing on OpenAI 401 error (#13653)
Describe the bug
In v4.8.0, when an audio message is received, the system enqueues
Messages::AudioTranscriptionJob even if OpenAI and Captain are disabled.
This causes a Faraday::UnauthorizedError (401) which crashes the Sidekiq
job and breaks the pipeline for that message.

To Reproduce
Disable OpenAI/Captain integrations.

Send an audio message to an inbox.

Check Sidekiq logs and observe the 401 crash in
AudioTranscriptionService.

What this PR does
Adds a rescue Faraday::UnauthorizedError block inside
AudioTranscriptionService#perform. Instead of crashing the worker, it
logs a warning and gracefully exits, allowing the job to complete
successfully.

Note: This fixes the backend crash. However, there is still a frontend
reactivity issue where the audio player UI requires an F5 to load the
media, which has been reported in Issue #11013.

---------

Co-authored-by: Eloi Junior Seganfredo <eloi@seganfredo.local>
Co-authored-by: Aakash Bakhle <48802744+aakashb95@users.noreply.github.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2026-02-27 14:12:03 +04:00
..
captain feat: include contact verified status with each tool call (#13663) 2026-02-26 16:16:33 +05:30
cloudflare feat(cloud): Add support for viewing status of SSL in custom domains (#12011) 2025-07-30 10:52:47 -07:00
companies feat: Add company backfill migration for existing contacts (Part 1) (#12657) 2025-11-03 20:03:47 +05:30
contacts feat: Backend - Companies API endpoint with pagination and search (#12840) 2025-11-18 14:28:56 +05:30
enterprise chore: make all the deprecated feature flag reclaimable (#13646) 2026-02-26 18:01:13 +05:30
internal feat: legacy features to ruby llm (#12994) 2025-12-11 14:17:28 +05:30
llm feat: add global config for captain settings (#13141) 2026-01-12 19:54:19 +05:30
messages fix: Prevent AudioTranscriptionJob from crashing on OpenAI 401 error (#13653) 2026-02-27 14:12:03 +04:00
sla chore: fix sla email notifications (#9192) 2024-04-04 21:16:49 +05:30
twilio feat(voice): Improved voice call creation flow [EE] (#12268) 2025-08-22 13:38:23 +02:00
voice feat(enterprise): add voice conference API (#13064) 2025-12-15 15:11:59 -08:00
page_crawler_service.rb feat: Response Bot using GPT and Webpage Sources (#7518) 2023-07-21 18:11:51 +03:00