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

Task Destruction Issue When Dealing with Messages Containing "delete_after" flag. #56

Open
starempire opened this issue Jun 16, 2021 · 0 comments
Labels
usability Improve user experience with the library

Comments

@starempire
Copy link

Dpy supports an optional flag on message send titled "delete_after".

In a standard test, this can cause the test to throw a task destruction warning and not clean up open asyncio tasks, as dpy is holding onto the future message delete event, as well as the associated firing of api events raw_message_delete and message_delete.

If delete_after is used in a command, dpytest or pytest does not wait for this event to fire and kills the event prematurely. Workaround solution is to insert 'await asyncio.sleep(x)' with x set to the length of the delete_after timer.

There could possibly be a feature that would automatically hold open the test until this event has completed instead of manually awaiting a sleep timer.

@CraftSpider CraftSpider added the usability Improve user experience with the library label Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usability Improve user experience with the library
Projects
None yet
Development

No branches or pull requests

2 participants