Fail closed when TES media or URL entity lookup is missing - #161
Open
Pitchfork-and-Torch wants to merge 1 commit into
Open
Fail closed when TES media or URL entity lookup is missing#161Pitchfork-and-Torch wants to merge 1 commit into
Pitchfork-and-Torch wants to merge 1 commit into
Conversation
TES media Ok(None) assembled as has_media=false, so NSFW_HIGH_PRECISION age-gating and author interstitial skipped. Fetch URL entities and drop candidates whose media slot is NotFound/Failed or whose URL RPC failed. Co-authored-by: Jon Bailey <Pitchfork-and-Torch@users.noreply.github.com>
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.
Bug
TES
get_tweet_media_entitiesOk(None)/ Failed assembled ashas_media=falseviaget_or_default.nsfw_base_conditionandNsfwAuthorInterstitialRulerequirehas_media(), so NSFW_HIGH_PRECISION age-gating and author interstitial skipped.get_urlswas never called, so a card URL RPC miss was invisible.This is not #104 (bot 7429 cleanup). This is not #107 (GetTweetLabelInfoFromURL RTF reads). This is not #139 (SafetyLabelHydrator empty map). This is not #134 (TES flag Failed only; that leftover left media NotFound as no-media).
Found(empty) is a confirmed no-media / no-card tweet. That path is unchanged.
Five-line proof
TesHydrator::hydrate_tweets(get_tweet_media_entities, now alsoget_urls)retain_candidates_with_usable_media_or_url_entitiesomit →FilterTweetsVerdict::unresolved_authorDropChange
Drop a candidate when the media slot is NotFound, Failed, or missing. Fetch URL entities; drop on URL Failed. Confirmed empty media/URL lists still assemble and serve.
Tests
Standalone decision-table harness (same match arms): 12/12 passed.
cargo testcannot run. Public dump has no visibility-filtering crate manifest.Fork PR: none