transloadit / uppy

The next open source file uploader for web browsers :dog:
https://uppy.io
MIT License
29.19k stars 2.01k forks source link

`Complete` event is not fired if one or more files are removed before they are uploaded using XHRUpload #5366

Open Eleana92 opened 3 months ago

Eleana92 commented 3 months ago

Initial checklist

Link to runnable example

No response

Steps to reproduce

Try to upload a large amount of files and remove one or more files from the end of the queue that have not been uploaded yet.

    const uppy = Uppy(
        {
            autoProceed: true,
            debug: true
        }
    ).use(Dashboard,
        {
            inline: true,
            target: '#uppy',
            hideUploadButton: true,
            hideRetryButton: true,
            hidePauseResumeButton: true,
            hideCancelButton: true,
            proudlyDisplayPoweredByUppy: false,
            disableThumbnailGenerator: true,
            showRemoveButtonAfterComplete: true
        })
        .use(XHRUpload, {
            endpoint: 'https://your-domain.com/upload',
            fieldName: 'file'
        });

    uppy.on('complete', (result) => {
        console.log('complete');
        console.log('successful files:', result.successful);
        console.log('failed files:', result.failed);
    });

Expected behavior

The complete event should be fired after the remaining files have been uploaded.

Actual behavior

The complete event is not called in this case, although the upload is normally executed and there is feedback that it is successfully complete in the UI. dashboard If one or more files are removed AFTER they have been uploaded, the event is executed as expected.

BluesYoung-web commented 2 months ago

I also encountered the same bug.

Murderlon commented 1 month ago

Hi, I tried multiple times and with exactly your options but I can't reproduce this.

Eleana92 commented 1 month ago

Hi, I tried multiple times and with exactly your options but I can't reproduce this.

I created a minimal project in php for demonstration, if you would like to try it. I added some delay between uploads so a huge amount of files is not necessary to test it.

Uppy.zip