refile / refile-s3

Amazon S3 Backend for Refile
MIT License
36 stars 88 forks source link

Fix for the case with cache and store located in different buckets #9

Closed senotrusov closed 1 year ago

senotrusov commented 9 years ago

Hello!

In case with cache and store located in different buckets, the copy_source must refer to correct bucket_name.

On the side note, thank you for refile, it is a very solid and straightforward piece of technology!

mrede commented 8 years ago

Is anyone maintaining this repo anymore? I've just spent/wasted a few hours trying to fix this bug, fix it then find a PR almost identical to mine!

kimesf commented 5 years ago

I couldn't replicate any errors by using different buckets for cache and store. I used a personal project and set up two s3 buckets with my AWS account to test it out.

Apparently, everything worked just fine.

I manage to upload attachments normally. Even if I tried to submit a form with errors, the attachment would stay cached and be saved normally after the resubmit with the errors fixed.

At all times, my cache bucket had only the cache paste and my store one only the store paste.

I'm not sure if I got the problem right here though.

senotrusov commented 5 years ago

The error was for sure present at the time I wrote that patch. I still have code in production that use it.

Did you upload the file through your server? I'm not sure if it may affect anything but I use direct uploads to the S3 from the client (web browser).

Let me see if I could isolate the error, I'll get back to you soon.

kimesf commented 5 years ago

I did indeed uploaded the file through my server. I'm gonna look into it using direct uploads.

kimesf commented 5 years ago

Tonight I finally managed retrying to replicate any errors. Apparently, when you're using different buckets, it doesn't just promote the attachment from cache to store.

I'm not sure yet, but it appears to be uploaded again. I had to use a bigger file to realize it, it just takes forever if you compare to using the same bucket.

This week I'm gonna try to create specs for this.

sobrinho commented 5 years ago

@KimEmmanuel any news on that?