-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better handling of blocks in KnownFollowers
#4563
Conversation
Your Render PR Server URL is https://social-app-pr-4563.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cpouhu56l47c73estl40. |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested, looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's fix <Trans>
* origin/main: (62 commits) Rework "Who can reply" to blend more nicely into the UI (#4578) Fix threadgate read after write (#4577) Convert button to use forwardRef (#4576) use 1000x1000 for image height in avatar cropper (#4453) fix for autofill covering border (#4573) Update HomeHeaderLayoutMobile.tsx (#4572) Option for large alt badges (#4571) Truncate post metrics and fix truncation on native (#4575) Fix avi placeholder layout (#4570) add support for `ListEmptyComponent`, allow `undefined` data (#4403) GIF previews in notifications (#4447) [Session] Convert account to session data explicitly (#4446) Move onboarding start to after successfull account creation (#4381) Collection of moderation fixes (#4566) Fix undefined block (#4479) fix gap between tab bar and its border (#4538) Better handling of blocks in `KnownFollowers` (#4563) Verify email reminders (#4510) Bump labeler limit to 20 (#4565) Migrate local thread mutes (#4523) ...
So the issue here is that there are two count values that matter,
length
orcount
:knownFollowers.followers.length
knownFollowers.count
followers[]
filters out blocks, and only hydrates 5 profiles server-side, so that array could be0
, though it's unlikely. If that ever happened, we'd just not render anything at all.More likely is
followers.length < count
because 1 or more profiles are blocked and filtered out.So rendering should be driven by
followers.length
, butand N others
can only be driven bycount
since that can be much higher than the 5 max returned onfollowers
.So the fix here is:
followers[]
to rendercount
to determine if we need a,
orand
count
to determine if we needand N others
Here's a test case illustrating that: we have 3 follows in common, but I block one of them. Note only 2 avis (one is blocked), but it still says

and 1 other
. Clicking through will only show 2 profiles.