Skip to content

Port the native-JS client to @moq/net 0.2 + @moq/hang 0.3#23

Merged
kixelated merged 1 commit into
mainfrom
claude/js-native-net-0.2
Jul 24, 2026
Merged

Port the native-JS client to @moq/net 0.2 + @moq/hang 0.3#23
kixelated merged 1 commit into
mainfrom
claude/js-native-net-0.2

Conversation

@kixelated

Copy link
Copy Markdown
Contributor

Follow-up to #21/#22. The native-JS subscriber was written against @moq/net 0.1.x / @moq/hang 0.2.x; the published @moq/net 0.2.0 + @moq/hang 0.3.0 changed the subscribe API, so it hung and every * -> js-native-node/bun cell failed.

Four breaking changes handled

  1. announced(prefix) paths are now relative to the prefix. We pass the exact broadcast as the prefix, so the matching entry's path is "" and the old Moq.Path.hasPrefix(path, entry.path) guard was never true → the wait loop spun until timeout. Any active entry under an exact prefix is our broadcast.
  2. Broadcast.subscribe(name, priority)subscribe(name, options?) — the bare priority number is now { priority }.
  3. @moq/hang dropped Catalog.Consumer — read the Catalog.TRACK (catalog.json) frames directly and validate each JSON snapshot with Catalog.RootSchema.
  4. Group.readFrame() resolves to a Frame { payload, timestamp }, not raw bytes — decode/measure frame.payload.

Validation

Ran the harness locally against moq-relay + the real published packages, both runtimes:

  PASS  python -> js-native-node
  PASS  python -> js-native-bun

(written by Opus 4.8)

The published @moq/net (0.2.0) and @moq/hang (0.3.0) changed the subscribe API
out from under this client, so it hung/errored and every * -> js-native-* cell
failed. Four changes:

- announced(prefix) now yields entries whose path is RELATIVE to the prefix.
  We pass the exact broadcast as the prefix, so the old
  Moq.Path.hasPrefix(path, entry.path) guard was never true and the wait loop
  spun forever. Any active entry under an exact prefix is our broadcast.
- Broadcast.subscribe(name, priority) became subscribe(name, options?), so the
  bare priority number is now { priority }.
- @moq/hang dropped the Catalog.Consumer helper; read the Catalog.TRACK frames
  directly and validate each JSON snapshot with Catalog.RootSchema.
- Group.readFrame() resolves to a Frame { payload, timestamp }, not raw bytes,
  so decode/measure frame.payload.

Validated end-to-end against moq-relay + the published packages: both
`python -> js-native-node` and `python -> js-native-bun` pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @kixelated, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@kixelated, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ebf6f33c-4e89-4c79-b073-c7b63f13378c

📥 Commits

Reviewing files that changed from the base of the PR and between 638a257 and 2ccdabb.

📒 Files selected for processing (1)
  • clients/js-native/subscribe.ts
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch claude/js-native-net-0.2

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kixelated
kixelated merged commit 8136d1c into main Jul 24, 2026
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant