Promote a creative to ready when its revision publishes - #304
Merged
Merged
Conversation
Every streaming break fell through to the house ad. Selection only considers creatives whose status is "ready", and all 185 video creatives were sitting at "generating" with validated, published media behind them. The row is created as "generating" so that nothing serves a creative with no bytes yet, and that is right. What was missing is that publishing the revision IS the moment it gains them, and the status was never moved. So the render pipeline worked end to end — snapshot, encode, validate, upload, publish — and nothing it produced could ever be selected. Done in the same write as published_revision, deliberately. Two statements could leave a creative servable by status with no published revision, or the reverse, and the compare-and-swap that protects the revision protects the status with it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ThreatCrush Security Scan48 finding(s) HIGH/CRITICAL: 2 | MEDIUM: 31 | LOW: 15
Snippets are redacted; ThreatCrush never prints matched credential material. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every streaming break fell through to the house ad, and this is why.
Selection only considers creatives whose status is
ready. All 185 video creatives were sitting atgeneratingwith validated, published media behind them:The row is created as
generatingso nothing serves a creative with no bytes yet — that part is right. What was missing is that publishing the revision IS the moment it gains them, and the status was never moved.So the render pipeline worked end to end — snapshot, encode, validate, upload, publish — and nothing it produced could ever be selected. The endpoint, the slot, the auction and 182 published revisions were all correct and the result was still an empty break every time.
One write, not two
Done in the same update as
published_revision. Two statements could leave a creative servable-by-status with no published revision, or the reverse — and the compare-and-swap that protects the revision (a slow render of revision 4 landing after 5) protects the status along with it.Existing rows
The 182 already-published creatives need the same promotion; I'll repair them on dev2 once this deploys, so the fix and the backfill land together rather than leaving a window where new renders serve and old ones don't.
2597 passed / 1 failed (pre-existing
tracker-geo). Worker typecheck clean.