Drop retweets when the original author blocked the viewer - #100
Open
Pitchfork-and-Torch wants to merge 1 commit into
Open
Drop retweets when the original author blocked the viewer#100Pitchfork-and-Torch wants to merge 1 commit into
Pitchfork-and-Torch wants to merge 1 commit into
Conversation
BlockedByHydrator only checked candidate.author_id. A retweet of an author who blocked the viewer still served. Following already checks retweeted_user_id. Include that id in check_blocked_by and set author_blocks_viewer if either user blocked the viewer.
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
BlockedByHydrator only asked socialgraph whether candidate.author_id blocked the viewer. AuthorSocialgraphFilter then drops on author_blocks_viewer.
A retweet of an author who blocked the viewer still served: the retweeter is author_id, the original is retweeted_user_id. Viewer blocking the original is already handled via blocked_user_ids (block-on-retweet). The reverse direction was missing on For You.
Following already checks retweeted_user_id in FollowingBlockedByHydrator. Quote authors are a different field (quoted_author_blocks_viewer via QuoteHydrator). This is not mute-on-retweet (PR 9).
Fix
Include retweeted_user_id in check_blocked_by. Set author_blocks_viewer if either the primary author or the original retweeted author blocked the viewer. Same field Following already uses.
BlockedByHydrator is skipped for cached posts. Cache payloads from before this change can still miss until TTL.
Proof
Tests