Repository navigation
feat(guests): play the fast return feed on the guest page - #393
Conversation
|
This PR looks like part of a multi-PR dependency stack for the low-latency fast return feed: it depends on #386 (build the fast return feed), which should land first. Holding off on automated review/merge here — this needs a human (or the relevant dev agent) to assess the whole stack together, not a per-PR pass. Nothing further is needed from the author; this comment exists so the dependency is recorded on the PR rather than in a run log. |
Conflicts from 6ad0d3f (fast feed follows a mixer read) resolved to Eyevinn#386's side: Eyevinn#386's direct-outs refactor replaced that approach and removed fast-feed-state.
4c92a25 to
3ee1b42
Compare
|
Claude (Claude Code, for @wagenet): rebased onto #386's new head (
|
3ee1b42 to
9ffe849
Compare
|
Claude (Claude Code, for @wagenet): unstacked from #386 and rebased onto The page only reads the join response's
|
|
Claude (Claude Code, for @wagenet): pushed |
|
Claude (Claude Code, for @wagenet): pushed |
483e2ad to
1107b0f
Compare
|
Claude (Claude Code, for @wagenet): pushed Leave and page close now send the return DELETEs and the guest session DELETE at once, with no wait, no timer and no once-only flag. Page close uses main's Correction to my last comment: I wrote that a page close after a Leave sends a second session DELETE "as on main". That was wrong. Main sends none, and that second DELETE could end a session the same invite had opened in another tab. It is gone in The cost: the return DELETEs are best-effort. If the server handles the session DELETE first, it refuses them, and those WHEP sessions last until Strom times them out, as the picture session always does on main. Ending the guest's return sessions inside the server's session DELETE would remove that and is a possible follow-up.
|
|
Claude (Claude Code, for @wagenet): pushed |
|
This PR is part of the low-latency return-feed feature on Members:
Nothing further is needed from the author; this records the dependency on the PRs themselves. |
birme
left a comment
There was a problem hiding this comment.
pr-reviewer verdict: APPROVE
Prior findings
| # | Source | Finding | Status |
|---|---|---|---|
| 1 | birme stack-flag (x2) |
PR is part of the low-latency fast-return-feed stack; hold for whole-stack human/dev-agent assessment | DROPPED — informational hold, not a change request. Since then the author unstacked the branch (rebased onto main, single logical change) and it merges independently of #386; the stack concern no longer applies. |
| 2 | wagenet status notes |
once-only session-DELETE flag could drop a page-close session DELETE; 121cc41/1107b0f removed it; return+session DELETEs now fire at once, best-effort |
FIXED — current head (1107b0f logic) matches main's DELETE semantics; guarded by tests. |
No formal gh reviews or inline review comments exist on the PR. No OPEN rows.
Verification against real source (head d005c43)
- Join-response contract is real, not fabricated.
src/routes/guests.tsjoin handler buildsfeedsas objects withid/url(video: trueon picture), plusreturnModeanddefaultMode: 'program-minus'. The page reads exactly these fields (feed.id,feed.url,joinData.returnMode || joinData.defaultMode). No invented fields. - No
fastfeed on main. On currentmain,feedsonly ever contains thepictureentry (or[]). Thefastfeed is added by #386, which has not landed — matching the PR body. - Graceful degradation confirmed.
playReturns()selects byidviafindFeed. With nofastfeed:fastAvailable = false,routeReturnAudio(mode)setsreturnVideo.muted = false/returnAudio.muted = true, and only the picture WHEP session is opened — picture plays with its own audio, no error path. AfastWHEP failure falls back the same way (.catch→fastAvailable = false; routeReturnAudio(audioMode)). - Tests cover the fallback.
guest-page-returns.test.tsincludes "plays the picture feed with its own audio when there is no fast feed" (no-fast path) and "unmutes the picture's audio when the fast feed fails" (failure path), feeds-by-id in either order, aprogramjoin, crew/guest mode switches, and Leave/page-close DELETE ordering with stalled/failing DELETEs.
Local quality gates (open-live: typecheck, build, vitest; no lint)
pnpm typecheck: cleanpnpm build(tsc): cleanpnpm test: 1159 passed (116 files)
CI
build-and-test: pass.
Merge
Head is behind current main but git merge-tree shows no conflicts; the diff vs origin/main touches only guest-page.ts and the 3 test files, so no server contract changes. No Closes #N reference. Safe to merge standalone on current main.
APPROVE — the no-fast-feed fallback is genuinely safe (id-based selection, picture-audio default, failure caught) and is directly tested.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
|
This PR's branch now has a real merge conflict with |
|
This PR's branch is behind |
When the join lists a `fast` feed, the guest page plays its audio on a second, audio-only PeerConnection. The feeds stay on separate PeerConnections so the browser cannot lip-sync the fast audio back to the picture. The fast feed is always mix-minus, so it is heard only in `program-minus`; in `program` the guest hears the picture's audio and the fast feed stays connected, muted. The return-mode switch decides which: a change the guest picks, or one the crew makes and the poll picks up, moves the audio between the feeds. If the fast feed fails, the picture's audio is unmuted. On leave and page close, the page deletes both return WHEP sessions before the guest session, since the invite token stops authorizing return routes once the session is gone. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Leave and page close send the return feeds' DELETEs and then the guest session DELETE straight away, without waiting for answers. A return DELETE that never answers, or that fails at once, does not delay or stop the guest session DELETE. A page close after a Leave sends no second guest session DELETE, unless a late join made the page live again. The return DELETEs are best-effort: if the server handles the guest session DELETE first, it refuses them, and those WHEP sessions last until Strom times them out. Tests cover a return DELETE that never answers or fails at once, a page close after a Leave, and the DELETE order on page close. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The join lists the picture feed first, so no test caught the page picking feeds by position. A join that lists the fast feed first now does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ee388fb to
78d8201
Compare
There was a problem hiding this comment.
pr-reviewer verdict: APPROVE
Reviewed at 78d8201b8bc60234fda1e67cdd67e13a87f4f565; approval submitted on the refreshed head e8e32a986049a8b499bb94cb4fa64a8d56dd9953, which adds only Merge branch 'main' commits. CI is green on this head.
Prior findings
| # | Source | Finding | Status |
|---|---|---|---|
| 1 | wagenet self-review (2026-10-09, 121cc41) |
Once-only session-DELETE flag (df30dc1) could stop a page close from ending a session a late join re-created |
FIXED: flag removed and replaced by 1107b0f, carried in a8c0c74. leave()/pagehide call closeReturns() then endSession() with no wait (src/routes/guest-page.ts:1132); covered by src/__tests__/guest-page-returns.test.ts:346 |
| 2 | wagenet self-review (2026-10-09, df30dc1) |
Leave waited on the return DELETEs, so a stalled one blocked the session DELETE | FIXED: a8c0c74 fires the return and session DELETEs at once, best-effort (guest-page.ts:839, :1132); tests guest-page-returns.test.ts:321, :366, :385 |
| 3 | wagenet (2026-10-09, 2dfd56c) |
No test caught feeds being picked by position | FIXED: 78d8201 adds guest-page-returns.test.ts:232; findFeed at guest-page.ts:796 |
| 4 | automation branch-blocked reason:conflict (2026-10-22) / reason:workflow-scope (2026-10-23) |
Branch conflicted with / was behind main |
FIXED: rebased onto 67fe32b. 67fe32b..main touches no .github/ files, and automated Update branch has now succeeded |
| — | automation stack-flag (2026-10-01, 2026-10-12) |
Stack/dependency hold with #386 | Not a change request. The author unstacked onto main on 2026-10-09, and the PR merges independently of #386 (verified below). This review clears that hold |
| — | Earlier legacy review (COMMENTED, APPROVE at d005c43) |
No blocking findings | Stale; re-judged at the current head |
No OPEN rows.
Verification against source (head trial-merged with main 9d6307d)
- The join contract is real.
src/routes/guests.ts:747-775buildsfeeds: [{ id: 'picture', url, ... }],defaultMode: 'program-minus'andreturnMode. The page reads exactly these fields, matchingdocs/specs/guest-calling-intercom.md§"Return feeds". - Fallback with no
fastfeed (main today) is graceful.playReturns(guest-page.ts:804) picks feeds by id. With no fast feed,fastAvailable = false, the picture plays unmuted, and only one WHEP session is opened. A failed fast WHEP falls back to the picture's audio (:830). Tested atguest-page-returns.test.ts:205and:279. - The return-session DELETE route exists on main.
returns.ts:356is token-authed and only lets a guest end their own session. CSPconnect-src 'self'is unchanged. - Behaviour change on main (positive): Leave, page close and Rejoin now DELETE the picture WHEP session instead of leaving it for Strom to time out.
Security (external contributor, extra scrutiny)
No new HTML sinks (textContent only), CSP unchanged, no server-side source changes, no secrets, dependencies or workflow changes. Commits carry Co-Authored-By trailers.
Quality gates
Trial merge with main is clean. pnpm install --frozen-lockfile, pnpm run typecheck and pnpm run build pass; npx vitest run: 1730 passed (162 files). CI build-and-test passes.
Warnings (non-blocking; only matter once #386 lists a fast feed)
- Spec divergence (dormant): the spec makes
low-latency-minusa mode the guest chooses. This page plays the fast feed automatically inprogram-minuswhenever one is listed. Settle this in #386's spec update before #386 merges. - The fast PeerConnection is not watched for later failure. Consider a connection-state watch when #386 lands.
Nits
- With
feedsnon-empty but no usablepictureentry, a return-only slot no longer shows the "Return feed not available yet" hint. This can't happen with main's join shape.
|
No fast feed is listed yet (#386 not deployed), so this checks the fallback only: the guest hears the return picture's audio, the program-minus/program switch changes what the guest hears, and Rejoin restores the return. Verified on a fresh beta instance (Strom v0.8.0) on 2026-11-08. Validated by Magnus. Not yet in a release (after v0.7.0). |
Opened by Claude (AI) on Peter Wagenet's behalf.
Based on
mainand merges independently of #386. Until #386 (and its Strom dependencies) are deployed, join responses list nofastfeed, so the page plays the picture feed only.What
The guest page (
src/routes/guest-page.ts) plays the fast return feed that #386 adds to the join response.id, not by position.<audio>element. A shared PeerConnection would let Chrome lip-sync it back to the picture and lose the ~500 ms saving.routeReturnAudio, which picks what the guest hears (table below). A muted fast feed stays connected, so switching back is instant.program-minusprogram-minusprogramThe fast feed is always mix-minus, so a guest in
programmust hear the picture's audio to hear themselves.Tests
guest-page-returns.test.tsruns the page script in a VM with fake DOM, fetch and RTCPeerConnection. It covers picture-only and picture + fast joins, feeds listed in either order, aprogramjoin, mode changes by the guest and the crew, a failed fast feed, and Leave and page close with stalled or failing DELETEs.guest-page-connection.test.tsadds a Rejoin with both feeds.guest-page-returns.test.tsfail. The other 4 pin main's session DELETE counts on Leave and page close.routeReturnAudionot called fromapplyReturnAudio; Rejoin closing only the picture; the fast session not deleted; Leave waiting before the session DELETE, or sending the return DELETEs after it; a second session DELETE on a page close after a Leave; a DELETE that throws stopping Leave.pnpm typecheck: ok.pnpm test: 1088 passed (109 files).Known limits
These apply only once a
fastfeed is listed.program-minusuntil they switch modes.End-to-end run (on an earlier version)
Headless Chrome against a local Strom with strom#844, two
lowLatencyguests inprogram-minus, before #386's current router, main's mode switch and the/api/v1/guestsfeed URLs. Each page opened WHIP, picture and fast PeerConnections; each guest's fast feed carried the other guest's tone with the picture's audio muted; Leave and tab close DELETEd picture, fast, then session (all 204). Autoplay was forced on, so Safari/iOS playback is unverified.🤖 Generated with Claude Code