Skip to content

Conversation

@Chavandeep
Copy link

@Chavandeep Chavandeep commented Aug 24, 2025

Priority: Medium

Fixes

Fixes #5466 by @t-hamano

Description

This PR updates the dead link filtering logic to correctly treat HTTP 410 (Gone) responses as dead links.
Previously, such images were still returned by the API, causing missing previews and insertion errors in the WordPress block editor.

Changes

  • Added dead status mapping in api/utils/check_dead_links/provider_status_mappings.py
    → now includes 410 (Gone), 404, 451, and common 5xx errors.
  • Added regression test in api/test/utils/test_check_dead_links.py
    → ensures 410 is always recognized as a dead link.

Testing Instructions

  1. Run the API test suite (pytest api/test/utils/test_check_dead_links.py), or rely on CI.
  2. Verify that 410 is included in the dead status codes.
  3. Confirm CI pipeline passes.

Checklist

  • My pull request has a descriptive title.
  • My pull request targets the default branch of the repository (main).
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made.
  • I added or updated documentation (not applicable).
  • I tried running the project locally and verified no visible errors (relied on CI).
  • I ran the DAG/media property docs generator (not applicable here).

@Chavandeep Chavandeep requested a review from a team as a code owner August 24, 2025 10:35
@Chavandeep Chavandeep requested review from krysal and obulat and removed request for a team August 24, 2025 10:35
@openverse-bot openverse-bot added 🧱 stack: api Related to the Django API 🛠 goal: fix Bug fix 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work labels Aug 24, 2025
@openverse-bot openverse-bot moved this to 👀 Needs Review in Openverse PRs Aug 24, 2025
@openverse-bot openverse-bot added the 🏷 status: label work required Needs proper labelling before it can be worked on label Aug 24, 2025
@Chavandeep Chavandeep marked this pull request as draft August 24, 2025 18:33
@openverse-bot openverse-bot moved this from 👀 Needs Review to 🚧 Draft in Openverse PRs Aug 24, 2025
@Chavandeep Chavandeep closed this Aug 24, 2025
@github-project-automation github-project-automation bot moved this from 🚧 Draft to 🚫 Closed in Openverse PRs Aug 24, 2025
@Chavandeep Chavandeep reopened this Aug 24, 2025
@openverse-bot openverse-bot moved this from 🚫 Closed to 🚧 Draft in Openverse PRs Aug 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🛠 goal: fix Bug fix 🧱 stack: api Related to the Django API 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work 🏷 status: label work required Needs proper labelling before it can be worked on

Projects

Status: 🚧 Draft

Development

Successfully merging this pull request may close these issues.

How to ignore broken image links

2 participants