Repository navigation
fix: download queue scheduling and stuck states - #302
Merged
Merged
Conversation
The starting guard in kick() was initialized to false and never armed, so a frontend command could start a transfer before recovery reset interrupted jobs. Arm it at construction; start() clears it after recovery and then kicks the queue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DGbCKVdcUfJfjZ93bYY9p3
A pending update whose game was removed or whose folder is missing made the download policy sync fail, which stopped and restarted the queue in a loop. Mark only that update as failed with the reason instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DGbCKVdcUfJfjZ93bYY9p3
The staging task notified the policy loop even when it did nothing, so while extraction or an update install was deferred the two woke each other in a tight loop, scanning processes and emitting frontend events. Notify only after staging, installing or a persisted failure; deferred work is retried on the policy tick. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DGbCKVdcUfJfjZ93bYY9p3
A staging error raised before extraction started left the job downloaded with an error, which is never scheduled again and could not be retried, cancelled or removed. Retry now clears the error so the archive is staged again, and removal is allowed once no staging task holds the job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DGbCKVdcUfJfjZ93bYY9p3
3 tasks done
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.
What changed?
Four download queue fixes from the review, one commit each:
startingguard now startstrue;kick()is a no-op untilstart()finishes recovery and clears it. Thetest_appfixture clears it so existing tests are unaffected.syncfail and the queue restart in a loop: indownload_policy::sync, an unavailable target (game removed or folder unreadable) now fails only that game's update jobs ("Update target is unavailable: ...") and interrupts a running transfer; other jobs continue.downloadedjob with an error was stuck: Retry clears the error and re-runs staging; Remove is allowed when no staging task is active. FrontendcanRetryDownload/canRemoveDownloadupdated; Remove still goes through the confirmation dialog.Known limits (follow-ups):
remove_gamedoes not refuse while updates are pending; ifsyncfails for other reasons (e.g. DB error)run_queuestill restarts without backoff; this state still can't be cancelled, only retried or removed.No textual conflicts with #301 (checked with
git merge-tree).Validation
cargo test967 passed, 0 failed, 4 ignored; clippy and fmt clean.npm run check,npm run lint,npm run test:launcher(15) pass.kick_waits_for_startup_recovery,removed_update_target_fails_only_its_job,idle_staging_does_not_wake_the_policy,removes_a_downloaded_entry_after_staging_failed,retry_stages_a_downloaded_entry_after_staging_failed.UI changes
Retry and Remove are now shown for downloaded jobs whose staging failed.
Generated by Claude Code