Skip to content
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

FIX: missing reaction user for heart emoji breaks post mover #255

Merged
merged 1 commit into from Nov 6, 2023

Conversation

dbattersby
Copy link
Contributor

@dbattersby dbattersby commented Nov 6, 2023

When a user reacts to a post it creates an entry for both the discourse_reactions_reactions and discourse_reactions_reaction_users tables.

However, when a post is liked using the ❤️ emoji it still creates a discourse_reactions_reactions entry but stores user data within post_actions in core and doesn't create a discourse_reactions_reaction_users entry.

This change adds an extra check to skip adding DiscourseReactions::ReactionUser data if none is found.

The new test recreates the logic outlined above to assume that the post has a reaction and not the reaction user when it is liked, and should still work correctly.

Copy link
Contributor

@jjaffeux jjaffeux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dbattersby dbattersby merged commit 79740d2 into main Nov 6, 2023
5 checks passed
@dbattersby dbattersby deleted the post-mover-reaction-bug-fix branch November 6, 2023 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants