fix(stream): chat insert 400 — insert body must declare snippet.type
The liveChatId fix (TASK 44) worked on the next Test Stream, but every Mock
Chat Input send returned 'YouTube rejected the message (error 400)'. The
runtime log's body: 400 MISSING_REQUIRED_FIELD, domain
youtube.api.v3.LiveChatMessageInsertResponse.Error.
The liveChat/messages.insert snippet requires type ('textMessageEvent' or
'pollEvent') alongside liveChatId and textMessageDetails.messageText; the
TASK 41 body omitted it, and the Good Dog test asserted only liveChatId +
messageText were present — false-green while real YouTube rejected every
send. Fix body + assert type in the same test so the field can never drop
silently again.
Reference: https://developers.google.com/youtube/v3/live/docs/liveChatMessages/insert
Good Dog: ONE integration test (strengthened TestStream_DockTooling...).
Gate: clean build 0 warnings; full vstest 317/318 (the 1 failure is the
known environmental RealMouseDrag flake — passes 3/3 in isolation).
This commit is contained in:
@@ -40,6 +40,21 @@ pump pushed RTMP.) Fix = read part=snippet + bounded retry AFTER the encoder sta
|
||||
(`GetBroadcastLiveChatIdAsync(broadcastId, maxAttempts=10, delayMs=2000)`). Debug lens:
|
||||
missing liveChatId ≈ "broadcast not live yet", NOT an auth failure.
|
||||
|
||||
### liveChat/MESSAGES.INSERT BODY REQUIRES snippet.type (RECIPE)
|
||||
|
||||
YouTube Data API v3 `liveChat/messages.insert` rejects the body with
|
||||
`400 MISSING_REQUIRED_FIELD` (`domain: youtube.api.v3.LiveChatMessageInsertResponse.Error`)
|
||||
unless the snippet declares `snippet.type` = `textMessageEvent` (or `pollEvent`) alongside
|
||||
`liveChatId` and `textMessageDetails.messageText` — the official insert reference lists
|
||||
`type` as a required property. (2026-09-25: the TEST-tab "YouTube rejected the message
|
||||
(error 400)" report — the liveChatId fix in TASK 44 had worked and the drawer's Mock Chat
|
||||
Input was issuing a real insert, but the body omitted `type`, and the TASK 41 test only
|
||||
asserted `liveChatId` + `messageText` were present so it stayed green while real YouTube
|
||||
rejected every send. Fix = add `type = "textMessageEvent"` to the body + assert it in the
|
||||
Good Dog test.) Debug lens: MISSING_REQUIRED_FIELD ≠ auth/scope — it means the request
|
||||
body shape is wrong, and the false-green test is the classic trap: assertion on the
|
||||
body was about WHAT WE SEND, so YouTube's required fields must be mirrored in the test.
|
||||
|
||||
### CHANNELS.LIST auditDetails PART 403s THE WHOLE REQUEST WITHOUT A PARTNER SCOPE (RECIPE)
|
||||
|
||||
YouTube Data API v3 `channels.list` rejects the ENTIRE request with
|
||||
|
||||
Reference in New Issue
Block a user