Skip to content

Handle deleted images in translation editor - #939

Open
floze-the-genius wants to merge 1 commit into
wagtail:mainfrom
floze-the-genius:agent/handle-deleted-image
Open

Handle deleted images in translation editor#939
floze-the-genius wants to merge 1 commit into
wagtail:mainfrom
floze-the-genius:agent/handle-deleted-image

Conversation

@floze-the-genius

Copy link
Copy Markdown

Summary

  • reject non-successful and malformed image API responses before they reach the chooser render path
  • show a local missing-image message instead of crashing the whole translation editor
  • ignore stale async responses when the selected image changes
  • add a dependency-free regression test and run frontend tests/builds in CI

Root cause

The chooser parsed every API response and stored it as image metadata. A deleted image returns a non-2xx error payload without thumbnail, so rendering imageInfo.thumbnail.url threw and unmounted the editor.

Fixes #769.

Validation

  • npm test
  • ./node_modules/.bin/tsc --noEmit
  • NODE_OPTIONS=--openssl-legacy-provider npm run build
  • Node 14.21.3 Docker gate: regression test, TypeScript compile, and production build
  • Prettier 2.7.1 and the repository ESLint stack on changed frontend files
  • git diff --check

AI disclosure

I used OpenAI Codex to help investigate the issue, implement the fix, and run validation. I reviewed the resulting code and test coverage before submission.

@floze-the-genius
floze-the-genius force-pushed the agent/handle-deleted-image branch from ea3f487 to 486637a Compare July 18, 2026 15:02
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.

Deleted image breaks whole page editor

1 participant