pqina / filepond

🌊 A flexible and fun JavaScript file upload library
https://pqina.nl/filepond
MIT License
15.25k stars 828 forks source link

[Bug] removeFiles() method sends additional DELETE request for chunk upload #859

Open atidivya opened 2 years ago

atidivya commented 2 years ago

Is there an existing issue for this?

Have you updated FilePond and its plugins?

Describe the bug

When using chunk upload for the vue-filepond, we use removeFiles() method to clear the queue when finished processing successfully. However, this methods also sends additional delete request to the server when it is not required.

image

image

How can we prevent this request.

My versions: "filepond": "^4.30.3", "filepond-plugin-file-validate-size": "^2.2.5", "filepond-plugin-file-validate-type": "^1.2.6", "vue": "^3.2.23", "vue-filepond": "^7.0.2",

Reproduction

In order to reproduce the issue, please try chunk upload options.

Environment

- Device: Dell XPS laptop
- OS: Windows 11
- Browser: Chrome.
rikschennink commented 2 years ago

I think you can set allowRevert to false

atidivya commented 2 years ago

Is it allowRevert or revert ? Anyways, tried my luck but still it makes a DELETE request.

source: https://pqina.nl/filepond/docs/api/instance/methods/#removing-files_

image

rikschennink commented 2 years ago

Looking at the removeFiles implementation should work, not sure why it doesn't, swamped with work so can't investigate right now

ahl-asg commented 1 year ago

This is still an issue, can there not just be added a clearFileList method? That doesn't make removeFile event run? Right now I am having to destroy the filepond instance each time, and reinitialize it to handle this issue..

z4yed commented 1 month ago

Having the same issue. The removeFile() method is triggering the revert function even if I set {revert: false}

pond.removeFile(file.id, {
    revert: false,
});

image

https://github.com/pqina/filepond/issues/143

rikschennink commented 1 month ago

@ahl-asg if you want to clear the list you can set the files property to an empty array.

rikschennink commented 1 month ago

@z4yed I just tested this but it does seem to work? https://stackblitz.com/edit/github-dngbb1?file=index.html%3AL119

z4yed commented 1 month ago

@rikschennink as per my check, it seems the issue remains while uploading chunks. Could you please check again?

rikschennink commented 1 month ago

@z4yed ah sorry, for some reason I completely missed that this was about chunks.

Can you create a similar reproduction on stackblitz but with chunks?