Skip to content
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

Fix download pausing/resume click behaviour #1713

Merged

Conversation

waldo121
Copy link
Contributor

Fixes #1712

I simply chose to move a responsability out of the Download Progress Action back to the ipc controller.

Copy link

codecov bot commented Sep 29, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 64.49%. Comparing base (280327b) to head (9f9e5d3).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
packages/app/app/actions/downloads.ts 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1713      +/-   ##
==========================================
- Coverage   64.50%   64.49%   -0.01%     
==========================================
  Files         392      392              
  Lines        8404     8405       +1     
  Branches      765      766       +1     
==========================================
  Hits         5421     5421              
  Misses       2323     2323              
- Partials      660      661       +1     
Flag Coverage Δ
64.49% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@nukeop
Copy link
Owner

nukeop commented Sep 29, 2024

I don't get why'd this change anything, but if you say this fixes the problem, I'm grateful.

@nukeop nukeop merged commit 669db8f into nukeop:master Sep 29, 2024
10 checks passed
@waldo121
Copy link
Contributor Author

For the record, DOWNLOAD_PROGRESS can be emitted after the download stops due to being paused. So we can imagine the following sequence.

  1. A download is in progress
  2. User clicks on pause -> 1st status change -> item goes from 'started' -> 'paused'
  3. (No more user action) DOWNLOAD_PROGRESS gets sent now -> 2nd status change -> completion is updated -> item goes from 'paused' => 'started' (assuming download is not finished) -> ui is lying

After the fix,
DOWNLOAD_PROGRESS handler is not responsible to decide a download is correctly 'started'. So the progress event still happens but has no unexpected impact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pausing a download leads to incorrect ui.
2 participants