Uppy: The `complete` event gets activated on lost internet connectivity

Created on 30 May 2020  路  2Comments  路  Source: transloadit/uppy

When using the Dashboard and the uppy.on('complete',... event going offline and back online activates the complete event without having done/uploaded anything.

Expected Behavior

On connectivity lost, the upload would stop, show an error or something alike and on re-connect not activate the complete event.

Current Behavior

After re-connecting from an previous offline state, the complete event gets activated.

Possible Solution

Probably some error handling connectivity issues in the complete event?

Steps to Reproduce

Using the Dashboard and an upyy.on('complete...` event listener:

  1. Get the Dashboard
  2. Go offline
  3. Go back online -> complete event get's activated

Context (Environment)

  1. React
  2. Using:
    "@uppy/core": "1.10.4",
    "@uppy/react": "1.6.5",
    "@uppy/tus": "1.5.12",

With the config;

const uppy = Uppy({
  autoProceed: true,
  allowMultipleUploads: true,
  debug: false,
  restrictions: {
    maxFileSize: 1000000,
    maxNumberOfFiles: null,
    minNumberOfFiles: null,
    allowedFileTypes: null
  },
  meta: { type: 'upload' },
  restrictions: { maxNumberOfFiles: 1 }
})
uppy.use(Tus, {
  endpoint: TUS_ENDPOINT
})

Dashboard:

 <Dashboard
   uppy={uppy}
   height={180}
   showProgressDetails
   proudlyDisplayPoweredByUppy={false}
   width='100%'
   note={note}
   inline
 />
Bug Core

Most helpful comment

Luckily we can mitigate this further by not actually doing the upload job when there were no files to retry, #2361 馃槃

All 2 comments

So this is probably because of the autoRetry option. It defaults to true and retries failed uploads when the internet connection is back up. I'm hoping to deprecate then remove it in https://github.com/transloadit/uppy/pull/2347 :)

What happens is that it starts a new upload job with all the files that have error states, but if there are none of those files, an empty upload job is started, and that immediately finishes.

Luckily we can mitigate this further by not actually doing the upload job when there were no files to retry, #2361 馃槃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

hikurangi picture hikurangi  路  4Comments

rrjanbiah picture rrjanbiah  路  3Comments

aleccool213 picture aleccool213  路  3Comments

risonsimon picture risonsimon  路  4Comments