Interactivity event handlers can cause timeout
Created by: IDoEverything
Summary
Event handlers created by interactivity aren't properly offloaded to another task and can sometimes cause an AsyncEventTimeoutException
.
Details
This was brought up by nailuj29#7086 on discord. The handlers in Pagination.cs, specifically the one for MessageReactionsCleared
, were throwing this exception. While this might be slightly difficult to replicate, if any of the requests in the handler end up getting ratelimited, or there's connection issues, it can certainly take longer than two seconds to execute and therefore cause a deadlock. The code in the handlers should probably be offloaded to a Task.Run
instead.