Skip to content

fix: handle preview thumbnail fetch failures - #2057

Open
mhingjhang312002 wants to merge 1 commit into
cookpete:masterfrom
mhingjhang312002:codex/preview-fetch-errors
Open

mhingjhang312002 wants to merge 1 commit into
cookpete:masterfrom
mhingjhang312002:codex/preview-fetch-errors

Conversation

@mhingjhang312002

@mhingjhang312002 mhingjhang312002 commented Oct 21, 2026 •

Copy link
Copy Markdown

Fixes #1935.

Summary

  • Handle network, HTTP, and invalid response failures when loading an automatic preview thumbnail, while keeping the preview clickable.
  • Add and document onPreviewError(Error) so applications can observe thumbnail failures.
  • Ignore stale fetch results when the source changes or the preview unmounts.

Testing

  • Focused test/Preview.tsx: 11 assertions pass, covering network rejection, HTTP 503, stale requests, and successful thumbnail loading.
  • npx biome lint src — pass.
  • npm run types — pass.

On Windows, I ran the focused test through esbuild and Node directly because the repository test runner generates disttest/package.json with POSIX shell quoting. I did not run the full suite.

Demo video

Before and after walkthrough

This branch has not been deployed

No deployments
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.

Error Handling Missing in fetchImage Call in Preview Component

1 participant