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(InteractionCollector): handle thread (and parent) deletion #7070

Conversation

kyranet
Copy link
Member

@kyranet kyranet commented Dec 6, 2021

Please describe the changes this PR makes and why it should be merged:

Backports the thread (and thread parent) channel deletion from #6902 to InteractionCollector with the fixed checks from #7069.

Fixes #6905

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

@kyranet kyranet added this to the Version 13.4 milestone Dec 6, 2021
@Jiralite
Copy link
Member

Jiralite commented Dec 7, 2021

Fixes #6905

Another way to reproduce that issue is to create an interaction collector on a guild the client is not in, so this pull request doesn't actually fix this issue. Deleted channels are not sent to the client, so...

@kyranet
Copy link
Member Author

kyranet commented Dec 7, 2021

For the code sample in the linked issue, you're using message.channel.createMessageComponentCollector, which will always set a guild the client is in, and of course, the collector will stop upon the guild's removal.

If you're somehow passing an invalid guild ID (or one that the bot isn't in), we can't determine it in any way due to Discord's limitations, and I believe that falls under user error.

Furthermore, the collectors have a timer specifically for things like this, if we can't determine a way to end a collector earlier, set a maximum timer so it won't leak.

@iCrawl iCrawl merged commit b5cd288 into discordjs:main Dec 7, 2021
@kyranet kyranet deleted the fix/handle-thread-deletion-in-interaction-collector branch December 7, 2021 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Possible event listener leak via interaction collectors
5 participants