Skip to content
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

Rails 7.0.1 Direct Uploads remain painful to use #44374

Closed
resistorsoftware opened this issue Feb 9, 2022 · 4 comments
Closed

Rails 7.0.1 Direct Uploads remain painful to use #44374

resistorsoftware opened this issue Feb 9, 2022 · 4 comments

Comments

@resistorsoftware
Copy link

Using Ruby 3.1 and Rails 7.01 to do a Direct Upload, we know we have to Monkeypatch out any of the Direct Upload token code. Failure to do so results in the dreaded:

ActiveStorage::InvalidDirectUploadTokenError (ActiveStorage::InvalidDirectUploadTokenError):

Interestingly, while we get uploads working by removing this token, if we have an exception in our code, and then re-use the same upload to try again after fixing the exception, this error is indeed part of the cycle again. So as an example, when saving the attachment from a direct upload, we then try and run a background job to process it, and we blew that. If we fix the background job call, and just re-up a file, boom:

 ActiveStorage::InvalidDirectUploadTokenError (ActiveStorage::InvalidDirectUploadTokenError):

I would love for this to be fixed!! I

@rafaelfranca
Copy link
Member

Did you try Rails 7.0.2?

@rafaelfranca rafaelfranca added the more-information-needed When reporter needs to provide more information label Feb 9, 2022
@resistorsoftware
Copy link
Author

Yes. AFAIK that did not make any major changes to direct uploads. This is a strange one though. I get it. If I have an exception, everything about the form is probably borked, and for sure, trying to re-use it is not likely to work as Rails has now reset itself after the exception. Maybe this is all just smoke.

@rails-bot rails-bot bot removed the more-information-needed When reporter needs to provide more information label Feb 9, 2022
@ghiculescu
Copy link
Member

ghiculescu commented Feb 9, 2022

7.0.2 includes #44287 which was meant to resolve a lot of the InvalidDirectUploadTokenError issues. It was shipped yesterday FYI.

@jesselawson
Copy link
Contributor

I just upgraded to 7.0.2 and it has been the only thing that fixed the dreaded InvalidDirectUploadTokenError issue for me. Thank you all so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants