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

fix(API): Catastrophic 500 when media cannot be processed #976

Merged
merged 2 commits into from
Oct 19, 2023

Commits on Oct 19, 2023

  1. Red Tests

    lauramosher committed Oct 19, 2023
    Configuration menu
    Copy the full SHA
    8d76d53 View commit details
    Browse the repository at this point in the history
  2. 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.
    lauramosher committed Oct 19, 2023
    Configuration menu
    Copy the full SHA
    900ee5f View commit details
    Browse the repository at this point in the history