Repository navigation
fix(room): one watch pipeline per tile, room audio, and chat window - #43
Conversation
Quest-Claim: 17522c5c5b85c592
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…S follows its own sound Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Maintainer decision (2026-11-25, /quest-run):
(Written by Claude Opus 5.5 with high) |
# Conflicts: # quest/m0/room-media.md
A late joiner's first frame restates the retained window, and each record ran the meme effect in turn, so a superseded /huh could play once. Read frames with the window decoder and show only each frame's newest push. Also let agents run `just dev` to validate a change on its real surface. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…UTING on just dev Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # app/src/index.tsx
|
Applied the maintainer decisions on
Merged main, including #35, #44, and #47. (Written by Claude Opus 5.5) |
|
Maintainer decision (2026-11-25, /quest-run): fix the round-4 catch-up finding. Only the first frame after joining applies just its newest message; later catch-up frames deliver every message in order. Pick stays /quest-merge. (Written by Claude Opus 5.5 with high) |
Only the first window frame after joining collapses to its newest record. A later frame restating several unseen records, as after a lost group, now delivers each in order, one event-loop turn apart so the meme effect sees a `/huh` before the text that followed it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Applied in 73a6738 (da1a6b2): (Written by 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
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. |
Finishes quest/m0/room-media.md.
Problem
@moq/room's roster opened aWatch.Playerper member (catalog, user, and preview subscriptions), and Hang opened its ownWatchBroadcastfor the same path. Neither one claimedconnection.viewers, so tiles ran ABR and probing without sharing the downlink estimate.StereoPannerNode, so they never panned.RangeError, but Chrome doesn't throw; it renders 0 → 0 → 1 (see Validation).destination, ignoring mute and speaker volume.hang/location.jsonandhang/chat.jsonwent into the UI unvalidated. Chat was a lossy snapshot, so a repeated or quickly replaced message could disappear.show="never"), and decoder failures were invisible.Approach
room/watch.ts,room/index.ts):WatchBroadcastwraps a headlessWatch.Playerwith no canvas. Video downloads while the room canvas is visible ("always"/"never"), and audio while sound is on. The player's own speaker output is held at volume 0 because Hang sendsaudio.rootthrough its spatial graph. The player claimsconnection.viewers. Hang now discovers broadcasts from the announce stream itself, using@moq/room'sparseand the same capture handling, instead ofMoqRoom, whoseMemberhard-wires a canvas player that Hang can't feed or reuse.room/audio.ts,room/sound.ts,room/tts): a sharedfade()helper does a linear ramp anchored at the current value, so muting and unmuting fade both ways. Every remote voice goes through aStereoPannerNode, which up-mixes mono. Notifications and worker TTS go throughSound.gain. Browser speech can't, sosay()skips it while muted. Meme audio races its load against the effect and stops the node on cleanup.room/metadata.ts): location and chat payloads are checked againstzod/minischemas and read withlatest(). A malformed value ends that subscription and never reaches the UI, matching@moq/room'sconsume. Snapshot tracksfinish()beforeclose(). Messages now also go out as@moq/room'sChatwindow (chattrack, advertised ashang.messages), one record per send. Typing stays onhang/chat.json. The reader decodes the window frame by frame. Only its first frame collapses to the newest record, so a late joiner's catch-up shows the latest message without replaying a superseded meme command. A later frame that restates several unseen records (after a lost group) delivers each in order, one event-loop turn apart, since signal writes coalesce and the meme effect would otherwise see only the last.sup.tsx,index.tsx,room/debug.ts): the lobby shows<moq-watch-support>and<moq-publish-support>withshow="warning". Decoderout.erroris logged, and the track debug overlay marks the failed rendition in red with its message. I dropped the unused support-element imports fromindex.tsx.app/test/setup.ts): the Bun preload stubs MoQ's Vite-only?workletimports, so app tests can import@moq/roomat runtime.Choices I made without asking:
@moq/roomchange. That change is listed under Follow-ups.Sound.gain, which plays at half the speaker volume (the same level as notifications).Impact
hang.messagesand publish thechatwindow. They still writemessageonhang/chat.json, and they read that legacy field from any broadcast whose catalog lackshang.messages. Old and new tabs keep chatting both ways, and rolling back is clean. A later quest removes the legacy field.WatchBroadcastPropsis internal.Required: m0link (quest checkrejects a link to a finished milestone).AGENTS.mdandCONTRIBUTING.mdnow let agents startjust devto validate a change on its real surface, stopping it when done.Alternatives
@moq/room'sMember: itsWatch.Playeris private and paints only to a canvas, so it can't feed Hang's WebGL renderer or audio graph without upstream API changes.Watch.Player's privateholdViewerlogic and its offline-tail logic. The headless player already has both.ChatFieldsacross the local, fake, and demo sources.setTargetAtTimefor fades: it never reaches exactly 0 within the 200 ms window, so muting would leave audible residue.Caused by
WatchBroadcastbeside@moq/room's per-member player, withoutconnection.viewers(found by person; 2026-11-25 audit).Decisions
Settled by the maintainer on 2026-11-25 (comment):
just dev, withAGENTS.mdreworded to "Startjust devonly to validate a change on its real surface, and stop it when done." (rejected: maintainer runs it, merge on checks alone)quest/m1/chat-window-only.md(rejected: drop it)@moq/roomheadless-member gap goes to moq-dev/moq's/quest-plan(rejected: track it here)Settled by the maintainer on 2026-11-25 (comment):
Validation
quest gate just check: Quest, TypeScript, Biome, API and app tests, and native checks all pass. The new tests cover a repeated chat message arriving twice, the legacymessagefield being ignored once the window is advertised, and a malformed location being rejected.quest gate just build: passes.OfflineAudioContextwith the same schedules the code uses:t=0.1 → 0,t=0.19 → 0,t=0.3 → 1(no fade, no throw).0.5,0.95,1.Sound.enabled, and the chat parse is raced against its effect.quest gate just checkpasses on0e7beb6.app/src/room/metadata.test.tspublisheshi,/huh,bye, then joins; the old reader delivered all three to the meme effect, the new one onlybye, and a later live send still arrives.quest gate just checkpasses on the merged headbf414a5.metadata.test.tscase showshi, loses its group (TooFarBehind), then gets a header restatinghi,/huh,bye. The watcher must seehi,/huh,bye. It fails onbf414a5(no/huh) and also fails with in-order delivery but no yield between records (signal writes coalesce); it passes on the fix (3/3 runs). No new live check: a delivery gap can't be forced from two tabs, and the test drives the real track and window decoder.quest gate just checkpasses after merging main (chore(infra): remove self-hosted relay deployment in favor of moq.pro #48) at73a6738.just dev, separate headless Chrome profiles with fake camera and mic, driven byagent-browser):/huhplayshuh.webmlive.alpha,/huh,omega: shows onlyomega, one notification, no meme (three runs).Follow-ups
messagefield onhang/chat.json. No open decisions./quest-planthere, which the coordinator runs):@moq/room'sRoomopens a canvas-boundWatch.Playerfor every member, so an app with its own renderer has to re-implement discovery, as Hang now does. Options: a discovery-only roster, or a headlessMemberthat exposes its player, takes avisibleinput, and can turn off speaker output. Hang would then go back toMoqRoom.Models
🤖 Generated with Claude Code
(Written by Claude Opus 5.5)
Review
Rewritten by
quest reviewafter each round.Head: 73a6738
Base: origin/main at 76d1206
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.2-sol, high effort
Session:
01a215e7-2e54-7441-86f4-29c2ce1b939b, round 5Score: 10/10,
The head preserves live commands recovered after a gap and still shows late joiners only the newest retained message.Rounds: 5; first round 3 (medium 3); findings 5 (medium 5): fixed 5, refuted 0, open 0
Findings: none
Notes, the author's to take or leave:
app/src/room/metadata.ts:398:Avoid timer throttling while draining recovered chatThe last round's findings, at bf414a5:
app/src/room/metadata.ts:389:Preserve live meme commands recovered after a delivery gap;The reader collapses only the first frame and yields between later recovered records, and the regression test asserts that the viewer receives both `/huh` and `bye` after `TooFarBehind` (`app/src/room/metadata.ts:392`, `app/src/room/metadata.test.ts:187`).