Skip to content

fix(cli): moq play drops its Update workaround now that follow reports gaps - #5205

Merged
kixelated merged 1 commit into
mainfrom
fix/play-update-workaround
Oct 10, 2026
Merged

kixelated merged 1 commit into
mainfrom
fix/play-update-workaround

Conversation

@kixelated

@kixelated kixelated commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

moq play started playback on an announce Update while nothing was playing. That branch existed only because origin::Consumer::follow used to fold a same-epoch handoff from the exact route to a covering prefix into an Update, hiding the gap that ended the old request. #5188 fixed that in moq-net: follow now reports End then Start, which the player already handles.

Approach

Drop the idle-Update branch. Every Update is again the same instance re-priced or failed over, which a playing run rides out and an idle player has nothing to do with.

Tests:

Impact

  • Public API and wire: none.
  • Behavior: an Update never starts playback.

Alternatives

  • Keep reviving an idle player on Update so an Unroutable start retries on a servability flip (Codex review). Rejected: only the #[cfg(test)] advertise-only route can answer Unroutable for lack of a server, and retrying on re-pricing reintroduces the ambiguity this removes.

Follow-ups

None.

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

…s gaps

origin::Consumer::follow reports a gap onto a same-epoch covering prefix as an
End then a Start (#5188), so playing an Update while idle is no longer needed.
The idle covering-route test is the regression: it fails without #5188 once
the workaround is gone. A new test plays through an exact-to-prefix handoff
while the old run still holds its delay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-10T15:20:38.967100Z d9f9bf6 PR opened
🔒 Security Review ✅ Completed 2026-10-10T15:19:58.798224Z d9f9bf6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Automated review of d9f9bf62

Small, correct cleanup: with #5188 merged (moq-net follow now reports End then Start across a same-epoch handoff), the idle-Update branch in rs/moq-cli/src/play/media.rs is dead weight, and removing it makes Update mean one thing again. No blocking issues.

Non-blocking:

  • The new test a_handoff_to_a_covering_route_plays_on_while_draining passes with or without fix(moq-net): a followed path reports a gap onto a same-epoch prefix #5188, as the body says, so it guards against a regression in the drain path but not in the gap reporting. That's fine as long as the moq-net follow tests from fix(moq-net): a followed path reports a gap onto a same-epoch prefix #5188 stay the real pin; worth a one-line comment in the test pointing at them so nobody later reads it as the regression test.
  • The new test spawns a requested_broadcast loop task that's never joined or aborted; under paused time it's harmless, but holding the JoinHandle and aborting it before the final drop would keep the test from leaking a task if the harness is reused.
  • If some other origin path (not follow) can still fold a gap into an Update, an idle player now waits forever instead of playing. I couldn't see one in this diff; a quick check that Update is only emitted for same-instance re-pricing/failover would close it.
  • CI (Check, Test, macOS, Windows) was still pending at review time.

Verdict: MERGE

This is an automated review, not the maintainer's decision
(Written by Grok)

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Automated review by review (OpenAI)

Reviewed commit: d9f9bf6

No actionable bugs found in the full diff and relevant surrounding code. Direction is sound: rs/moq-cli/src/play/media.rs:81–86 now relies on the existing follow contract instead of treating an idle Update as a new start. I traced the current follower's same-epoch gap handling and the origin cursor's preserved retract/reannounce sequence; both retain the End/Start path that restarts playback.

The idle regression at media.rs:775–813 and handoff test at media.rs:820–860 cover complementary cases. As the PR and independent review note, the new test checks reaching the covering route with buffered playback; it does not by itself pin coalesced-gap reporting. The deterministic follow_keeps_a_gap_between_routes_of_one_epoch test covers that contract. No extra retry mechanism or broader refactor appears necessary.

Verification: GitHub-only source review and event tracing. I did not execute tests or verify end-to-end playback/CI results.

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 41641eb0-b7ea-4570-9131-a5a95a41fa07


📥 Commits

Reviewing files that changed from the base of the PR and between e5446b0 and d9f9bf6.



📒 Files selected for processing (1)
  • rs/moq-cli/src/play/media.rs


Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.




Walkthrough

Media.play no longer starts playback from an update event when idle. The tests cover a same-epoch covering route announced after a gap and playback reaching audio from a covering route after the exact route is withdrawn.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to d9f9b

This change removes a workaround from the CLI player and adds tests for idle playback after a gap and for handoff to a covering route. No concrete merge-blocking risk was found.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files.
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.
Title check Passed The title clearly and concisely identifies the main change: removing the moq play Update workaround.
Description check Passed The description directly explains the problem, implementation, tests, behavior impact, and relation to #5188. It is fully related to the changeset.

✨ Finishing Touches
✨ Simplify code
  • Commit to this branch
  • Create a new PR



  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d9f9bf6202

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// folded away (a covering route of one epoch arriving as the exact one
// went), so play it.
AnnounceEvent::Update(announce) if playing.is_none() => announce,
AnnounceEvent::Update(_) => continue,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Retry an idle player when an Update makes the route usable

When the initial Start races an advertise-only route or its handler, Source::broadcast() can fail with Unroutable, and the result branch leaves playing as None. The origin deliberately emits an Update when servability changes so failed requests can retry (rs/moq-net/src/model/origin.rs:1117-1119), but this unconditional continue discards that recovery signal, leaving playback blank until an unrelated restart occurs. Preserve recovery for an idle player or use the origin's routed resolution behavior for the initial subscription.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Not changing this. An advertise-only route (server: None, source: None) is only built by origin::Producer::announce, which is #[cfg(test)]. Every production route serves what it claims: broadcast::Producer::announce carries its source, and origin::Producer::dynamic (what both the lite and IETF subscribers use for peer announces) carries a server. So a Start never lands on a route that answers Unroutable for lack of a server, and the servability flip in origin.rs cannot strand a player outside tests.

Reviving an idle player on every Update would also retry on arbitrary re-pricing, which is the ambiguity this PR removes: an Update is the same instance, and a gap is End then Start since #5188.

(Written by Claude Opus 5.5)

@kixelated
kixelated enabled auto-merge October 10, 2026 15:27
@kixelated

Copy link
Copy Markdown
Collaborator Author

Merge summary

  • Change: moq play drops its idle-Update workaround now that fix(moq-net): a followed path reports a gap onto a same-epoch prefix #5188 makes follow report a same-epoch handoff gap as End then Start. No public API or wire change; an Update never starts playback.
  • Reviews on d9f9bf62: OpenAI and CodeRabbit found nothing actionable. Codex raised one P2 (retry an idle player on a servability Update); replied and not changed, since only the test-only advertise-only route can produce that Unroutable. Grok's notes are non-blocking.
  • Docs: doc/bin/cli.md already describes playback starting on announce and waiting through an end; no change needed.
  • PR body restructured to the CONTRIBUTING sections. No code changes since the reviewed head.

Auto-merge armed on d9f9bf620269fbfd5c5307e20de383f797e6299f.

(Written by Claude Opus 5.5)

@kixelated

Copy link
Copy Markdown
Collaborator Author

Merging. Head d9f9bf620 removes the idle-Update branch in moq play, renames the idle covering-route test as the regression (it fails without #5188), and adds a drain-through-handoff test that the description calls out as not a true regression.

Reviews of this head: the OpenAI review and CodeRabbit found nothing. Codex raised one P2, a retry on a servability-flip Update, which was declined in-thread: advertise-only routes exist only in tests, and every production route serves what it claims. Grok's notes are non-blocking. Check, Test, macOS, and Windows are green.

(Written by Claude Opus 5.5)

@kixelated
kixelated added this pull request to the merge queue Oct 10, 2026
Merged via the queue into main with commit 65a4379 Oct 10, 2026
5 checks passed
@kixelated
kixelated deleted the fix/play-update-workaround branch October 10, 2026 15:43
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