fix: add .caf to AUDIO_FILE_EXTENSIONS (#10982)

* fix: add .caf to AUDIO_FILE_EXTENSIONS for iMessage voice messages

* fix: add caf audio extension regression coverage (#10982) (thanks @succ985)

---------

Co-authored-by: succ985 <succ985@users.noreply.github.com>
Co-authored-by: Gustavo Madeira Santana <gumadeiras@gmail.com>
main
succ985 2026-02-08 07:04:22 +08:00 committed by GitHub
parent 8da20027c4
commit b8f740fb14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 1 deletions

View File

@ -29,6 +29,7 @@ Docs: https://docs.openclaw.ai
- Cron: scheduler reliability (timer drift, restart catch-up, lock contention, stale running markers). (#10776) Thanks @tyler6204.
- Cron: store migration hardening (legacy field migration, parse error handling, explicit delivery mode persistence). (#10776) Thanks @tyler6204.
- Memory: set Voyage embeddings `input_type` for improved retrieval. (#10818) Thanks @mcinteerj.
- Media understanding: recognize `.caf` audio attachments for transcription. (#10982) Thanks @succ985.
- Telegram: auto-inject DM topic threadId in message tool + subagent announce. (#7235) Thanks @Lukavyi.
- Security: require auth for Gateway canvas host and A2UI assets. (#9518) Thanks @coygeek.
- Cron: fix scheduling and reminder delivery regressions; harden next-run recompute + timer re-arming + legacy schedule fields. (#9733, #9823, #9948, #9932) Thanks @tyler6204, @pycckuu, @j2h4u, @fujiwara-tofu-shop.

View File

@ -1,6 +1,6 @@
import JSZip from "jszip";
import { describe, expect, it } from "vitest";
import { detectMime, extensionForMime, imageMimeFromFormat } from "./mime.js";
import { detectMime, extensionForMime, imageMimeFromFormat, isAudioFileName } from "./mime.js";
async function makeOoxmlZip(opts: { mainMime: string; partPath: string }): Promise<Buffer> {
const zip = new JSZip();
@ -96,3 +96,17 @@ describe("extensionForMime", () => {
expect(extensionForMime(undefined)).toBeUndefined();
});
});
describe("isAudioFileName", () => {
it("matches known audio extensions", () => {
const cases = [
{ fileName: "voice.mp3", expected: true },
{ fileName: "voice.caf", expected: true },
{ fileName: "voice.bin", expected: false },
] as const;
for (const testCase of cases) {
expect(isAudioFileName(testCase.fileName)).toBe(testCase.expected);
}
});
});

View File

@ -42,6 +42,7 @@ const MIME_BY_EXT: Record<string, string> = {
const AUDIO_FILE_EXTENSIONS = new Set([
".aac",
".caf",
".flac",
".m4a",
".mp3",