Skip to content

[codex] update moq packages - #27

Merged
kixelated merged 2 commits into
mainfrom
codex/update-moq-packages
Jul 6, 2026
Merged

[codex] update moq packages#27
kixelated merged 2 commits into
mainfrom
codex/update-moq-packages

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Summary

  • update the app and API MOQ packages to the latest released npm versions
  • add an app-side metadata adapter using custom @moq/json tracks for user, location, chat, and preview data
  • migrate local publishing, remote watching, preview members, and related types to the new MOQ catalog/custom-track surface

Validation

  • bun run --filter="*" check
  • bun run --filter="*" build

Note: just check was not available in this shell because just is not installed.

@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

@kixelated
kixelated marked this pull request as ready for review July 6, 2026 20:50
@kixelated
kixelated enabled auto-merge (squash) July 6, 2026 21:02
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 46 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

Run ID: 772b7ba4-7c81-4c76-a6ab-0656211abeaf

📥 Commits

Reviewing files that changed from the base of the PR and between 75a0c53 and a8510b9.

📒 Files selected for processing (3)
  • dev/justfile
  • justfile
  • native/justfile

Walkthrough

This PR upgrades several @moq/* package dependencies and introduces a new metadata.ts module in app/src/room that defines signal-backed metadata structures (user, location, chat, preview) and two factory functions: createPublishBroadcast and createWatchMetadata. It also introduces HangPublishBroadcast as a replacement type for Publish.Broadcast throughout the app. Consumers including room/index.ts, room/local.ts, room/locator.ts, room/broadcast.ts, room/watch.ts, room/fake.ts, room/preview/member.ts, and UI components (meme-selector.tsx, profile.tsx, controls.tsx) are updated to use these new types and helpers. WatchBroadcast is refactored to compose location/chat from the new metadata helper, and preview/member.ts now dynamically discovers preview tracks via the catalog instead of a fixed track name.

Changes

Cohort / File(s) Change Summary
Dependency bumps (api/package.json, app/package.json) Updated @moq/token, @moq/hang, @moq/lite, @moq/publish, @moq/signals, @moq/watch versions
New metadata module (app/src/room/metadata.ts) Adds Metadata types, HangPublishBroadcast, createPublishBroadcast, createWatchMetadata, subscribeJson, type aliases
Room/broadcast wiring (room/index.ts, room/local.ts, room/locator.ts, room/broadcast.ts) Replaces Publish.Broadcast typing with HangPublishBroadcast; local.ts uses createPublishBroadcast factory
Watch integration (room/watch.ts) WatchBroadcast composes location/chat via createWatchMetadata; user data and close() sourced from #metadata
Preview member (room/preview/member.ts) Dynamic preview track discovery from catalog; replaces fixed preview.json subscription with Json.Consumer
UI/fake type updates (meme-selector.tsx, profile.tsx, controls.tsx, fake.ts) Adopts HangPublishBroadcast and local Position/User types

Sequence Diagram(s)

sequenceDiagram
  participant Local
  participant createPublishBroadcast
  participant PublishBroadcast
  participant WatchBroadcast
  participant createWatchMetadata

  Local->>createPublishBroadcast: construct broadcast with metadata props
  createPublishBroadcast->>PublishBroadcast: attach user/location/chat/preview signals
  createPublishBroadcast-->>Local: HangPublishBroadcast

  WatchBroadcast->>createWatchMetadata: initialize with broadcast + props
  createWatchMetadata->>PublishBroadcast: subscribeJson per catalog track
  createWatchMetadata-->>WatchBroadcast: Metadata (location, chat, user)
Loading

Related PRs: None specified.

Suggested labels: dependencies, refactor, room

Suggested reviewers: None specified.

Poem

A rabbit hops through code anew,
Where broadcasts once were plain, now true—
Metadata signals hum and flow,
Catalog tracks now dynamic grow.
HangPublishBroadcast leads the way,
Old Publish types now fade away. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and matches the main change: updating MOQ packages.
Description check ✅ Passed The description clearly matches the dependency updates and metadata migration shown in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch codex/update-moq-packages

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.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🧹 Nitpick comments (2)
app/src/room/preview/member.ts (2)

81-88: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate ExtendedCatalog type risks drifting from the canonical definition.

app/src/room/metadata.ts already defines an equivalent ExtendedCatalog = CatalogRoot & { hang?: HangCatalog } shape (with HangCatalog/TrackRef covering user/location/chat/preview) that createWatchMetadata relies on for the same hang.preview.track extraction. This file re-declares a narrower, local copy instead of importing it. If the metadata.ts shape changes (e.g., TrackRef gains a field), this local copy won't be caught by the type checker and could silently diverge.

Consider exporting the shared ExtendedCatalog/HangCatalog/TrackRef types from metadata.ts and importing them here instead of redefining locally.

♻️ Proposed refactor sketch
-type ExtendedCatalog = Catalog.Root & {
-	hang?: {
-		preview?: {
-			track: string;
-		};
-	};
-};
+import type { ExtendedCatalog } from "../metadata";

(requires exporting ExtendedCatalog from app/src/room/metadata.ts)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/src/room/preview/member.ts` around lines 81 - 88, The local
ExtendedCatalog type in member.ts duplicates the canonical shape already defined
in metadata.ts, so update this file to import and reuse the shared
ExtendedCatalog/HangCatalog/TrackRef types instead of redefining them. Export
the shared types from createWatchMetadata’s module if needed, and keep the
hang.preview.track access working through the imported definition so future
shape changes stay type-checked in one place.

48-53: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Extract a named preview priority constant
0 is valid, but a local PREVIEW_PRIORITY constant would make the intent explicit and keep track priorities self-documenting.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/src/room/preview/member.ts` around lines 48 - 53, The preview
subscription in Member’s signals effect uses a raw numeric priority, which hides
intent. Extract that `0` value into a local named constant such as a preview
priority near the `this.broadcast.subscribe(previewTrack, 0)` call, and use that
symbol in the subscription so the priority is self-documenting and easy to
update.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/src/room/watch.ts`:
- Around line 119-121: The watch metadata flow still exposes toggles in
WatchBroadcastProps that are not actually used by createWatchMetadata or
downstream watch behavior. Either wire location.window.enabled,
location.peers.enabled, chat.typing.enabled, and preview.enabled into the
watch-side logic in createWatchMetadata/broadcast.ts, or remove those unused
fields from the contract and keep only the toggle(s) that still affect behavior
such as chat.message.enabled.

---

Nitpick comments:
In `@app/src/room/preview/member.ts`:
- Around line 81-88: The local ExtendedCatalog type in member.ts duplicates the
canonical shape already defined in metadata.ts, so update this file to import
and reuse the shared ExtendedCatalog/HangCatalog/TrackRef types instead of
redefining them. Export the shared types from createWatchMetadata’s module if
needed, and keep the hang.preview.track access working through the imported
definition so future shape changes stay type-checked in one place.
- Around line 48-53: The preview subscription in Member’s signals effect uses a
raw numeric priority, which hides intent. Extract that `0` value into a local
named constant such as a preview priority near the
`this.broadcast.subscribe(previewTrack, 0)` call, and use that symbol in the
subscription so the priority is self-documenting and easy to update.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cd766c99-850f-47a1-856f-cf81d0e28575

📥 Commits

Reviewing files that changed from the base of the PR and between 1a8d7b5 and 75a0c53.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (13)
  • api/package.json
  • app/package.json
  • app/src/components/meme-selector.tsx
  • app/src/components/profile.tsx
  • app/src/controls.tsx
  • app/src/room/broadcast.ts
  • app/src/room/fake.ts
  • app/src/room/index.ts
  • app/src/room/local.ts
  • app/src/room/locator.ts
  • app/src/room/metadata.ts
  • app/src/room/preview/member.ts
  • app/src/room/watch.ts

Comment thread app/src/room/watch.ts
Comment on lines +119 to +121
this.#metadata = createWatchMetadata(this.#broadcast, props);
this.location = this.#metadata.location;
this.chat = this.#metadata.chat;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Inspect createMetadata to see if it uses the enabled sub-flags
rg -n -B2 -A 40 'function createMetadata' app/src/room/metadata.ts

Repository: moq-dev/hang.live

Length of output: 1628


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== watch.ts: createWatchMetadata and consumers =="
rg -n -B3 -A80 'createWatchMetadata|`#runLocation`|`#runChat`|`#runPreview`|hang\.location|hang\.chat|hang\.preview|enabled' app/src/room/watch.ts app/src/room/broadcast.ts

echo
echo "== metadata.ts: createMetadata shape =="
rg -n -B3 -A30 'function createMetadata|type MetadataProps|interface MetadataProps|type Metadata|interface Metadata' app/src/room/metadata.ts

echo
echo "== any direct use of enabled flags in room code =="
rg -n 'location\.(window|peers)\.enabled|chat\.(message|typing)\.enabled|preview\.enabled' app/src/room

Repository: moq-dev/hang.live

Length of output: 19580


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== createWatchMetadata =="
rg -n -B4 -A120 'function createWatchMetadata|createWatchMetadata\(' app/src/room/metadata.ts app/src/room/watch.ts

echo
echo "== all enabled-flag consumers in room code =="
rg -n 'location\.window\.enabled|location\.peers\.enabled|chat\.message\.enabled|chat\.typing\.enabled|preview\.enabled|user\.enabled' app/src/room

echo
echo "== watch/broadcast metadata propagation =="
rg -n -B2 -A25 'metadata\.|this\.location =|this\.chat =|this\.user =|this\.preview =|this\.video =|this\.audio =' app/src/room/watch.ts app/src/room/broadcast.ts app/src/room/metadata.ts

Repository: moq-dev/hang.live

Length of output: 14686


Wire the remaining watch toggles or remove them from the contract app/src/room/metadata.ts:265-305

createWatchMetadata subscribes on hang.* presence only; location.window.enabled, location.peers.enabled, chat.typing.enabled, and preview.enabled are still exposed in WatchBroadcastProps but have no effect on the watch-side metadata flow. Only chat.message.enabled still gates behavior downstream in broadcast.ts.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/src/room/watch.ts` around lines 119 - 121, The watch metadata flow still
exposes toggles in WatchBroadcastProps that are not actually used by
createWatchMetadata or downstream watch behavior. Either wire
location.window.enabled, location.peers.enabled, chat.typing.enabled, and
preview.enabled into the watch-side logic in createWatchMetadata/broadcast.ts,
or remove those unused fields from the contract and keep only the toggle(s) that
still affect behavior such as chat.message.enabled.

@kixelated
kixelated merged commit ba6ae0b into main Jul 6, 2026
2 checks passed
@kixelated
kixelated deleted the codex/update-moq-packages branch July 6, 2026 21:36
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