fix(ads): re-render stale ready spots in the background (gh-#854) - #861
Merged
Merged
Conversation
Ready spots rendered by an older pipeline now re-render on their current cast and bed without ever leaving 'ready'. db/48 adds render_version plus two durable markers (pending_retire_media_id, pending_confirm_media_id): the guarded station-side swap stamps both, and every worker tick drains them, so a displaced old row is always turned off and a new row is always turned on (only while its spot is still ready on it), even across a crash or a failed library write. Operator-disabled or never_play rows are never revived; old files are never deleted.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Closes #854
🎯 What
Ready ad spots rendered by an older pipeline now re-render in the background, on their current cast and bed. A spot never leaves
ready, so it keeps airing its old audio until the new audio is swapped in.🔧 How
ad_spot:render_version:AdRenderVersion.Current = 1, stamped by MarkReady.pending_retire_media_idandpending_confirm_media_id: durable markers.state='ready' AND media_id=old AND no pending retire.station_svchas no privilege on thelibraryschema, so the eligibility flips happen after commit. Each flip clears its own marker.ad_spotjoin. So a displaced row left eligible would air forever, beyond the reach of pause or retire. The markers make that impossible, even across a crash.✅ Verified
dotnet build GenWave.sln -warnaserror: 0 warnings.Category!=Integration: 0 failures.Gh854specs: 59 Ads, 45 MediaLibrary against real Postgres.render_version 0spots (10 and 19) swapped one per tick.📝 Notes for follow-up