Skip to content

tests: a phone’s message file and spoken audio keep every byte through the native byte client (#449) - #497

Open
kridaydave wants to merge 2 commits into
DuskBotAI:devfrom
kridaydave:test/android-media-byte-exact
Open

kridaydave wants to merge 2 commits into
DuskBotAI:devfrom
kridaydave:test/android-media-byte-exact

Conversation

@kridaydave

@kridaydave kridaydave commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up tests for #449, already fixed on dev by the native byte-client change (message files and /api/tts/speak POSTs go through DuskStream instead of CapacitorHttp).

The existing transport test checks routing by mocking the byte client; it never proves that the native stream actually returns binary bodies unchanged. This adds:

  • src/mobile/native-stream.test.ts: a binary MP4 body comes back byte for byte, including bytes above 0x7F that a text decode would replace.
  • src/mobile/transport/transport.test.ts: answersWithBytes classifies the message-file and spoken-audio POSTs as byte-exact, and leaves GET/HEAD and other POSTs alone.

The branch also carries the server/system-proxy.ts prerequisite from #499 so the static source guard is green: undici now loads at first use inside installSystemProxy instead of at module load. That is the only production change; the #449 coverage itself is tests only.

Focused tests:

node --experimental-strip-types node_modules/vitest/vitest.mjs run src/mobile/native-stream.test.ts src/mobile/transport/transport.test.ts

56 passed.

@kridaydave
kridaydave force-pushed the test/android-media-byte-exact branch from 8543c43 to 70132cf Compare December 3, 2026 11:42
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