fix: host container terminal frames#228
Draft
decrypto21 wants to merge 2 commits into
Draft
Conversation
The container previously left the product side hanging whenever a fault occurred before or during a handler: a synchronous throw, a rejected promise, an unsupported version tag, or an undecodable payload produced no response frame at all. This mirrors the old truapi D1 silence, on the novasama side (tracked as D5). Every served request now answers the method's catch-all error frame and every subscription its default interrupt on all fault paths: - Handler throw/reject: wrapped so the terminal error/interrupt is sent with the thrown reason instead of hanging. - Undecodable payload (bad version tag or malformed bytes): the transport drops these before any handler runs, so a decode-fault guard reads the frame header, confirms the payload really is undecodable, and answers the catch-all terminal frame. Unknown action ids keep the existing drop behavior (no response channel exists). - Chain frames answer through the same catch-all machinery. createContainer.spec.ts covers all six fault paths for both requests and subscriptions plus the unchanged not-implemented / domain-error paths.
…an unsupported version
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DRAFT - do not merge. Gate: paired with the truapi flat-restore as one conformance change.
What
The container previously left the product side hanging whenever a fault occurred before or during a handler - a synchronous throw, a rejected promise, an unsupported version tag, or an undecodable payload produced no response frame at all. This mirrors the old truapi D1 silence, on the novasama side (tracked as D5 in truapi#271).
Every served request now answers the method's catch-all error frame, and every subscription its default interrupt, on all fault paths:
Handler throw / reject - wrapped so the terminal error/interrupt is sent with the thrown reason instead of hanging.
Undecodable payload (bad version tag or malformed bytes) - the decode-fault guard reads the frame header, confirms the payload really is undecodable, and answers a typed terminal frame instead of dropping silently. A plausible-but-unsupported version tag is reported as an unsupported version; arbitrary malformed bytes (including an out-of-range leading byte) as a bad message format.
Subscription start throw / bad start - answers the default interrupt.
This extends the guarantee the framework already gave for not-implemented (makeNotImplementedSlot) and permission-denied (the permission-gated slots) to the throw/decode paths.
Evidence
Executed against main before the fix (592dc4b), createContainer sent no frame on R3 (handler throw), R4 (unsupported version), R8 (undecodable payload), S3 (subscription start throw), and S4 (bad subscription start) - the caller hung until its own timeout.
With this fix, all six fault paths answer typed terminal frames. Verified standalone:
29/29 vitest (11 new in createContainer.spec.ts, incl. the malformed-vs-unsupported-version case)
typecheck clean, lint 0 errors