xhr.upload detection is failing #4560

Closed
mudcube opened this Issue Nov 10, 2015 · 5 comments

Comments

Projects
None yet
3 participants
@mudcube
Contributor

mudcube commented Nov 10, 2015

I was having trouble with uploading to my server. After 10 seconds the request would be canceled and start again. I read elsewhere about setting the ajax.timeout. This helped, but it did not deal with the core issue; during an active upload the xhr should abort unless things have stalled.

For me, the test for 'hasUpload' returns false in Firefox/Chrome on mac. Specifically it's this tidbit of code that's causing the problem. For me this returns false on all devices/browsers tested:

Object.keys(xhr).indexOf('upload') !== -1

I noticed a note in the code about how 'IE throws an error...'. Do you know the version of IE has an error with the code:

typeof xhr.upload !== 'undefined'

I tested in IE8+ via VMWare and did not have a problem.

@daleharvey

This comment has been minimized.

Show comment
Hide comment
@daleharvey

daleharvey Nov 14, 2015

Member

It is a problem with ie10 inside a service worker, #2132 has more details

Member

daleharvey commented Nov 14, 2015

It is a problem with ie10 inside a service worker, #2132 has more details

@daleharvey

This comment has been minimized.

Show comment
Hide comment
@daleharvey

daleharvey Nov 14, 2015

Member

You are right though, I am seeing that test fail in my browsers. If you could test switching it to typeof and open a PR / see if the tests complain?

Member

daleharvey commented Nov 14, 2015

You are right though, I am seeing that test fail in my browsers. If you could test switching it to typeof and open a PR / see if the tests complain?

@daleharvey daleharvey added the bug label Nov 14, 2015

@daleharvey daleharvey changed the title from Timeout on large attachment uploads (+ solution) to xhr.upload detection is failing Nov 14, 2015

mudcube added a commit to mudcube/pouchdb that referenced this issue Nov 30, 2015

@mudcube

This comment has been minimized.

Show comment
Hide comment
@mudcube

mudcube Nov 30, 2015

Contributor

@daleharvey Sorry for the delayed response I've been in Hawaii ;) Just sent in that PR.

Contributor

mudcube commented Nov 30, 2015

@daleharvey Sorry for the delayed response I've been in Hawaii ;) Just sent in that PR.

@daleharvey

This comment has been minimized.

Show comment
Hide comment
@daleharvey

daleharvey Nov 30, 2015

Member

Fixed in 0be4b4d

Member

daleharvey commented Nov 30, 2015

Fixed in 0be4b4d

@daleharvey daleharvey closed this Nov 30, 2015

@nolanlawson

This comment has been minimized.

Show comment
Hide comment
@nolanlawson

nolanlawson Dec 1, 2015

Member

There was a reason I used that fancy-schmancy Object.keys() trick - it was to avoid breaking in IE9 when emulated in IE10+. Arguably that is not enough to justify blocking this fix, though, so +1.

Member

nolanlawson commented Dec 1, 2015

There was a reason I used that fancy-schmancy Object.keys() trick - it was to avoid breaking in IE9 when emulated in IE10+. Arguably that is not enough to justify blocking this fix, though, so +1.

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