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 breaking modmail internal thread cache #3028

Merged
merged 1 commit into from
May 24, 2021

Conversation

Jerrie-Aries
Copy link
Contributor

@Jerrie-Aries Jerrie-Aries commented May 11, 2021

About this PR:
File thread.py:

  • Make sure there's no existing cancelled thread before returning None in method 'find'.
    This possibly could prevent the bot from creating multiple threads when the user repetitively sends messages in DM on confirm thread creation.
  • Use await thread.close() instead of bot.loop.create_task() to make sure the thread for the recipient is completely removed from cache (if any) before creating another one.
  • Use bot.loop.create_task() when sending "Cancelled" embed to recipient if the thread is cancelled on confirm thread creation.

Resolves #3022

@fourjr fourjr changed the title Hopefully resolves #3022. Fix breaking modmail internal thread cache May 24, 2021
Copy link
Collaborator

@fourjr fourjr left a comment

Choose a reason for hiding this comment

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

LGTM

@fourjr fourjr added the staged Staged for next version label May 24, 2021
@fourjr fourjr merged commit e002867 into modmail-dev:development May 24, 2021
@Jerrie-Aries Jerrie-Aries deleted the dev-03 branch June 23, 2021 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
staged Staged for next version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] It's possible to break modmail's internal thread cache and simultanously open many threads
2 participants