AstrBot-Desktop/src-tauri
YokiiroBW 5b518d1181
一些检测仍在等待运行
ci / Portable quality checks (push) Waiting to run
ci / Windows Tauri build (push) Waiting to run
feat(chat): carry voice and other non-image attachments end to end
F-33. A voice reply produced nothing at all: no marker, no event, no
error. Four independent gates each dropped it, and fixing any one alone
would have changed nothing observable.

The mapper reached `map_media` for image, record, file and video alike,
but its only emitting branch was gated on the frame being an image, and
the `attachment_saved` fallback rejected every other type outright. Both
now carry whatever type arrived, with the frame type as the marker's alt
text so the renderer knows what to expect before any bytes exist.
`pending_media` was also a single slot, so a second attachment in one
reply overwrote the first before it was paired; it is a bounded queue
now, and an `attachment_saved` with no id no longer consumes the media
frame still waiting for one.

The download judged a candidate path successful only if the bytes sniffed
as an image — this server answers unknown paths with its own text under
HTTP 200, so sniffing is load-bearing and cannot simply be dropped.
Audio and video signatures are recognised now, and a declared
Content-Type is trusted when it names media rather than only images.
SILK is included deliberately: it is what AstrBot relays for QQ and
WeChat voice, no browser decodes it, and recognising it is what lets the
UI say so instead of rendering a player whose play button does nothing.

The CSP had no `media-src`, so it fell back to `default-src 'self'` and
an `<audio src="blob:">` was refused — in release builds only, since the
dev server serves no CSP at all. That is the same divergence as F-04 and
the inline-script trap in pet.html, so the policy now has a test of its
own that pins each directive the app depends on, including that
script-src still refuses inline.

The renderer chose `<img>` unconditionally. The element now follows the
media type of the bytes that actually arrived, falling back to the
marker's declared kind for the placeholder and the failure message.

`map_media` also kept a private copy of the message-id handling that
included the reopen-suffix overwrite fixed earlier in `adopt_message_id`;
it shares the one implementation now.

Protocol tests 22 -> 26, Rust client 99 -> 101, frontend 35 -> 43. All
six mutations of the new assertions were confirmed to fail.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 06:16:55 +08:00
..
capabilities fix(tauri): grant the window controls the permissions they call 2026-07-27 01:19:42 +08:00
icons feat(p00): add Tauri desktop spike foundation 2026-07-18 20:34:47 +08:00
src feat(chat): carry voice and other non-image attachments end to end 2026-07-27 06:16:55 +08:00
tests fix(tauri): grant the window controls the permissions they call 2026-07-27 01:19:42 +08:00
build.rs feat(p00): add Tauri desktop spike foundation 2026-07-18 20:34:47 +08:00
Cargo.toml feat(p00): add Tauri desktop spike foundation 2026-07-18 20:34:47 +08:00
tauri.conf.json feat(chat): carry voice and other non-image attachments end to end 2026-07-27 06:16:55 +08:00