From 9d858a6f9bfb0dde3d3355e33aeda1855c73c2a4 Mon Sep 17 00:00:00 2001 From: Vinay Keerthi <11478411+stonecharioteer@users.noreply.github.com> Date: Wed, 12 Nov 2025 19:29:30 +0530 Subject: [PATCH] fix: Correct MIME type for WhatsApp audio files to prevent upload errors WhatsApp Cloud API was rejecting audio forwards with Error 131053 because audio/opus MIME type is unsupported. WhatsApp expects audio/ogg; codecs=opus for .ogg files. When receiving audio from WhatsApp, the file may be served with audio/opus content-type header. This fix detects audio/opus + .ogg extension and corrects it to audio/ogg; codecs=opus before storing in ActiveStorage. Note: ActiveStorage's Marcel gem may still override this during analysis. This is a known limitation that needs architectural discussion. Fixes #12713 --- .../components-next/captain/PageLayout.vue | 90 ++++---- .../captain/assistant/AssistantPlayground.vue | 9 +- .../captain/assistant/MessageList.vue | 22 +- .../dropdown-menu/DropdownMenu.vue | 215 ++++++++++++++---- .../dashboard/i18n/locale/en/report.json | 2 + .../captain/assistants/playground/Index.vue | 4 +- .../captain/assistants/settings/Settings.vue | 1 - .../dashboard/captain/responses/Index.vue | 5 +- .../components/heatmaps/BaseHeatmap.vue | 2 +- .../heatmaps/BaseHeatmapContainer.vue | 162 ++++++++----- .../heatmaps/HeatmapDateRangeSelector.vue | 211 +++++++++++++++++ app/jobs/webhooks/instagram_events_job.rb | 19 +- .../whatsapp/incoming_message_base_service.rb | 13 +- spec/assets/sample_opus.ogg | Bin 0 -> 15887 bytes ...ing_message_whatsapp_cloud_service_spec.rb | 53 +++++ .../application/contact_inboxes/create.yml | 2 +- .../application/contactable_inboxes/get.yml | 2 +- swagger/swagger.json | 4 +- swagger/tag_groups/application_swagger.json | 146 ++++++++++++ 19 files changed, 787 insertions(+), 175 deletions(-) create mode 100644 app/javascript/dashboard/routes/dashboard/settings/reports/components/heatmaps/HeatmapDateRangeSelector.vue create mode 100644 spec/assets/sample_opus.ogg diff --git a/app/javascript/dashboard/components-next/captain/PageLayout.vue b/app/javascript/dashboard/components-next/captain/PageLayout.vue index 4b6760f98..19303ba01 100644 --- a/app/javascript/dashboard/components-next/captain/PageLayout.vue +++ b/app/javascript/dashboard/components-next/captain/PageLayout.vue @@ -4,7 +4,6 @@ import { OnClickOutside } from '@vueuse/components'; import { useRoute } from 'vue-router'; import { useMapGetter } from 'dashboard/composables/store.js'; import { usePolicy } from 'dashboard/composables/usePolicy'; -import Icon from 'dashboard/components-next/icon/Icon.vue'; import Button from 'dashboard/components-next/button/Button.vue'; import BackButton from 'dashboard/components/widgets/BackButton.vue'; import PaginationFooter from 'dashboard/components-next/pagination/PaginationFooter.vue'; @@ -117,58 +116,57 @@ const handleCreateAssistant = () => {
-
+
- -
-
- +
+ + {{ activeAssistantName }} + +
+ - {{ activeAssistantName }} - -
- -
- - - {{ headerTitle }} - + +
- +
+
+
+ {{ headerTitle }} - -
-
- +
+
+ +
diff --git a/app/javascript/dashboard/components-next/captain/assistant/AssistantPlayground.vue b/app/javascript/dashboard/components-next/captain/assistant/AssistantPlayground.vue index 5fef2d6c1..69cbb9be5 100644 --- a/app/javascript/dashboard/components-next/captain/assistant/AssistantPlayground.vue +++ b/app/javascript/dashboard/components-next/captain/assistant/AssistantPlayground.vue @@ -75,9 +75,9 @@ const sendMessage = async () => {