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(utilities): race condition issue for closed paginated message #484

Merged
merged 2 commits into from Oct 8, 2022
Merged

fix(utilities): race condition issue for closed paginated message #484

merged 2 commits into from Oct 8, 2022

Conversation

goestav
Copy link
Contributor

@goestav goestav commented Oct 5, 2022

This pull request fixes a bug where the button components won't get removed due to a race condition error: DiscordAPIError: Interaction has already been acknowledged..
This occurs when the user tries to interact with the message when the paginated message is about to close.
You can reproduce this by spam clicking the next/previous buttons on a paginated message.

This commit fixes a bug where the button components won't get removed
due to a race condition error:
`DiscordAPIError: Interaction has already been acknowledged.`.
This occurs when trying to interact with the message when it is about to
close the paginated message.
@favna
Copy link
Member

favna commented Oct 8, 2022

dunno what you see as spam clicking because it either works for me, or I get rate limited by Discord

18-23-36_08-10-2022_Discord.mp4

@favna
Copy link
Member

favna commented Oct 8, 2022

In general the code looks good but please attach a reproduction video recording because I cannot reproduce it

@goestav
Copy link
Contributor Author

goestav commented Oct 8, 2022

Screen.Recording.2022-10-08.at.23.45.38.mov

I guess I didn't explain well, but it happens while the paginated message is getting closed
In this video you can see that inside the handleEnd method it's still on the previous page (4th page in debugger while it's the 5th page on discord) and it throws a DiscordAPIError because of this
The components also won't get removed

@favna favna merged commit 8c9c9b7 into sapphiredev:main Oct 8, 2022
@goestav goestav deleted the fix/paginated-message-race-condition-bug branch October 8, 2022 22:24
favna added a commit that referenced this pull request Oct 9, 2022
goestav added a commit to goestav/utilities that referenced this pull request Jun 21, 2023
…pphiredev#484)

* fix(utilities): race condition issue for closed paginated message

This commit fixes a bug where the button components won't get removed
due to a race condition error:
`DiscordAPIError: Interaction has already been acknowledged.`.
This occurs when trying to interact with the message when it is about to
close the paginated message.

Co-authored-by: Jeroen Claassens <support@favware.tech>
goestav pushed a commit to goestav/utilities that referenced this pull request Jun 21, 2023
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