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
FEATURE: Count all reactions as likes with exceptions controlled by a site setting #267
Merged
martin-brennan
merged 17 commits into
main
from
feature/all-reactions-as-likes-with-deny-list
Feb 13, 2024
Merged
FEATURE: Count all reactions as likes with exceptions controlled by a site setting #267
martin-brennan
merged 17 commits into
main
from
feature/all-reactions-as-likes-with-deny-list
Feb 13, 2024
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
* Added specs * Added new site setting and hid the old ones * Some minor ReactionManager refactors
martin-brennan
changed the title
DEV: Initial work
FEATURE: Count all reactions as likes except those on a deny list
Jan 29, 2024
martin-brennan
changed the title
FEATURE: Count all reactions as likes except those on a deny list
FEATURE: Count all reactions as likes with exceptions controlled by a site setting
Jan 29, 2024
martin-brennan
force-pushed
the
feature/all-reactions-as-likes-with-deny-list
branch
from
January 31, 2024 03:41
2e0fbbd
to
44f132b
Compare
Also add the missing model annotations
martin-brennan
force-pushed
the
feature/all-reactions-as-likes-with-deny-list
branch
from
January 31, 2024 03:47
44f132b
to
d144088
Compare
martin-brennan
force-pushed
the
feature/all-reactions-as-likes-with-deny-list
branch
from
January 31, 2024 05:57
dd966e6
to
e8e3033
Compare
Also need to work on ReactionManager and the reactions controller
martin-brennan
force-pushed
the
feature/all-reactions-as-likes-with-deny-list
branch
from
February 2, 2024 05:27
ad097b5
to
de249db
Compare
martin-brennan
force-pushed
the
feature/all-reactions-as-likes-with-deny-list
branch
from
February 7, 2024 05:01
6be42e1
to
8d772cc
Compare
SamSaffron
reviewed
Feb 7, 2024
SamSaffron
reviewed
Feb 7, 2024
SamSaffron
reviewed
Feb 7, 2024
SamSaffron
reviewed
Feb 7, 2024
SamSaffron
reviewed
Feb 7, 2024
SamSaffron
reviewed
Feb 7, 2024
db/migrate/20240130013701_create_post_action_reaction_user_historical_records.rb
Outdated
Show resolved
Hide resolved
SamSaffron
reviewed
Feb 7, 2024
Overall looking very good, 👍 approving |
SamSaffron
approved these changes
Feb 7, 2024
* Add a flag to prevent sync / history changes by default, it's a hidden site setting `discourse_reactions_like_sync_enabled` * Instead of deleting `PostAction` records in the synchronizer, set them to trashed * Create and delete `UserAction` `LIKED` and `WAS_LIKED` records in the synchronizer * Restore trashed `PostAction` records when possible in the synchronizer * Leave out the initial data migration backfill for now
SamSaffron
reviewed
Feb 12, 2024
martin-brennan
force-pushed
the
feature/all-reactions-as-likes-with-deny-list
branch
from
February 12, 2024 06:58
32dfd9c
to
9712ce7
Compare
Also unhide the sync site setting so people can opt-in if they want
martin-brennan
deleted the
feature/all-reactions-as-likes-with-deny-list
branch
February 13, 2024 00:25
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.
This commit changes the reaction paradigm to instead count all reactions as
Likes (via a
PostAction
record) rather than only considering a single specificreaction emoji as a Like equivalent.
A new site setting,
discourse_reactions_excluded_from_like
, is introduced defaultingonly to have 👎 . Any emojis on this list will not create a
PostAction
record thatrepresents a Like.
We now create a
PostAction
record along with the existingReactionUser
recordfor reactions which are not excluded from Like, to help with history correction if
discourse_reactions_excluded_from_like
changes.For existing settings:
discourse_reactions_reaction_for_like
is still used, since we need an easy way to mapregular Likes to reactions if the plugin is enabled/disabled. This cannot be set to anything
in
discourse_reactions_excluded_from_like
. If this is changed, history will not get changed.Any reaction using this setting will only make a
PostAction
record.discourse_reactions_like_icon
is still used, since that is purely a visual setting.Also included a job that performs data consistency operations whenever
discourse_reactions_excluded_from_like
is changed, to create or trashrelevant
PostAction
records, and recover already trashed ones as needed.Also
UserAction
records forLIKE
andWAS_LIKED
are created and deletedas needed.
For now
discourse_reactions_like_sync_enabled
controls whether we create/trashPostAction
andUserAction
records when thediscourse_reactions_excluded_from_like
is changed. We are not including a migration until this is running in the wild for a few weeks.