Repository navigation
fix(cli): say a download is starting, not queued, and what --list-files waits for - #624
Merged
Merged
Conversation
…es waits for `ketch <magnet>` printed "[Queued] Waiting for download slot..." for the whole metadata lookup, minutes for a rare torrent, though no slot was taken: Ketch reports a task getting ready as queued, without a queue position, which the apps already show as starting. The CLI now prints "[Starting] Finding peers that have the torrent's metadata..." for a magnet, "[Starting] Getting ready..." otherwise, and the position of a download that does wait for a slot. `ketch --list-files <magnet>` printed nothing at all while it waited; after three seconds it now says what for.
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. |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found while downloading magnets with the CLI.
1. "[Queued] Waiting for download slot..." during a magnet's metadata lookup
While a task gets ready (a magnet looking for its metadata, or any download resolving), Ketch reports it as
Queuedwithout a queue position. The apps already show this as "Starting" / "Finding peers" (DownloadState.isStarting). The CLI printed the same "waiting for a slot" line for every queued state, which sends users looking for a concurrency problem that doesn't exist.Now
ProgressPrinteralso followstask.queuePosition:[Queued] Waiting for download slot...[Starting] Finding peers that have the torrent's metadata...[Queued] Waiting for download slot...[Starting] Getting ready...[Queued] Waiting for download slot...[Queued] Waiting for download slot (#2)...2.
--list-fileswas silent while resolvingketch --list-files <magnet>printed nothing until peers sent the metadata, which may be never. After 3 s it now writes to stderrFinding peers that have the torrent's metadata (Ctrl+C to stop)..., orStill looking up the files (Ctrl+C to stop)...for other links. Fast resolves print nothing extra.Verification
ketchfrom this branch on a magnet with no peers prints the[Starting] Finding peers…line, and--list-filesthe notice after 3 s. An HTTP download prints[Starting] Getting ready...and then its progress.DownloadCommandTestcases:progressPrinter_queuedWithoutPosition_saysItIsStartingandlistFiles_slowResolve_saysWhatItWaitsFor(the notice delay is alistFilesparameter, so the test takes milliseconds)../gradlew :cli:test --tests '*DownloadCommandTest*'passes.