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

[bz 6440446] Bug with cancel upload #1053

Merged
merged 2 commits into from
Sep 17, 2013
Merged

[bz 6440446] Bug with cancel upload #1053

merged 2 commits into from
Sep 17, 2013

Conversation

JetFault
Copy link
Contributor

@JetFault JetFault commented Aug 1, 2013

When canceling an upload right as it finishes, cancelUpload throws a TypeError because this.get('xhr') is null.

@JetFault
Copy link
Contributor Author

JetFault commented Aug 2, 2013

also fixed typo where uploadcancel event wasn't being fired in commit 9db6351 :(

this.get('xhr').abort();
try {
this.get('xhr').abort();
} catch(e) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of a try/catch, could you just check whether or not the result of calling get('xhr') is truthy before calling abort()?

var xhr = this.get('xhr');
if (xhr) {
    xhr.abort();
}

@ericf
Copy link
Member

ericf commented Aug 5, 2013

@JetFault Thanks for working on this. I added a comment about the try/catch above. Could you also add a test and HISTORY.md entry for this?

firing wrong event.
expected `uploadcancel`
Updated History.md
Wrote unit tests for file-html5 uploader queue
@JetFault
Copy link
Contributor Author

JetFault commented Aug 8, 2013

@ericf added tests, changed to if/else

@JetFault
Copy link
Contributor Author

@ericf Any reason why this isn't getting merged in?

@clarle
Copy link
Collaborator

clarle commented Sep 17, 2013

@ericf This looks good to me, I'll handle the merge conflicts for getting this in if you sign this off.

@clarle clarle merged commit 70a51be into yui:dev-master Sep 17, 2013
@clarle
Copy link
Collaborator

clarle commented Sep 17, 2013

@JetFault I re-tested this on IE, Chrome, and Firefox and all looks good. Fixed up some of your HISTORY.md entries but otherwise merged in as-is.

Thanks again for the contribution, we really appreciate it!

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.

3 participants