scarecrow: treat failed RTF label reads as labeled in URL tweet lookup - #107
Open
Pitchfork-and-Torch wants to merge 1 commit into
Conversation
GetTweetLabelInfoFromURL listed tweets that share a URL, then asked GetTweetRtfLabels whether each already had the interstitial. A failed read was replaced with an empty list, so every tweet looked unlabeled. Bot 7413 (NSFW_Card_Image_URL_to_Tweet_Verdict) uses those two lists directly: PUT applies NSFW_CARD_IMAGE to notLabeled, and DELETE only removes it from labeled. After a URL-verdict delete, a Strato miss left the tweet interstitial in place. A miss on PUT could also apply the label on an unknown state. Treat a failed lookup as already labeled so DELETE can still clear and PUT will not apply. Co-authored-by: Jon Bailey <Pitchfork-and-Torch@users.noreply.github.com>
Pitchfork-and-Torch
marked this pull request as ready for review
September 4, 2026 17:49
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.
Problem
GetTweetLabelInfoFromURLwalks tweets that share a URL and asksGetTweetRtfLabelswhether each already has the interstitial. A failed read was replaced with an empty list, so every tweet looked unlabeled.Bot 7413 (
NSFW_Card_Image_URL_to_Tweet_Verdict) uses those two lists as-is:NSFW_CARD_IMAGEtonotLabeledlabeledAfter a URL-verdict delete, a Strato miss left the tweet interstitial in place. A miss on PUT could also apply the label when the current state was unknown.
This is the tweet-side counterpart of the URL-verdict cleanup fix. That change can now fire a DELETE; this lookup was still swallowing the label read that DELETE depends on.
Change
Treat a failed
GetTweetRtfLabelsread as already labeled (TryOrElse(..., TRUE)). Successful empty reads still count as unlabeled.TweetRtfRemoveLabelwhen the read failsNo write-path, TTL, or rule-condition changes.
Tests
This derived feature runs inside Botmaker against internal Strato. There is no in-repo harness. Correctness is the list split plus the bot 7413 apply/remove branches, and
TryOrElsealready substitutes the backup on a failed future (botmaker/.../TryOrElse.java).Decision table:
GetTweetRtfLabelsCherry-picked from Pitchfork-and-Torch#11. The file matches this tree.