Fail closed when withheld country list is missing or TES country-codes Err - #148
Open
Pitchfork-and-Torch wants to merge 1 commit into
Open
Conversation
…s Err Country-scoped legal/local takedown allowed when the viewer country was unknown, and TES withheldInCountries was never hydrated. Empty reason countries and a Failed get_takedown_country_codes read now withhold. 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
Country-scoped legal/local takedown allowed the post when the viewer country was missing. TES
get_takedown_country_codes(withheldInCountries) was never fetched, so a country list that lived only on that RPC never reached the Drop rules. An empty reason country or a Failed country-codes read assembled as “not withheld”.This is not #113 (account vs request country). This is not #110 (safety-label
applicable_countries). This is not #134 (TES flag RPC Failed dropped from the hydrated set).Fix
Honor TES withheld-in-countries on
DropLegalTakendownPostRule. Treat an empty reason country as worldwide (xx). If the withhold list is country-scoped and the viewer country is unknown, Drop. A Failedget_takedown_country_codesread assembles asxxso the legal rule fail-closes. Genuine NotFound / empty list stays un-withheld.Author self-view is unchanged.
Proof
get_takedown_country_codes/takedown_reasons.country_codeDropLegalTakendownPostRule/DropLocalLawsTakendownPostRulexx); legal withhold did notTests
legal_takedown_country_scoped_drops_without_viewer_country(fails on unmodified main)legal_takedown_empty_country_is_worldwidewithheld_in_countries_drops_matching_viewerwithheld_in_countries_allows_other_countryassemble_fail_closes_withheld_in_countries_err_as_worldwidecargo testcannot run. Public dump has no visibility-filtering manifest.Fork PR: none