Repository navigation
Conversation
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 09f525d4a9
ℹ️ 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".
| discover: suspend (SendChannel<PeerEndpoint>) -> Unit, | ||
| body: suspend (TorrentV2DownloadSession) -> T, | ||
| ): T = coroutineScope { | ||
| require(layout.infoHash == document.info.hash && peerId.size == 20) |
There was a problem hiding this comment.
Bind the session to the document's full layout
For hybrid metainfo, this check accepts TorrentContentLayout.from(document.info) even though the store derives its canonical layout with document.hybrid. If a subset includes a file whose v1 index differs because of padding entries, requireBinding succeeds using the store's IDs, but resume later stops when the scheduler rejects that ID against the non-hybrid layout. Validate the complete layout or construct it from the document internally before starting the session.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in d72fce5. Session admission now compares the supplied layout against storage's canonical hybrid-aware layout, including file IDs/indices, offsets/lengths, piece length, and protocol/payload totals. The selected-file-after-padding regression failed before the guard and passes afterward. The child engine slice constructs the canonical hybrid layout and downloads that selected file over real TCP. Combined validation passes 613 JVM tests, 592 executed iOS simulator tests, the native-runtime guard, and both existing v1 conformance scenarios.
|
Superseded by #238 (V2 engine lifecycle, rate controls and restart recovery) in the consolidated eight-PR stack for #162. The replacement preserves this PR's code and subsequent fixes; its description links the original head and review discussions. The only additional consolidation fix is the CI-discovered listener cancellation regression, documented on the replacement. All eight replacements have passed their required CI checks. Closing without merging. This branch and its discussions remain available for reference. Review index: #162 (comment) |
Adds a scoped owner for the full-metainfo v2 download pipeline. Pause and shutdown join discovery, dial workers, peer actors, and storage commits before acknowledging completion or releasing lifetime admission. Resume rechecks owned payloads before discovery, so files modified while paused cannot retain verified progress. Failures can be retried without overlapping terminal jobs.
The owner validates metadata identity and selection against storage before I/O, and progress comes from verified storage. Tests include real TCP download/repair after paused-file modification, delayed discovery cleanup, repeated failure/retry, pre-I/O selection rejection, and shutdown admission ordering.
Stacked on #226 for #162. This is the lifecycle prerequisite for engine registration; public v2 resolution, incoming full-identity routing, checkpoint/TaskStore wiring, rate controls, discovery integration, and seeding remain roadmap work. It does not advertise public v2 capability. The TCP peer is a Ketch fixture, so this is not independent v2 interoperability evidence.
Validation: full JVM and executed iOS simulator suites, native-runtime dependency guard, and the existing two Transmission v1 conformance scenarios.