Fix threaded replies to non-federated statuses not being filtered from the timeline#4177
Fix threaded replies to non-federated statuses not being filtered from the timeline#4177nightpool wants to merge 4 commits intomastodon:masterfrom
Conversation
|
codeclimate won't let me dismiss false positives, but in order:
|
|
rubocop says line 120, around which there is no |
bdf2075 to
dacb0cd
Compare
|
@akihikodaki fixed |
|
See 6fd865c You're reverting deliberate optimizations - this code is a performance hot spot and we want it to handle as little information as possible, thus passing it an integer and not a full account, and using batched checks for mutes, blocks etc. If I'm reading correctly the actual fix is the line |
|
@Gargron Since that code was written, the performance of muting?, blocking?, and following? have all been changed, and now the two alternatives create identical SQL queries, but one is much more readable and maintainable. I'm not sure how passing an integer vs. a full account would change the performance in this case at all, seeing as everywhere we call it we are explicitly taking an id from a full activerecord object, and everywhere we compare it we're still using the ID—the only difference is the muting? and blocking? calls. I also moved the blocking calls to after the "reply?" check for performance reasons (do the easy checks first) but i'm down to revert that if you think it's a bad idea. |
Resolves #4177 - smaller changeset
Resolves #4177 - smaller changeset
bug discovered by @vahnj. If someone you follow replies to a status your instance doesn't know about, it gets filtered. but if they continue replying in that thread, further replies don't get filtered. This adds logic to cover that edge case.
This also refactors the feed manager code because it's super out of date, and doens't use the account interaction maps. (lots of Follow.where(target_id: blah, account_id: blah))