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

state: fix updating reaction count in reaction remove event #302

Merged
merged 2 commits into from Jan 18, 2022

Conversation

Juby210
Copy link
Contributor

@Juby210 Juby210 commented Jan 15, 2022

No description provided.

@diamondburned
Copy link
Owner

diamondburned commented Jan 16, 2022

What case does this fix cover? You should add a comment documenting such cases.

@Juby210
Copy link
Contributor Author

Juby210 commented Jan 16, 2022

What case does this fix cover? You should add a comment documenting such cases.

You are incrementing reaction count in add event, but you don't decrement it in remove event.
I have starboard bot and you could just increment star count by deleting reaction and adding it again.

Current code only decrements count if bot user removes reaction:
image

@diamondburned
Copy link
Owner

diamondburned commented Jan 16, 2022

Wouldn't that mean the actual fix would be to omit the r.Me branch completely and keep the default: branch?

The r.Me check can just be its own if outside the switch case.

@diamondburned diamondburned merged commit 2d3bf29 into diamondburned:v3 Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants