pattern-directory icon indicating copy to clipboard operation
pattern-directory copied to clipboard

Openverse thumbs can return 400 status codes but are still displayed as gray boxes

Open zackkrida opened this issue 2 years ago • 3 comments

Describe the bug A clear and concise description of what the bug is.

Currently, searching Openverse media in the pattern directory shows many broken thumbnails.

To Reproduce Steps to reproduce the behavior:

  1. Visit https://wordpress.org/patterns/?pagename=new-pattern
  2. Insert a new image; be prompted to search Openverse
  3. Search Openverse, using a suggested search or any arbitrary term
  4. Observe broken thumbnails with gray backgrounds

Expected behavior A clear and concise description of what you expected to happen.

Only working thumbnails should be displayed. Perhaps thumbnails which error should be filtered out.

Screenshots If applicable, add screenshots to help explain your problem.

CleanShot 2023-05-30 at 11 17 25@2x

Additional context Add any other context about the problem here.

Anyone on @WordPress/openverse-maintainers should be able to provide advice or support here.

zackkrida avatar May 30 '23 15:05 zackkrida

Is it expected that the openverse API response returns broken URLs, or are we doing something wrong in the w.org proxy layer?

ryelle avatar May 30 '23 15:05 ryelle

It is possible for Openverse thumbnails to return 400 errors. Ideally it would never happen. We've had some recent issues with this that we're still diagnosing and hoping to fix this week. The proxy looks perfect. The suggestion here would just be to perhaps not display thumbnails that fail to load at the client level. This would mean the user sees less than a full page but doesn't see the gray, placeholder UI.

zackkrida avatar May 30 '23 16:05 zackkrida

Oh, it just occurred to me @ryelle, the other "fallback" we use on Openverse is to use the full-resolution image if the thumbnail ever fails. It can burden users bandwidth-wise if a whole bunch of thumbnails are failing, but it does let the user see all available choices regardless of thumbnail availability.

zackkrida avatar May 30 '23 20:05 zackkrida