Repository navigation
test(voice-notes): keep each attachment's own type in the upload fixture - #999
Conversation
wesbillman
left a comment
There was a problem hiding this comment.
🤖 Carl, an automated reviewer, commenting via Wes's GitHub account.
No blockers. The fix targets the right thing: recordings upload as audio/wav (useVoiceNoteRecorder.ts:170), so they keep the demo voice metadata. The ten .txt drafts now stay text/plain and render as file rows, so they make no /api/relay/media requests. The full-draft test still proves the limit: 10 Ready rows, the limit message, and no mic start. Hosted CI is green at 7bcd41f1.
Non-blocking:
- One wording nit, inline.
- The
page.routehandler in the spec'sbeforeEachcan still throwTest endedif a future test finishes with a media load in flight. AnafterEachcallingpage.unrouteAll({ behavior: "ignoreErrors" })(Playwright 1.63 supports it) would cover that whole class. Fine as a follow-up.
| }); | ||
| if (report.failUpload) throw new Error("Fixture upload failed"); | ||
| // Only recordings come back as voice notes; other files keep their type, | ||
| // so attaching them does not start voice-note media loads. |
There was a problem hiding this comment.
Nit: the loads this avoids aren't voice-note loads. A draft row's voice comes from the recording (attachment-draft.ts:288), not from the upload result, so the old .txt drafts never rendered as voice-note cards. They came back as video/mp4 and got the <video preload="metadata"> preview (ComposerAttachments.tsx:225), which loads through the media route. Maybe:
// Only recordings come back as voice notes. Other files keep their own type,
// so they don't get video previews that load media.The PR description says "voice-note preview" as well.
The voice-notes fixture answers every upload with the demo voice note's video metadata. Attaching ten text files therefore makes ten voice-note previews load /api/relay/media through the test's route after the test has finished, and the route's page.evaluate fails with "Test ended". Return the file's own type for anything that is not a recording, so plain attachments start no media loads. Recordings are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: James Kraus <jamespkraus@gmail.com> Signed-off-by: Logan Johnson <loganj@squareup.com>
5279f75 to
e1fbbcb
Compare
* commit '506ac5d4d': Fix JPEG uploads and attachment control overlap (#1068) feat(channels): read, write and look up channel labels (#964) refactor(agents): separate the agent runner and its reads from the desktop app (#961) fix(media): show desktop animated avatars and match dev broker media rules to native (#990) ci(browser): split journeys across nine shards per engine (#989) test(inbox): open the edit journey's conversation by name (#997) test(voice-notes): keep each attachment's own type in the upload fixture (#999) Stabilize main: consolidate WebKit flake and bottom-follow fixes (#1039) Push main-pane threads in and hold threads behind a loading mark (#1018) [buzz-app] Show full sent images and GIFs (#886) feat(agents): say the agents this copy runs are online (#862) [buzz-app] Keep the sidebar in place when switching to Personal space (#945) fix(builderlab): link the Buzz key before attesting remote agents (#978) feat(agents): show agents typing to everyone while they work on a mention (#998) Signed-off-by: John Tennant <jtennant@block.xyz>
Summary
The voice-notes fixture answers every upload with the demo voice note's metadata, including
type: "video/mp4". Whenvoice-notes› "rejects a full attachment draft before opening the microphone" attaches ten.txtfiles, each draft therefore gets a<video preload="metadata">preview (ComposerAttachments.tsx). Those previews make 10–20/api/relay/medialoads through the file'spage.routehandler, which callspage.evaluateandroute.fulfill.Nothing waits for those loads. When one is still in its handler as the test finishes, the test fails with
"page.evaluate: Test ended." while running route callback. Onmainthis failed WebKit 6/6 in 38443596151, 38450152226 and 38453858017.Change
uploadAttachmentintests/fixtures/voice-notes.tsxreturns the demo metadata only for audio files, which is how recordings upload (audio/wav). Other files keep their own type, so plain attachments render as file rows and start no media loads. Recordings, assertions and the route are unchanged.Tests
bin/pnpm test:browser --project webkit --project chromium --no-deps tests/browser/voice-notes.spec.mjs --repeat-each=2passes 20/20 on currentmain, including the@media-recordercases.Stack
This PR → #997 → #989.
Readiness
Known gaps