hide boosts from boost-muted accounts in public feeds - #3331
Open
sneakers-the-rat wants to merge 2 commits into
Open
hide boosts from boost-muted accounts in public feeds#3331sneakers-the-rat wants to merge 2 commits into
sneakers-the-rat wants to merge 2 commits into
Conversation
sneakers-the-rat
commented
Jan 5, 2026
Comment on lines
+758
to
+764
| it 'evicts the cache of boost muted accounts' do | ||
| expect(me.excluded_boosts_from_timeline_account_ids).to be_empty | ||
| me.follow(you, reblogs: false) | ||
| expect(me.excluded_boosts_from_timeline_account_ids).to include(you.id) | ||
| me.follow(you, reblogs: true) | ||
| expect(me.excluded_boosts_from_timeline_account_ids).to be_empty | ||
| end |
Author
There was a problem hiding this comment.
i sort of assume the rails cache to be active during tests? but if not, this test needs it enabled, lmk how to do that.
sneakers-the-rat
commented
Jan 5, 2026
|
|
||
| # Accounts that are followed but have reblogs hidden | ||
| def excluded_boosts_from_timeline_account_ids | ||
| Rails.cache.fetch("exclude_boosts_account_ids_for:#{id}", expires_in: 72.hours) do |
Author
There was a problem hiding this comment.
set a max expiration time that shouldn't be too expensive - usually i like to have an upper bound so that caches don't hang around "forever" but it departs from surrounding style.
…nts are syntactically necessary
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.
fix: #3330
when one mutes boosts from an account, those boosts were still shown in the public feeds. this fixes that - tries to plug into all existing mechanisms and follow the surrounding patterns so it ends up being pretty small.
the only thing that might be a bit sketch is the cache invalidation - since that's a mixin-like thing, we don't know that we have methods on the
Accountmodel, and the other similar methods were on theAccountmodel rather than the interactions concern so i put them there. since we can't be sure we have those methods when we're called, i used thetrymethod - which is a little weird, but this seems like the intended way to use it?other than that, just adding another where clause to the
Status.not_excluded_by_accountscope, which seems like the correct place? or at least it's what's used by the public feed manager.I don't really know how to do crossed behavior/products of test condition in rspec, so sorry if the tests are a bit repetitive. that's the longest part of the PR, hopefully it's readable enough.