docbrown/app/javascript
Jeremy Friesen af2e1f0545
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)
2022-01-20 19:46:42 -05:00
..
.storybook Storybook improvements (#15860) 2022-01-14 11:06:42 +01:00
actionsPanel Now HTML validation works for the adjust tags section of the moderation tools panel (#16062) 2022-01-13 07:11:44 -05:00
admin Remove the "Getting Started" Section from the Config (#16033) 2022-01-20 07:31:35 -07:00
analytics Accessibility enhancements to navigation tabs (#13559) 2021-05-07 15:24:34 +01:00
article-form Implementing new buttons (#15843) 2022-01-14 10:28:31 +01:00
articles Implementing new buttons (#15843) 2022-01-14 10:28:31 +01:00
CommentSubscription Update a11y of ButtonGroup component (#15765) 2021-12-15 12:52:33 +00:00
common-prop-types ✂✂✂ Remove Connect (#14734) 2021-11-18 08:21:00 -06:00
contentDisplayPolicy Accessibility improvements for hide comments modal (#15462) 2021-11-24 09:50:27 +03:00
crayons Updated indicators (#16190) 2022-01-20 06:25:10 +01:00
githubRepos Updated indicators (#16190) 2022-01-20 06:25:10 +01:00
leftSidebar Expanding the range of followed tags we show (#16213) 2022-01-20 19:46:42 -05:00
listings Implementing new buttons (#15843) 2022-01-14 10:28:31 +01:00
mobile Update Android PN integration fixes (#15541) 2021-12-02 13:56:28 -06:00
modCenter Bump eslint-config-preact from 1.2.0 to 1.3.0 (#15834) 2021-12-21 14:42:20 +00:00
onboarding Using a Form Object that will persist for the Creator Settings Form (#15684) 2021-12-10 17:07:40 +02:00
organization fix some prop type errors on the home page (#15314) 2021-11-10 13:47:55 +00:00
packs Implementing new buttons (#15843) 2022-01-14 10:28:31 +01:00
podcasts Fixed lint:frontend npm script (#15631) 2021-12-02 07:42:30 +00:00
previewCards Add author profile preview cards to feed (#14340) 2021-08-13 10:55:43 +07:00
profileDropdown ✂✂✂ Remove Connect (#14734) 2021-11-18 08:21:00 -06:00
profilePreviewCards Implementing new buttons (#15843) 2022-01-14 10:28:31 +01:00
readingList Storybook updates (#15848) 2022-01-14 11:06:23 +01:00
responseTemplates Edit buttons styles for Templates responses (Mod) (#14468) 2021-08-12 15:57:36 +01:00
runtimeBanner Implementing new buttons (#15843) 2022-01-14 10:28:31 +01:00
Search Storybook updates (#15848) 2022-01-14 11:06:23 +01:00
searchableItemList Reading list: fix broken pagination (#14031) 2021-06-22 08:24:23 +02:00
shared/components Fixed test that breaks once upgraded to Node 16. (#15621) 2021-12-01 09:24:03 -06:00
sidebar-widget Refactoring SidebarWidget and sidebarUser (#10887) 2021-02-03 17:47:54 +00:00
Snackbar Migrate faker dependency to supported upstream (#16037) 2022-01-10 15:00:48 -06:00
topNavigation Updating header with new Crayons buttons (#15653) 2021-12-09 16:41:18 +01:00
utilities Bump eslint-config-preact from 1.2.0 to 1.3.0 (#15834) 2021-12-21 14:42:20 +00:00
.eslintrc.js Bump eslint from 7.32.0 to 8.6.0 (#15926) 2022-01-05 13:47:40 -05:00
netlify.toml Update storybook node version (#16106) 2022-01-14 08:00:39 -05:00
routes.js.erb [15-minute fix] Add js-routes gem (#15133) 2021-11-01 10:08:15 +07:00