New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expanding the range of followed tags we show #16213
Merged
Merged
Conversation
This file contains 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
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]:https://github.com/forem/forem/blob/c63e0b629e1edd0b7f2ce03952cf6bf552c7b8d8/app/workers/follows/update_points_worker.rb [2]:https://github.com/forem/forem/blob/c63e0b629e1edd0b7f2ce03952cf6bf552c7b8d8/app/controllers/async_info_controller.rb#L40-L65 [3]:https://github.com/forem/forem/blob/c63e0b629e1edd0b7f2ce03952cf6bf552c7b8d8/app/decorators/user_decorator.rb#L23-L34
jeremyf
requested review from
ludwiczakpawel,
amywtlin,
aitchiss,
a team and
Ridhwana
and removed request for
a team
January 19, 2022 17:47
aitchiss
approved these changes
Jan 20, 2022
pr-triage
bot
added
PR: partially-approved
bot applied label for PR's where a single reviewer approves changes
and removed
PR: unreviewed
bot applied label for PR's with no review
labels
Jan 20, 2022
Ridhwana
approved these changes
Jan 20, 2022
pr-triage
bot
added
PR: merged
bot applied label for PR's that are merged
and removed
PR: partially-approved
bot applied label for PR's where a single reviewer approves changes
labels
Jan 21, 2022
jeremyf
added a commit
that referenced
this pull request
Jan 21, 2022
…user * main: (36 commits) Stripping tags from "tags.short_summary" column (#16248) Add host tag in ForemStatsClient (#16237) Configured the repository to handle line endings (#16234) Removed font-awesome from the admin section (#16239) fix (#16244) remove assignment of css variable to undefined (#16243) Add new tag autocomplete to editor (#16025) Color tokens (#16107) ListingsToolkit refactoring (#16184) Expanding the range of followed tags we show (#16213) Let override of ToS and CoC show in onboarding (#16217) Bump stripe from 5.42.0 to 5.43.0 (#16233) Bump flipper-active_record from 0.23.0 to 0.23.1 (#16231) Bump flipper-ui from 0.23.0 to 0.23.1 (#16232) Bump flipper-active_support_cache_store from 0.23.0 to 0.23.1 (#16230) Bump js-routes from 2.2.0 to 2.2.1 (#16229) Adds suggested_tags to Onboarding section in Config (#16228) Constantize broadcast messages (#16219) app/mailers i18n (#16191) Remove the "Getting Started" Section from the Config (#16033) ...
headline-design
pushed a commit
to headline-design/forem-1
that referenced
this pull request
Mar 11, 2022
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 forem#14937. [1]:https://github.com/forem/forem/blob/c63e0b629e1edd0b7f2ce03952cf6bf552c7b8d8/app/workers/follows/update_points_worker.rb [2]:https://github.com/forem/forem/blob/c63e0b629e1edd0b7f2ce03952cf6bf552c7b8d8/app/controllers/async_info_controller.rb#L40-L65 [3]:https://github.com/forem/forem/blob/c63e0b629e1edd0b7f2ce03952cf6bf552c7b8d8/app/decorators/user_decorator.rb#L23-L34
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.
What type of PR is this? (check all applicable)
Description
I have talked with @amywtlin about the expectations regarding the tags that one follows. This is the lightest weight fix to align with expected behavior.
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.
That is to say, it's possible (and happens) where I have assigned an
explicit_points
of 1 for a tag, but the calculatedpoints
are less than 1. The calculatedpoints
are what we send forward in the AsyncInfoController (by way of the UserDecorator#cached_followed_tags method).In DEV, I ran the following queries:
User assigned points
>= 1
but calculated< 1
985,352 records
User assigned points
>= 1
but calculated>= 1
5,366,478 records
User assigned points
>= 1
but calculated>= 0
0 records.
User assigned points
<= 0
but calculated> 0
1,146 records
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.
Related Tickets & Documents
Closes #14937.
QA Instructions, Screenshots, Recordings
Hopefully with this change @robertandrews will see some more tags showing up.
UI accessibility concerns?
None.
Added/updated tests?
[Forem core team only] How will this change be communicated?