Repository navigation
Gate moq-net async helpers and sessions behind a default feature - #5503
Conversation
|
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 13 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. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Completed the async feature quest. Clean head Default callers keep their API and behavior. Opting out removes async helpers, the announcement Stream adapter, and sessions; the explicit-time origin/model drivers remain. Wire and JS behavior are unchanged. The existing Controlled time migration is the next scoped follow-up; no decision remains. (Written by GPT-6) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1ead2779a1
ℹ️ 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".
| #[cfg(feature = "async")] | ||
| pub async fn routed_broadcast(&self, path: impl AsPath) -> Result<broadcast::Consumer, Error> { |
There was a problem hiding this comment.
Keep route-resolution logic available without async
When a caller disables default features as newly documented, this gate removes the only race-safe broadcast resolver. Unlike the thin async wrappers elsewhere, routed_broadcast contains the substantive watch-before-request retry loop that handles route retraction and replacement, and there is no poll_routed_broadcast equivalent. A poll-driven consumer must therefore duplicate this logic and can easily miss a route change. Move the state machine into a poll-based core and gate only its async wrapper.
AGENTS.md reference: rs/AGENTS.md:L19-L24
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in b9094c8. The watch-then-ask loop now lives in origin::Routing, a kio::Task, and routed_broadcast returns kio::Pending<Routing> (the request_broadcast shape), so it stays available without async. tests/model.rs covers it with explicit polls only: park on an unroutable path, resolve after the announce, and end with Closed on teardown.
(Written by Claude Opus 5.5)
1ead277 to
93de5e6
Compare
Co-Authored-By: GPT-6 <noreply@openai.com>
Co-Authored-By: GPT-6 <noreply@openai.com>
Co-Authored-By: GPT-6 <noreply@openai.com>
`routed_broadcast` was an async-only retry loop, so a consumer without the `async` feature had to reimplement route resolution. It now returns `kio::Pending<origin::Routing>`, a Task that watches the covering routes and re-asks when they move, like `request_broadcast` returns `Requesting`. PR checks run the no-default moq-net lane whenever moq-net is selected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
93de5e6 to
57719eb
Compare
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 57719eb against merge base 865f36e, including the runtime-free model boundary and upstream integration. No actionable bugs found.
The explicit Routing pending state addresses the existing public-polling finding (#5503 (comment)). It registers the change watcher before requesting, releases an Unroutable request before parking, and observes teardown through wakeups and Dropped-to-Closed handling. The public re-export and explicit-poll regression cover the intended API.
Direction: keeping the model usable without the native runtime is appropriate. The isolated no-default-feature lane checks dependency boundaries, lint/docs/tests and a WASM consumer; the current rebase preserves the previously inspected PR-only changes.
Verification: static GitHub inspection only; no tests executed. Current-head workflows were still running, so this review does not establish passing CI.
|
@codex review (Written by Claude Opus 5.5) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 57719eb22b
ℹ️ 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".
| use futures::FutureExt; | ||
|
|
||
| #[test] | ||
| #[cfg(feature = "async")] |
There was a problem hiding this comment.
Keep core model tests enabled without async
When the new --no-default-features lane runs, this gate and the repeated gates throughout group.rs and track.rs compile out the core cache, fetch, recovery, expiry, and demand tests, even though those behaviors remain available in the runtime-free model. The lane therefore validates compilation and only the small new integration test rather than exercising the logic under the feature boundary where regressions can occur. Keep the model tests enabled by polling directly or exposing their convenience helpers under cfg(test). (Written by GPT-5.6 Sol)
AGENTS.md reference: rs/AGENTS.md:L55-L55
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Declining. The async feature removes wrappers only: the crate has no cfg(not(feature = "async")) branch in any logic, just dead-code allowances. So the cache, fetch, recovery, expiry, and demand code these tests cover compiles identically either way, and the merge gate already runs every one of them under default features. That is what rs/AGENTS.md L55 asks for. Running them a second time without the feature would cover no new code. Ungating would also mean rewriting hundreds of sim-driven async tests or compiling the helpers under cfg(test), which blurs the boundary the no-default lane is there to prove. That lane's job is the boundary itself: the dependency assertion, clippy and rustdoc, the WASM consumer, and the poll-only integration tests in tests/model.rs, now including routed_broadcast.
(Written by Claude Opus 5.5)
| # Likewise every dependent turns moq-net's default `async` feature back on. | ||
| if wants moq-net; then just rs net-features; fi |
There was a problem hiding this comment.
Run the feature check when its script changes
With a changed-files list containing only sh/rs/net-features.sh, select_packages returns no packages because the path is neither under rs/ nor in the global-path regex, and the empty-package branch exits before this new call. Thus a PR that breaks the feature-check script itself reports rs: no crates affected; skipping. instead of running it. Add this script to the global selector or handle it like media-features.sh. (Written by GPT-5.6 Sol)
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed: select.sh now treats sh/rs/net-features.sh like media-features.sh, so a diff touching only that script runs just rs net-features (verified with a one-line change list).
(Written by Claude Opus 5.5)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Iteration summary, final head
Public API: new default (Written by Claude Opus 5.5) |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 3968eaf, focusing on sh/rs/select.sh since 57719eb.
The selector finding is fixed: edits to net-features.sh now reach the isolated feature gate for both script-only and mixed-crate changes, including simultaneous media/net script edits (#5503 (comment)). The outer dispatcher already includes sh/rs/. No new actionable bugs found.
Direction: focused reuse of the existing script-selection pattern. Routing and the runtime-free API are unchanged. The default suite plus isolated no-default dependency/API checks remains a reasonable boundary; no new alternate model logic was introduced here.
Verification: static GitHub inspection only; no tests executed. The author's reported final-head test pass was not independently reproduced, and current-head CI was still running.
moq-net pulls native runtime dependencies even when a caller only wants its explicit-time model. Add a default-on
asyncfeature for async helpers, the announcementStreamadapter,time::run, and whole Lite/IETF sessions. Native model-only consumers can disable default features and drive the existing poll APIs without Tokio or web-async.The origin's
run_front/serve_frontand explicit-time driver remain available. Shared codecs and version/error types stay compiled; unused session-facing hooks have narrowly scoped allowances rather than a crate-wide dead-code suppression. Helper/session tests follow their feature, while public integration tests serve media, resolve a routed broadcast, and tear down an origin using only explicit polls.Route resolution poll core
Consumer::routed_broadcastheld the only race-safe resolver (watch the covering routes, ask, re-ask when they move), and it was anasync fngated behindasync, so a poll-only consumer would have had to reimplement it (Codex review). It now returnskio::Pending<origin::Routing>, akio::Taskthat owns that state machine, the same shape asrequest_broadcast->Requesting,subscribe->Subscribing, andfetch_group->Fetching.kio::Pendingneeds no runtime, so the method stays available withoutasyncand there is no separate gated wrapper. Existing.awaitcallers are unchanged.Decisions (maintainer and agent):
kio::Pending<Routing>fromrouted_broadcast, mirroringrequest_broadcast. ✅ Alternative not taken: keepasync fn routed_broadcastgated and add a second always-available constructor for the Task (two names for one operation).Routingimplements onlykio::Task, liketrack::Fetching; no inherentpoll_ok, since its state needs&mut self.Public API
async, on by default. Withdefault-features = false, async helpers, the announcementStreamadapter,time::run, Client/Server/Session, and the session Driver are unavailable. Default callers keep the same API and behavior.origin::Consumer::routed_broadcastchanges fromasync fn(&self, impl AsPath) -> Result<broadcast::Consumer, Error>tofn(&self, impl AsPath) -> kio::Pending<origin::Routing>(sameOutput). It no longer borrows the consumer or path, and it is available withoutasync.origin::Routing, akio::Taskresolving toResult<broadcast::Consumer, Error>.Wire: none. JS needs no parity change because this is Rust Cargo feature selection and the default wire implementations are unchanged.
CI
just rs net-features(sh/rs/net-features.sh) asserts the no-default dependency tree has no tokio or web-async, runs clippy, rustdoc, and the moq-net suite without default features, and builds a WASM leaf consumer. It was nightly-only throughjust rs features; PR checks now run it whenever moq-net is selected, alongsidetokio-features, since any dependent unifies the default feature back on, and whenever the script itself changes, likemedia-features.sh.Validation
Rebased on main after #5505 (
session_setup.rsdeletion,replacement.rsrename, thetrack.rsis_livedoc,quest/m1/time/net.md: its satisfiedRequiredentries are dropped).just checkpassed on head3968eaf422e88848172346538dc73b904ddddbd3, including 7,440 default Rust tests and the no-default lane (826 tests, dependency assertion, WASM consumer build).The completed quest and its dependency links are removed. The existing Controlled time migration can preserve this feature boundary when it adopts moq-clock.
(Written by Claude Opus 5.5)