Repository navigation
fix(hang): Rust refuses null in an optional catalog field, as JS does - #8978
Conversation
Quest-Claim: 081e370a065e0fba
Every optional field the hang draft defines in renditions, data tracks, includes, color, projection, and the video section now goes through a NotNull serde_with adapter, so null is refused instead of read as absent. MillisCeil's optional form refuses null too. The shared parity fixture gains a null case per field, generated from the JS schemas. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Head: 6f6566fb646e778103050eb489aa67a570465020
No blocker found. The field adapters preserve the distinction between omission and explicit null without walking unknown extensions. The duration adapter still treats zero jitter/delay as absent, while zero warmup remains a value. The shared fixtures cover rejection of known fields and acceptance of a null extension, which are the two important directions. This tightens catalog acceptance for Rust-only producers, so note the distinction in release notes if they previously emitted nulls. Static review; I did not rerun the reported tests.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
I reviewed the new NotNull adapter, every catalog field it now covers, the MillisCeil change for optional fields, and the new parity fixtures.
NotNull<T = Same>adapter: it wraps the existingserde_withadapters, so anullin a field the draft defines is refused, an absent field still decodes asNonethrough#[serde(default)], and serialization doesn't change because every struct using it hasskip_serializing_noneor an explicitskip_serializing_if.- Field coverage: every optional field in the video/audio/text/json/binary configs now uses
NotNull, and so do theVideosection,Color,Equirectangular.fov,Include.instanceandM2ts.mux_rate. Fields that were previously relying on serde's implicitOptiondefault (lang,label,codedWidth/codedHeight,displayAspect*) were correctly given an explicit#[serde(default)]. MillisCeilwith optional fields:jitteranddelaynow refusenullbut still read0as absent, andwarmupusesNotNull<MillisCeil>, so a zerowarmupkeeps its meaning.- Projection:
Projection::deserializesends known kinds throughKnown, sofov: nullis a hard error rather than quietly turning intoUnknown. - Parity fixtures: 70 new shared cases give each optional field its own
nullcase, and one more case shows an unknown extension field can still benull.
claude-opus-5-5 | 𝕏
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 15 minutes. View limit details
No actionable comments were generated in the recent review. WalkthroughThe change adds a Serde adapter for optional catalog fields and applies it across Rust catalog types. Serialization still represents absent values as null, while deserialization rejects null for fields using the adapter. Optional duration deserialization also rejects null and continues to map zero to None. New parity fixtures cover null catalog values and an unknown namespaced field. Merge Risk:
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The only commit since the last review merges origin/main. It doesn't change any of this PR's code.
- Merged
origin/main: the range-diff shows one difference, and it is wording in the quest file that came from the base branch (media'sclock/joinbecamesync'sclock/interval). TheNotNulladapter, the field annotations and the parity fixtures are the same as when they were approved.
claude-opus-5-5 | 𝕏

Finishes quest/m2/hang04/null.md.
Summary
rs/hangreadnullin any optional field inside a rendition, data track, include,color,projection, or the video section as absent, whilejs/hang(z.optional) and the hang draft's Root and Malformed Renditions sections refuse it. Rust now refuses it too.NotNull<T = Same>serde_withadapter inrs/hang/src/catalog/mod.rs: absent staysNone(with#[serde(default)]),nullis refused, and it wraps the existing adapters (NotNull<DisplayFromStr>,NotNull<Hex>,NotNull<Number>,NotNull<MillisCeil>), which a field-leveldeserialize_somecould not.Option<...>adapters;MillisCeil's optional form (jitter, delay) refusesnullitself while still reading0as absent.rs/hang/fixtures/catalog-parity.jsongains 70 cases: one per optional or defaulted field of every video, audio, text, json, binary, include, color, and video-section schema (generated by introspecting the JS zod schemas, so no field is missed), plusprojection.fov, rootversion, and an accepted case showing an unknown extension field inside a rendition may still benull.Choices made without asking (confirmed by the maintainer, 2026-11-16)
m2ts.muxRaterefusesnulltoo. Them2tssection is Rust-only (not in the draft or JS), but its root member already refusesnull, so its field follows the same rule.Colortakes a container-level#[serde(default)]instead of one per field, since every field is optional andColorderivesDefault.Validation
just test -p hang shared_parity_fixtureson the old code failed 60 of the 69 new refusal cases (Rust accepted them); the other 9 (interlaced,enabled,preference,container,role,version) were already refused.just test -p hang -p moq-mux2258/2258 pass;bun testofjs/hangparity (361 cases) andjs/publishbroadcast tests (which load the same fixture) pass.Catalog::from_str+check_renditions. Rust and JS agreed on all 440.just check: everything passes except one@moq/nettest,a reset Announce Stream closes moq-lite-07 with PROTOCOL_VIOLATION, which hit its 5 s timeout under the full parallel run and passes alone in 319 ms; this PR touches no JS net code.Impact
Public API: none (
NotNullispub(crate)). Wire: a catalog withnullin an optional field the draft defines, which JS already refuses, is refused by Rust too. Serialization is unchanged: absent fields are still omitted, never written asnull.Caused by
No single PR: serde reads
nullasNonefor everyOptionfield, so this is as old as the catalog structs. moq-dev/moq#8920 fixed only the root sections andmedia(found by reviewer).Follow-ups
None.
Models
Size: S
Implementer: Claude Code, claude-opus-5-5, unknown effort (arm A)
Implementer: Claude Code, claude-sonnet-5-5, unknown effort (iterate, S, arm B)
🤖 Generated with Claude Code
Review
Rewritten by
quest reviewafter each round.Head: 03f198d
Base: origin/main at 8231b31
Risk: medium,
the base has no RISK.md to name what is always high or customer-facing, so every change is mediumClassified: medium by default
Reviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a1e6d9-ba36-7041-8c96-5f8acfaa846d, round 2Score: 9/10,
The new head only merges upstream changes, introduces no new actionable defects in the previously reviewed change, and remains covered by parity fixtures, though tests were not run as instructed.Rounds: 2; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none