Files
buzz/mobile/test/shared/widgets
Tom Brow 9f8913dd1b mobile: keep a thumbnail fallback apart from a direct load of the same URL (#8913)
## Summary

Follow-up to [#8896](https://github.com/block/buzz/pull/8896), from its
review threads.

**A fallback and a direct load of the same thumbnail no longer share a
download.** `MediaImageProvider.isThumbnailFallback` decides what a 404
means: for a thumbnail `MediaImage` picked in place of an original, it
records a missing thumbnail so the next build loads the original; for
any other URL it starts the 30s failure cooldown. It was left out of
equality and the in-flight download key, so when a profile URL that is
itself a thumbnail and a fallback to that same thumbnail were on screen
together, both joined one download and only one of them ran its own 404
handling. Now each keeps its own provider and download, and each gets
its own handling.

The failure cooldown is keyed the same way. Before, a direct 404 of a
thumbnail put its URL on cooldown (30s, up to 5 min with Retry-After),
and an avatar that fell back to that thumbnail during the cooldown hit
the cooldown error instead of a 404, so it showed initials instead of
loading the original.

Also:

- Reworded the `preferThumbnail` doc so it no longer names community
icons, which never set it.
- Removed the community-icon avatar test, which fed a URL production
never produces.

## Testing

- New test: a direct thumbnail URL and a fallback to it, shown together,
make two requests; after a 404 the direct URL is in cooldown and the
fallback's original loads (not the initials). It fails with the fetch
key change reverted.
- New test: after a direct thumbnail 404, an avatar that falls back to
the same thumbnail still loads the original. It fails with the cooldown
key change reverted.
- `just mobile-check` and `just mobile-test` pass.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Tom Brow <tomb@squareup.com>
Co-authored-by: Tom Brow <tomb@squareup.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 09:38:34 -08:00
..