-
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(API): Catastrophic 500 when media cannot be processed (#976)
* Red Tests * fix(API): Explore shows infinite loading When an otherwise representable media attachment is processed for a preview or image and errors, the request fails catastrophically resulting in the Explore interface looking like it's loading forever. It was determined that this was due to the underlying processing failure and, as such, the check for `.representable?` was insufficient to catch errors. For now, we simply added a test that raises the error manually for invariable images. See https://api.rubyonrails.org/classes/ActiveStorage/Blob/Representable.html#method-i-variant Our code currently catches any ActiveStorage::Error to reduce friction points since the Explore code has guardrails in place to display other media when a preview thumbnail is unaavilable. --------- Co-authored-by: Laura Mosher <[email protected]>
- Loading branch information
1 parent
0ddf326
commit d2d5b56
Showing
4 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FactoryBot.define do | ||
factory :media do | ||
story | ||
media { Rack::Test::UploadedFile.new('spec/fixtures/media/terrastories.png', 'image/png') } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters