Skip to content

Track YouTube thumbnail 404 failures#760

Merged
jsnmrs merged 2 commits intomainfrom
image-404
Feb 10, 2026
Merged

Track YouTube thumbnail 404 failures#760
jsnmrs merged 2 commits intomainfrom
image-404

Conversation

@jsnmrs
Copy link
Owner

@jsnmrs jsnmrs commented Feb 10, 2026

Summary

  • Add persistent per-video tracking of thumbnail 404 failures via thumbnail_issue_count column on aggro_videos
  • Pass HTTP status code through fetch_url() and fetch_thumbnail() so callers can distinguish 404s from other failures
  • Flag videos as bad after exceeding 10 consecutive 404s, removing them from active queries and the sweep cycle
  • Wire flagBrokenThumbnails() into the sweep after cleanThumbs()

Fixes AGGRO-1J

Post-deployment steps

After deploy, run the database migration on the production server:

php spark migrate

This adds the thumbnail_issue_count column to the end of aggro_videos. MySQL 8.0+ handles appended columns via instant DDL — no table copy, no locking.

Verify the column exists:

php spark db:table aggro_videos

No other manual steps are needed. Existing rows start at 0, and the counter begins incrementing on the next sweep cycle.

Test plan

  • New ThumbnailService tests pass (increment, reset, flag broken, skip already-bad, return count)
  • New AggroHelper tests pass (httpStatus populated, 404 detection, thumbnail passthrough, backward compatibility)
  • Full test suite passes (464 tests, 0 failures)
  • PHP CS Fixer clean
  • PHPStan clean
  • Run migration on production after deploy
  • Verify AGGRO-1J stops recurring in Sentry after affected videos are flagged

Add persistent tracking of thumbnail fetch failures per video.
Each 404 increments a counter; successful fetches reset it.
Videos exceeding 10 failures are flagged bad and removed from
active rotation. Adds thumbnail_issue_count column, httpStatus
pass-through in fetch_url/fetch_thumbnail, and flagBrokenThumbnails
cleanup in the sweep cycle.
@jsnmrs jsnmrs merged commit bde2315 into main Feb 10, 2026
2 checks passed
@jsnmrs jsnmrs deleted the image-404 branch February 10, 2026 23:49
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