-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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(MessageReaction): Prevent event double fire from uncached messages #6818
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the message is not partial and the request goes through before the gateway event comes in, the reaction add event will not be emitted at all.
I don't really have a good solution for this at hand though. 😅
Possible fix?
The `fromStructure` seems to be... better(?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine, however isn't this an issue?
Please describe the changes this PR makes and why it should be merged:
This should resolve #5063.
The problem was that the manual call to the handler was running side-by-side with the payload received from Discord, resulting in the event firing twice (and the cache check being redundant). In this case, I added a new parameter called
fromStructure
to the handler (which is called only from the structure) and removed the existing cache check! This should return the object instead of firing the event when called from the structure and will allow the object to be received without firing the event, which in turn will let the event be fired only from a payload received from Discord.Status and versioning classification: