Skip to content

Map companion m4a mime variants to the m4a transcription format - #172

Merged
pratikbodkhe merged 3 commits into
mainfrom
fix/m4a-transcription-mime
Jul 20, 2026
Merged

Map companion m4a mime variants to the m4a transcription format#172
pratikbodkhe merged 3 commits into
mainfrom
fix/m4a-transcription-mime

Conversation

@pratikbodkhe

Copy link
Copy Markdown
Contributor

Second layer of the prod transcription outage (first was the entitlement gate, #171). supabase-swift stores companion recordings with an extension-derived content type (audio/x-m4a), but audioFormatFromMime only mapped audio/mp4 and defaulted everything else to webm, so the STT provider 415'd every companion upload as unsupported_format. Verified live on app.getminutia.com: after the entitlement grant, both transcribe routes fail exactly here.

  • audio/mp4, audio/x-m4a, audio/m4a now map to m4a (codecs suffixes already stripped).
  • audio/aac keeps its raw-ADTS aac mapping: call-site tracing shows nothing in the pipeline labels m4a files that way, and aac is a valid provider format.
  • Other adapters checked (groq, assemblyai, sidecar): no mime-derived format logic, unaffected.

Tests: failing-first case table over all mime variants through the public transcribeWithOpenRouter; 38/38. Two independent reviews; the aac scope refinement above came out of the second.

supabase-swift derives the storage content type from the .m4a extension
instead of the explicit FileOptions value, so companion recordings are
stored as audio/x-m4a. audioFormatFromMime mapped only audio/mp4 and
fell through to webm, so the STT provider rejected every companion
upload with 415 unsupported_format; no companion recording could ever
transcribe. audio/mp4, audio/x-m4a, and audio/m4a now map to m4a.
audio/aac keeps its raw-ADTS aac mapping since nothing in the pipeline
labels m4a files that way.
@pratikbodkhe
pratikbodkhe merged commit 1831137 into main Jul 20, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant