Skip to content

Fix Wikimedia photos not rendering on Android#38

Merged
dfalling merged 1 commit into
mainfrom
fix-photo-rendering
Jun 6, 2026
Merged

Fix Wikimedia photos not rendering on Android#38
dfalling merged 1 commit into
mainfrom
fix-photo-rendering

Conversation

@dfalling
Copy link
Copy Markdown
Owner

@dfalling dfalling commented Jun 5, 2026

Summary

  • wikimedia-type photos failed to render on Android while loading fine on web. Wikimedia's User-Agent policy returns 403 to the generic okhttp/... User-Agent that React Native's native image loader sends; browsers send a full Mozilla/... UA, which is why web was unaffected.
  • Added src/photos/photoImageSource.ts, a helper that attaches a descriptive User-Agent header to photo Image requests. Applied in ElementDetailScreen and ElementEditScreen. The header is harmless for our S3/Cloudinary-hosted photos, so it's applied to all.

Verification

  • Confirmed against the failing Wikimedia URL via curl: empty UA and okhttp/4.9.2403; descriptive Culpeos/... UA → 200.
  • tsc --noEmit, bun run lint (no new warnings), and bun run test all pass.

🤖 Generated with Claude Code

Wikimedia's User-Agent policy returns 403 to the generic okhttp UA that
React Native's native image loader sends on Android, so wikimedia-type
photos never rendered (web works because browsers send a full UA). Attach
a descriptive UA to photo Image requests to satisfy the policy.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dfalling dfalling merged commit 54589be into main Jun 6, 2026
2 checks passed
@dfalling dfalling deleted the fix-photo-rendering branch June 6, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant