Conversation
|
Too many files changed? Review this PR in Change Stack to see how the pieces fit before you dive in. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (2)
📝 WalkthroughWalkthroughAdds a configurable max-worker-retries option threaded from config through single-connection and multi-chunk download paths, exposes a bounded NumberInput in preferences with i18n, allows unpausing tasks in Error, and normalizes JSON formatting across many package.json manifests. ChangesWorker Retry Budget Configuration
Sequence diagram (high-level request flow): sequenceDiagram
participant Config
participant RunSingleUri
participant RunMultiChunk
participant PieceWorker
Config->>RunSingleUri: supply "max-worker-retries"
RunSingleUri->>RunMultiChunk: pass max_retries
RunMultiChunk->>PieceWorker: spawn with max_retries
PieceWorker->>PieceWorker: check retry_count vs max_retries on error/EOF
Manifest formatting Normalization
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src-tauri/risuko-engine/src/engine/http.rs`:
- Around line 862-869: The code calculating max_worker_retries may truncate a
large u64 when casting to u32; modify the chain that builds max_worker_retries
so you clamp the u64 value into the u32 range before casting (e.g. apply
.max(1).min(u64::from(u32::MAX)) on the u64 and only then cast to u32), keeping
the existing fallback to CHUNK_MAX_RETRIES and the initial parsing logic on
options.get("max-worker-retries").
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 4608a221-7520-48b7-8769-6e4a9686f2aa
📒 Files selected for processing (22)
packages/risuko-app/package.jsonpackages/risuko-cli/npm/darwin-arm64/package.jsonpackages/risuko-cli/npm/darwin-x64/package.jsonpackages/risuko-cli/npm/linux-arm64-gnu/package.jsonpackages/risuko-cli/npm/linux-x64-gnu/package.jsonpackages/risuko-cli/npm/win32-arm64-msvc/package.jsonpackages/risuko-cli/npm/win32-x64-msvc/package.jsonpackages/risuko-cli/package.jsonpackages/risuko-js/npm/darwin-arm64/package.jsonpackages/risuko-js/npm/darwin-x64/package.jsonpackages/risuko-js/npm/linux-arm64-gnu/package.jsonpackages/risuko-js/npm/linux-x64-gnu/package.jsonpackages/risuko-js/npm/win32-arm64-msvc/package.jsonpackages/risuko-js/npm/win32-x64-msvc/package.jsonpackages/risuko-js/package.jsonsrc-tauri/risuko-engine/src/engine/http.rssrc-tauri/risuko-engine/src/engine/manager.rssrc-tauri/risuko-engine/src/engine/options.rssrc/renderer/components/Preference/Basic.vuesrc/shared/configKeys.tssrc/shared/locales/en-US/preferences.tssrc/shared/locales/zh-CN/preferences.ts
There was a problem hiding this comment.
3 issues found across 22 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src-tauri/risuko-engine/src/engine/manager.rs (1)
2390-2396:⚠️ Potential issue | 🟠 Major | ⚡ Quick winError→unpause moves torrent tasks into a non-runnable state.
At Line 2392, torrents resumed from
Errorare set toWaiting. But this file only drives torrent runtime/resolver paths forActivetorrents, andtry_start_nextdoes not activate waiting torrents, so these tasks can stay stuck.Suggested minimal fix
- let was_error = task.status == TaskStatus::Error; is_torrent = task.kind == TaskKind::Torrent; - if is_torrent && !was_error { + if is_torrent { task.status = TaskStatus::Active; } else { task.status = TaskStatus::Waiting; }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src-tauri/risuko-engine/src/engine/manager.rs` around lines 2390 - 2396, The resume logic currently sets a resumed torrent (task.kind == TaskKind::Torrent) that was in Error back to Waiting, which prevents torrent runtime/resolver paths from running; update the branch in the code around the TaskStatus handling so that if is_torrent is true and was_error is true (i.e., task.kind == TaskKind::Torrent && task.status was TaskStatus::Error) you set task.status = TaskStatus::Active instead of Waiting; adjust the conditional around task.status assignment near the existing variables (was_error, is_torrent) so torrents resumed from Error become Active and ensure this change aligns with try_start_next expectations.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@src-tauri/risuko-engine/src/engine/manager.rs`:
- Around line 2390-2396: The resume logic currently sets a resumed torrent
(task.kind == TaskKind::Torrent) that was in Error back to Waiting, which
prevents torrent runtime/resolver paths from running; update the branch in the
code around the TaskStatus handling so that if is_torrent is true and was_error
is true (i.e., task.kind == TaskKind::Torrent && task.status was
TaskStatus::Error) you set task.status = TaskStatus::Active instead of Waiting;
adjust the conditional around task.status assignment near the existing variables
(was_error, is_torrent) so torrents resumed from Error become Active and ensure
this change aligns with try_start_next expectations.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 83c1485a-0958-4b46-8387-530dc7b07be2
📒 Files selected for processing (2)
src-tauri/risuko-engine/src/engine/http.rssrc-tauri/risuko-engine/src/engine/manager.rs
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src-tauri/risuko-engine/src/engine/manager.rs (1)
2386-2396: 🧹 Nitpick | 🔵 Trivial | 💤 Low valueUnused variable
was_error.The variable
was_erroris declared on line 2390 but never used. This appears to be dead code—possibly a leftover from a removed conditional, or intended for differentiated logging/events that wasn't implemented.If the distinction between "resume from Paused" vs "retry from Error" isn't needed for logging or event emission, remove the variable to avoid confusion.
🧹 Suggested cleanup
if task.status == TaskStatus::Error { task.error_code = None; task.error_message = None; } - let was_error = task.status == TaskStatus::Error; is_torrent = task.kind == TaskKind::Torrent;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src-tauri/risuko-engine/src/engine/manager.rs` around lines 2386 - 2396, The local variable was_error is declared but never used; remove the dead variable declaration (was_error) from the block that checks TaskStatus::Error and sets task.status, leaving the existing logic that clears task.error_code/error_message and updates task.status based on task.kind (TaskKind::Torrent) and TaskStatus::Active/Waiting so no behavior changes occur.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@src-tauri/risuko-engine/src/engine/manager.rs`:
- Around line 2386-2396: The local variable was_error is declared but never
used; remove the dead variable declaration (was_error) from the block that
checks TaskStatus::Error and sets task.status, leaving the existing logic that
clears task.error_code/error_message and updates task.status based on task.kind
(TaskKind::Torrent) and TaskStatus::Active/Waiting so no behavior changes occur.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 549ad02f-2c93-41ba-9c65-a90c688ccf2c
📒 Files selected for processing (1)
src-tauri/risuko-engine/src/engine/manager.rs
Summary by cubic
Adds a per-worker max retry setting for HTTP downloads, used by both multi-piece workers and the single-connection path. Users can set
max-worker-retries(1–20, default 5) in Preferences or config to improve stability on flaky links.New Features
max-worker-retriesfor single-connection and multi-piece workers.max-worker-retries.Bug Fixes
Written for commit c1357bc. Summary will update on new commits.
Summary by CodeRabbit
New Features
Localization
Chores