Use Catalog.Consumer in native JS smoke client#10
Conversation
@moq/hang 0.2.10 dropped the catalog fetch/decode helpers; the catalog
module is now schema-only. The native subscriber was the sole user of
Catalog.fetch and broke with "Catalog.fetch is not a function" once the
latest-pinned package floated to 0.2.10.
Read the catalog frame directly and validate it against RootSchema via
zod/mini (which 0.2.10's schema now targets), replacing the removed
helper. Verified locally against moq-relay: rust -> js-native-{node,bun}
both pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@moq/hang re-adds Catalog.Consumer (moq#1767), a thin wrapper over @moq/json's snapshot+delta Consumer pre-wired with RootSchema. Switch the native subscriber from the manual frame-parse stopgap to the supported API: construct a Catalog.Consumer over the catalog.json track and pull catalog updates via next() until one carries a video track. This also picks up catalog deltas, which the one-shot frame read ignored. Verified the runtime path against a local moq-relay + rust publisher using @moq/json's Consumer + RootSchema directly (what Catalog.Consumer wraps): catalog resolved, video track found, frames received. NOTE: requires the @moq/hang release that ships Catalog.Consumer to be published to npm; until then the latest-pinned install (0.2.10) has no Consumer and the smoke run stays red. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughIn 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
Updates the native JS smoke subscriber (clients/js-native/subscribe.ts) to resolve the
.hangcatalog viaCatalog.Consumerinstead of the removedCatalog.fetchhelper.Why
The scheduled Smoke run went red on every channel with
Catalog.fetch is not a function. The harness pins@moq/hangtolatest, which floated to 0.2.10 — that release made@moq/hang/catalogschema-only and dropped thefetch/decode/encodehelpers. The native subscriber was the sole consumer ofCatalog.fetch, so it was the only client that broke (the others use native bindings with their own catalog APIs). This is exactly the upstream-API drift the freshness test exists to catch.@moq/hang0.2.11 (moq#1767) re-addsCatalog.Consumer, a thin wrapper over@moq/json's snapshot+deltaConsumerpre-wired withRootSchema. Switching to it also picks up catalog deltas, which a one-shot frame read would miss.No new dependency is needed: 0.2.11 declares
@moq/jsonas a dependency, so it's pulled transitively.Verification
Ran the real smoke harness locally against the published
@moq/hang@0.2.11(no patching/shims) with amoq-relay+ rust ffmpeg publisher:Notes for reviewers
@moq/hang>= 0.2.11 on npm (now live). The next scheduled smoke run will pick it up.Catalog.ConsumerAPI now that 0.2.11 is out.🤖 Generated with Claude Code