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

Incorrect progress after download canceled #100

Open
dreamerblue opened this issue Dec 7, 2019 · 4 comments
Open

Incorrect progress after download canceled #100

dreamerblue opened this issue Dec 7, 2019 · 4 comments

Comments

@dreamerblue
Copy link

dreamerblue commented Dec 7, 2019

When I canceled the download by downloadItem.cancel():
Firstly, onCancel triggered.
Secondly, onProgress triggered with progress 0 and progress on dock icon is almost completed.
WX20191207-112607@2x

Reproduction

  1. Download and pass some callbacks like this:
    onStarted(item) {
      item.on('updated', (event, state) => {
        if (state === 'interrupted') {
          item.cancel();
        }
      });
    },
    onProgress({ percent, transferredBytes, totalBytes }) {
      console.log('progress', percent)
    },
    onCancel(item) {
      console.log('canceled', item);
    }
  1. Wait a moment and turn off WiFi.

Expected Behavior

After onCancel, no onProgress triggered and the dock icon progress should be hidden.

@sindresorhus
Copy link
Owner

// @dated

@dated
Copy link
Contributor

dated commented Dec 8, 2019

hey @dreamerblue, could you do me the favour of checking if this issue also appears on version 1.14.0?

@dreamerblue
Copy link
Author

Yes, after download canceled, onProgress calls with progress = NaN.

@dated
Copy link
Contributor

dated commented Dec 9, 2019

Thanks for checking! It's probably a duplicate of #76 then 🤔

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

No branches or pull requests

3 participants