Skip to content

fix(transcription): accept every filename extension a decodable type declares (#868) - #873

Open
yzxcj797 wants to merge 2 commits into
altic-dev:mainfrom
yzxcj797:fix/opus-extension-accept-868
Open

fix(transcription): accept every filename extension a decodable type declares (#868)#873
yzxcj797 wants to merge 2 commits into
altic-dev:mainfrom
yzxcj797:fix/opus-extension-accept-868

Conversation

@yzxcj797

Copy link
Copy Markdown
Contributor

Closes #868.

Root cause

supportedFileExtensions kept only each UTType's preferredFilenameExtension. The Ogg audio type (org.xiph.ogg-audio) declares the extensions ["ogg", "oga", "opus"] with ogg preferred — so .opus (WhatsApp voice notes arrive as Ogg Opus) and .oga were rejected by both the drop zone and the file picker, even though macOS decodes them natively (AVAudioFile/AVAsset read them fine; renaming the same file to .ogg made it work).

Fix

The set is now built from all of a type's filename-extension tags (utType.tags.filter { $0.isFilenameExtension }), plus the preferred one as a safety net for types where it is occasionally absent from tags. The defining property is preserved: everything accepted is something AVURLAsset.audiovisualTypes() says AVFoundation can decode — the set just no longer loses decodable extensions to the preferred-only projection.

Tests

Four in Tests/FluidDictationIntegrationTests/SupportedFileExtensionsTests.swift (XCTest, matching the existing integration-test target):

  • the Ogg family (ogg, opus, oga) is accepted;
  • well-known formats (wav, mp3, m4a, mp4, mov) stay accepted;
  • the service's set exactly equals the tag-derived set recomputed the same way — pins the construction so it cannot silently drift back to preferred-only;
  • non-media extensions (txt, pdf) stay rejected.

(No Swift toolchain on this Windows machine, so the compile/test gate is CI; the change uses only UTType.tags/isFilenameExtension, both public UniformTypeIdentifiers API on macOS 11+.)

…declares (altic-dev#868)

supportedFileExtensions kept only each UTType's
preferredFilenameExtension. The Ogg audio type (org.xiph.ogg-audio)
declares the extensions [ogg, oga, opus] with ogg preferred, so .opus
(WhatsApp voice notes) and .oga were rejected by the drop zone and the
file picker even though macOS decodes them natively — renaming the same
file to .ogg made it work.

The set is now built from all of a type's filename-extension tags (plus
the preferred one, which is occasionally missing from tags), keeping the
property that everything accepted is something AVFoundation can actually
decode.

Four tests: the Ogg family extensions are accepted, well-known formats
stay accepted, the set exactly equals the full tag-derived set (no
hand-maintained drift), and non-media extensions stay rejected.
@github-actions github-actions Bot added needs PR template Pull request is missing required template content. needs screenshots Pull request needs screenshot or video evidence. labels Aug 18, 2026
@github-actions

Copy link
Copy Markdown

The PR Policy check is blocking this PR because required template information is missing.

Please update the PR description with:

  • Description
  • Type of Change
  • Related Issue or Discussion
  • Testing
  • Screenshots / Video

Screenshots or video are required for UI, UX, settings, onboarding, overlay, menu bar, or visual behavior changes. If this PR has no visual changes, check the no-visual-change box in the template.

If this remains incomplete for 48 hours after opening, the PR may be closed.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d61092c438

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

/// `["ogg", "oga", "opus"]` with `ogg` preferred, so a preferred-only set
/// rejected WhatsApp `.opus` voice notes (and `.oga`) even though macOS
/// decodes them natively.
final class SupportedFileExtensionsTests: XCTestCase {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add the test file to the Xcode test target

This directory is represented by an explicit PBXGroup, not a filesystem-synchronized group, and Fluid.xcodeproj/project.pbxproj contains no file reference, build-file entry, or sources-phase entry for SupportedFileExtensionsTests.swift. Consequently, the xcodebuild test workflow will never compile or execute this new suite, so the regression coverage added here is ineffective until the file is included in FluidDictationIntegrationTests target membership.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed and pushed: the directory is an explicit PBXGroup, so the file now has all four entries in project.pbxproj (file reference, build-file entry, group child, sources-phase entry), mirroring the AudioBufferConverterTests pattern. The xcodebuild test workflow will compile and run it.

@greptile-apps

greptile-apps Bot commented Aug 18, 2026

Copy link
Copy Markdown

Greptile Summary

The PR expands meeting-transcription format validation to include every filename extension declared by each AVFoundation-decodable audio or movie type, fixing .opus and .oga selection.

  • Collects all filename-extension tags while retaining the preferred extension as a fallback.
  • Adds integration coverage for Ogg-family and common media extensions, exact set construction, and rejection of non-media extensions.
  • Registers the new test file with the Xcode integration-test target.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (2): Last reviewed commit: "Address review: register the new test fi..." | Re-trigger Greptile

The FluidDictationIntegrationTests directory is an explicit PBXGroup, so a
test file not referenced in project.pbxproj is never compiled or run.
Adds the file reference, build-file entry, group child, and sources-phase
entry for SupportedFileExtensionsTests.swift, mirroring the existing
AudioBufferConverterTests entries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs PR template Pull request is missing required template content. needs screenshots Pull request needs screenshot or video evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File transcription rejects WhatsApp .opus voice notes even though macOS decodes them natively

1 participant