docbrown/app
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
..
assets Updated indicators (#16190) 2022-01-20 06:25:10 +01:00
components/admin/users Small change to make the tools section of member details mobile friendly. (#15159) 2021-10-22 18:47:20 +02:00
controllers Let override of ToS and CoC show in onboarding (#16217) 2022-01-20 19:45:39 -05:00
decorators Patching ERB rendering of the data-info JSON (#16067) 2022-01-14 08:30:49 -05:00
errors small non-views ruby i18n (#16004) 2022-01-11 10:05:18 +07:00
forms Using a Form Object that will persist for the Creator Settings Form (#15684) 2021-12-10 17:07:40 +02:00
helpers Remove the "Getting Started" Section from the Config (#16033) 2022-01-20 07:31:35 -07:00
javascript Expanding the range of followed tags we show (#16213) 2022-01-20 19:46:42 -05:00
lib Move BlackBox to app/lib (#16183) 2022-01-20 09:37:53 +07:00
liquid_tags Implement Unified Embed for Tweet URLs (#16218) 2022-01-20 08:05:56 -05:00
mailers app/mailers i18n (#16191) 2022-01-20 07:33:29 -07:00
models Let override of ToS and CoC show in onboarding (#16217) 2022-01-20 19:45:39 -05:00
policies Allow for skipping navigation link creation (#16112) 2022-01-17 17:22:24 -05:00
queries small non-views ruby i18n (#16004) 2022-01-11 10:05:18 +07:00
refinements Drop profile columns from user (#10707) 2020-12-03 08:14:38 +07:00
sanitizers Extracting container for allowed tags & attrs (#15338) 2021-12-16 12:24:45 -05:00
serializers Refactoring to add helper method (#16064) 2022-01-12 11:21:44 -05:00
services app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
uploaders small non-views ruby i18n (#16004) 2022-01-11 10:05:18 +07:00
validators Remove the "Getting Started" Section from the Config (#16033) 2022-01-20 07:31:35 -07:00
view_objects Patching ERB rendering of the data-info JSON (#16067) 2022-01-14 08:30:49 -05:00
views Let override of ToS and CoC show in onboarding (#16217) 2022-01-20 19:45:39 -05:00
workers Ensuring we don't track views of author or unpublished (#16143) 2022-01-18 11:23:18 -05:00