Ver código fonte

Postpone timeout countdown until upload has started, i.e. has left browser concurrency queue (fixes transloadit#1190)

Davi Lima 6 anos atrás
pai
commit
6af0b03b3b
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      packages/@uppy/xhr-upload/src/index.js

+ 2 - 2
packages/@uppy/xhr-upload/src/index.js

@@ -210,12 +210,12 @@ module.exports = class XHRUpload extends Plugin {
 
       xhr.upload.addEventListener('loadstart', (ev) => {
         this.uppy.log(`[XHRUpload] ${id} started`)
-        // Begin checking for timeouts when loading starts.
-        timer.progress()
       })
 
       xhr.upload.addEventListener('progress', (ev) => {
         this.uppy.log(`[XHRUpload] ${id} progress: ${ev.loaded} / ${ev.total}`)
+        // Begin checking for timeouts when progress starts, instead of loading,
+        // to avoid timing out requests on browser concurrency queue
         timer.progress()
 
         if (ev.lengthComputable) {