transloadit / uppy

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

`getUploadParameters` being called for remote provider with s3 #4601

Open mifi opened 1 year ago

mifi commented 1 year ago

Initial checklist

Link to runnable example

No response

Steps to reproduce

Expected behavior

only /drive/get should be called when clicking Upload, because we don't need s3 params on the client.

Actual behavior

Observe that GET /s3/params gets called before /drive/get:

Screenshot 2023-07-25 at 11 13 32

This is due to getUploadParameters being called here regardless of whether it's a remote file or not: https://github.com/transloadit/uppy/blob/15245833e9270a5d7733974b85931e3a2fc2b40b/packages/%40uppy/aws-s3/src/index.js#L204

we should instead call it inside here (after isRemote check):

https://github.com/transloadit/uppy/blob/15245833e9270a5d7733974b85931e3a2fc2b40b/packages/%40uppy/aws-s3/src/index.js#L290

...alternatively just throw the old s3 plugin in a fire in the next major version of uppy (I think we're planning on that anyways?)

subvertallchris commented 7 months ago

I think I am encountering the same error. Multi-part uploads work fine but others (small files) do a GET /s3/params that fails. I'm going to use multi-part for all uploads for the time being.