janko / uppy-s3_multipart

Provides Ruby endpoints for AWS S3 multipart uploads in Uppy
https://uppy.io/docs/aws-s3/
MIT License
65 stars 21 forks source link

Aborting a multipart upload #13

Closed janklimo closed 4 years ago

janklimo commented 4 years ago

Hi Janko, not an issue, just adding more context.

I believe your change in e1760e543b17774d57c668e5b32431f2bd90b466 actually fixed my problem with mysterious Aws::S3::Errors::NoSuchUpload errors. Here's one example.

I can replicate the problem consistently if I upload a larger file, pause it, then abort it in the Uppy dashboard.

As the error suggests:

The specified upload does not exist. The upload ID may be invalid, or the upload may have been aborted or completed.

which I think is exactly what was happening previously: abort, then try to fetch parts:

loop do
  multipart_upload.abort(**options)
  break unless multipart_upload.parts.any?
end

Looks like a good reason to release a new version 👍

janko commented 4 years ago

Thanks for the report. The previous code was supposed to be rescuing Aws::S3::Errors::NoSuchUpload, but apparently I forgot about that 😛

I just released version 0.3.3.