TwitchIO icon indicating copy to clipboard operation
TwitchIO copied to clipboard

Fix #209

Open Commaster opened this issue 1 year ago • 2 comments

This closes #209

Pull request summary

This makes the The channel "CHANNELNAME" was unable to be joined. Check the channel is valid. error message in logging optional. Additionally allows automatic handling of such situations through the means of a new event_channel_join_failure event. This also fixes the following Task exception:

Task exception was never retrieved
future: <Task finished name='Task-123456' coro=<WSConnection._join_future_handle() done, defined at .../twitchio/websocket.py:293> exception=ValueError('list.remove(x): x not in list')>
Traceback (most recent call last):
  File ".../twitchio/websocket.py", line 295, in _join_future_handle
    await asyncio.wait_for(fut, timeout=timeout)
  File ".../asyncio/tasks.py", line 501, in wait_for
    raise exceptions.TimeoutError()
asyncio.exceptions.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File ".../twitchio/websocket.py", line 305, in _join_future_handle
    await self._process_data(data)
  File ".../twitchio/websocket.py", line 314, in _process_data
    return await self._code(parsed, parsed["code"])
  File ".../twitchio/websocket.py", line 347, in _code
    self._initial_channels.remove(parsed["batches"][0])
ValueError: list.remove(x): x not in list

Checklist

  • [x] If code changes were made then they have been tested.
    • [x] I have updated the documentation to reflect the changes.
    • [x] I have updated the changelog with a quick recap of my changes.
  • [x] This PR fixes an issue.
  • [x] This PR adds something new (e.g. new method or parameters).
  • [ ] This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • [ ] This PR is not a code change (e.g. documentation, README, ...)

Commaster avatar Aug 16 '22 06:08 Commaster

Have you tested this for channels that fail to be joined when calling join_channels manually whilst the bot is running?

chillymosh avatar Aug 16 '22 06:08 chillymosh

Have you tested this for channels that fail to be joined when calling join_channels manually whilst the bot is running?

That is exactly the issue that is being addressed here. Not the initial joining.

See: https://github.com/TwitchIO/TwitchIO/pull/322/files#diff-b7f8a8784d5eff6e6b1b2c2529b831cd86132c49699fe48e0d23c17ad4e2d7deR11

Commaster avatar Aug 16 '22 07:08 Commaster