Skip to content

fix: update isCreate logic for pending tasks#1314

Merged
monkeyWie merged 2 commits into
GopeedLab:mainfrom
Roxym3:fix/auto-rename-wait-status
Mar 18, 2026
Merged

fix: update isCreate logic for pending tasks#1314
monkeyWie merged 2 commits into
GopeedLab:mainfrom
Roxym3:fix/auto-rename-wait-status

Conversation

@Roxym3
Copy link
Copy Markdown
Contributor

@Roxym3 Roxym3 commented Mar 16, 2026

Problem

The isCreate flag in doStart was ignoring tasks in Wait status. This caused the AutoRename logic to be skipped when a task moved from the queue to the running state, leading to file overwrites.

Solution

  • Included base.DownloadStatusWait in the isCreate logic.
  • Added task.Progress.Downloaded == 0 check to prevent accidental renames on resumed tasks.

Impact

Fixes #1286.

@Roxym3 Roxym3 requested a review from monkeyWie as a code owner March 16, 2026 09:19
@monkeyWie
Copy link
Copy Markdown
Member

This condition is still not cautious enough, it is recommended to add an isCreated flag to indicate whether the task has created a file, otherwise the paused task will create a new file if it re-enters the waiting state

@monkeyWie
Copy link
Copy Markdown
Member

LGTM, but just keep downloader.go and model.go commits

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.03%. Comparing base (09f7c88) to head (3ed9e8e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1314      +/-   ##
==========================================
- Coverage   71.05%   71.03%   -0.03%     
==========================================
  Files          49       49              
  Lines        6519     6521       +2     
==========================================
  Hits         4632     4632              
- Misses       1459     1461       +2     
  Partials      428      428              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Roxym3 Roxym3 force-pushed the fix/auto-rename-wait-status branch from 0d74adb to cae0abc Compare March 18, 2026 07:24
@monkeyWie monkeyWie added the bug Something isn't working label Mar 18, 2026
@monkeyWie monkeyWie merged commit 3d20e81 into GopeedLab:main Mar 18, 2026
11 of 12 checks passed
@monkeyWie
Copy link
Copy Markdown
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Automatic file renaming for duplicate file names does not work when queuing multiple files for download and instead overwrites existing files

2 participants