Expanding the range of followed tags we show (#16213)
The fix might be a bit of a work-around for a more general approach, but we're fighting against the magic of the points vs. explicit_points tension as defined in the [Follows::UpdatePointsWorker][1]. That is to say, it's possible (and happens) where I have assigned an `explicit_points` of 1 for a tag, but the calculated `points` are less than 1. The calculated `points` are what we send forward in the [AsyncInfoController][1] (by way of the [UserDecorator#cached_followed_tags][3] method). In DEV, I ran the following queries: **User assigned points `>= 1` but calculated `< 1`** 985,352 records ```sql SELECT count(id) FROM follows WHERE followable_type = 'ActsAsTaggableOn::Tag' AND points < 1 AND explicit_points >= 1; ``` **User assigned points `>= 1` but calculated `>= 1`** 5,366,478 records ```sql SELECT count(id) FROM follows WHERE followable_type = 'ActsAsTaggableOn::Tag' AND points >= 1 AND explicit_points >= 1; ``` **User assigned points `>= 1` but calculated `>= 0`** 0 records. ```sql SELECT count(id) FROM follows WHERE followable_type = 'ActsAsTaggableOn::Tag' AND points <= 0 AND explicit_points >= 1; ``` **User assigned points `<= 0` but calculated `> 0`** 1,146 records ```sql SELECT count(id) FROM follows WHERE followable_type = 'ActsAsTaggableOn::Tag' AND points > 0 AND explicit_points <= 0; ``` Synthesizing that, almost 1 million tag follows of the total 6.3 million are not showing up in the user's left navigation. And 5.3 million are roughly correct. In adjusting the logic, we're now going to have more tags showing up in the left. And just over 1,000 might now show up that would be unexpected. Closes #14937. [1]:c63e0b629e/app/workers/follows/update_points_worker.rb[2]:c63e0b629e/app/controllers/async_info_controller.rb (L40-L65)[3]:c63e0b629e/app/decorators/user_decorator.rb (L23-L34)
This commit is contained in:
parent
711f1bb0cd
commit
af2e1f0545
1 changed files with 1 additions and 1 deletions
|
|
@ -12,7 +12,7 @@ export const TagsFollowed = ({ tags = [] }) => {
|
|||
return (
|
||||
<Fragment>
|
||||
{tags.map(({ name, id, points }) =>
|
||||
points >= 1 ? (
|
||||
points >= 0 ? (
|
||||
<Link
|
||||
key={id}
|
||||
title={`${name} tag`}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue