sharkbound / PythonTwitchBotFramework

asynchronous twitchbot framework made in pure python
MIT License
100 stars 26 forks source link

reply waiter mod raises InvalidStateError at times #27

Closed sharkbound closed 4 years ago

sharkbound commented 4 years ago

stacktrace

error has occurred while triggering a event on a mod, details:
mod: replywaiter
event: Event.on_raw_message
error: <class 'asyncio.exceptions.InvalidStateError'>
reason: invalid state
stack trace:
Traceback (most recent call last):
  File "C:\Users\cvang\Desktop\PythonTwitchBotFramework-master\twitchbot\modloader.py", line 284, in trigger_mod_event
    output.append(await getattr(mod, event.value, _missing_function)(*args))
  File "C:\Users\cvang\Desktop\PythonTwitchBotFramework-master\twitchbot\builtin_mods\reply_waiter_mod.py", line 15, in on_raw_message
    future.set_result(msg)
asyncio.exceptions.InvalidStateError: invalid state
sharkbound commented 4 years ago

Source of the bug is from ReplyWaiterMod, its trying to get the result of a cancelled future. Also of note is that i need to move removing used futures to a async/thread safe way

sharkbound commented 4 years ago

fixed in 1accfdd52e5a3801af81d9a6cf316d69fcf00cd8