New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible data corruption and data loss since 2.0 #2544
Comments
fsateler
added a commit
to fsateler/carrierwave
that referenced
this issue
Mar 17, 2021
This commit attempts to fix leftover files in failed transactions, but in the process introduces three problems: - Uploader state is inconsistent between `save` and `commit`. For example, reading `my_object.file_url.url` will return a bogus url if I read before commit. - A file might not be uploaded after a successful commit. For example, if there is a network failure. This causes the transaction to not be rolled back and invalid records being recorded. - Even if the upload eventually completes, it can take an arbitrary amount of time, during which the record is invalid. This reverts commit 665f225. Fixes: carrierwaveuploader#2544
krasnoukhov
pushed a commit
to simplepractice/carrierwave
that referenced
this issue
Oct 4, 2022
This commit attempts to fix leftover files in failed transactions, but in the process introduces three problems: - Uploader state is inconsistent between `save` and `commit`. For example, reading `my_object.file_url.url` will return a bogus url if I read before commit. - A file might not be uploaded after a successful commit. For example, if there is a network failure. This causes the transaction to not be rolled back and invalid records being recorded. - Even if the upload eventually completes, it can take an arbitrary amount of time, during which the record is invalid. This reverts commit 665f225. Fixes: carrierwaveuploader#2544
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pull request #2209, by storing files in
after_commit
callback instead ofafter_save
, inadvertently introduces possible data corruption and data loss:save
andcommit
. For example, readingmy_object.file_url.url
will return a bogus url if I read before commit.The text was updated successfully, but these errors were encountered: