-
Notifications
You must be signed in to change notification settings - Fork 144
fix: Download manager button breaks when one of multiple tasks completes #3573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,4 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| using Microsoft.VisualBasic.CompilerServices; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| using Microsoft.VisualBasic.CompilerServices; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| using PCL.Core.App; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| using PCL.Core.Utils; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| using System.Collections; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -43,8 +43,7 @@ public static void LoaderTaskbarProgressRefresh() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var newProgress = LoaderTaskbarProgressGet(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // 若单个任务已中止,或全部任务已完成,则刷新并移除 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| foreach (var Task in loaderTaskbar) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (loaderTaskbar.All(l => l.State != ModBase.LoadState.Loading) || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Task.State == ModBase.LoadState.Waiting || Task.State == ModBase.LoadState.Aborted) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (Task.State != ModBase.LoadState.Loading) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When one task fails while another remains loading and the task-manager page has not yet been opened, this condition removes the failed task immediately and Useful? React with 👍 / 👎. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ModMain.frmSpeedLeft?.TaskRefresh(Task); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| loaderTaskbar.Remove(Task); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
43
to
49
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (bug_risk): 触发条件: 当一个任务完成时,其他任务栏任务仍在加载且它们的进度不同时。 建议修复: 在计算
Suggested change
Original comment in Englishissue (bug_risk): Triggers: When one task completes while other taskbar tasks are still loading and their progress differs. Suggested fix: Remove non-loading tasks before calculating
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: 该注释表示只有在某个任务中止或所有任务都完成时才会移除任务,但新条件会移除任何不是
Loading状态的单个任务,包括其他任务仍处于活动状态时的Waiting、Failed和Finished任务。该注释现在错误地描述了方法的行为。建议修复: 更新注释,说明每个非
Loading状态的任务都会被刷新并移除。Original comment in English
nitpick: The comment says tasks are removed only when one task is aborted or all tasks are complete, but the new condition removes any individual task that is not
Loading, includingWaiting,Failed, andFinishedtasks while other tasks remain active. The comment now gives an incorrect description of the method's behavior.Suggested fix: Update the comment to state that every non-
Loadingtask is refreshed and removed.