fix(apiproxy): reject empty question batches at the wire boundary
ask() already fails EMPTY_QUESTIONS before a request exists, so a question/requested frame with zero items is host breakage; muxFrameSchema now refuses it instead of letting an undefined first question reach the composer (review r3635427102).
This commit is contained in:
@@ -135,6 +135,10 @@ describe('events frame schemas', () => {
|
||||
expect(askUserQuestionItemSchema.parse({ id: 'q', question: 'Q?' }).id).toBe('q')
|
||||
})
|
||||
|
||||
it('rejects an empty question batch (ask() guarantees at least one, so an empty frame is host breakage)', () => {
|
||||
expect(() => muxFrameSchema.parse({ type: 'question/requested', sessionId: 's', questions: [] })).toThrow()
|
||||
})
|
||||
|
||||
it('accepts every host frame branch', () => {
|
||||
const frames = [
|
||||
{ type: 'host/session-added', sessionId: 's', parentSessionId: 'p' },
|
||||
|
||||
Reference in New Issue
Block a user