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

[BUG] Websocket Heartbeat Interval TypeError on reconnect #1651

Open
4 tasks done
Scrxtchy opened this issue Apr 2, 2024 · 3 comments
Open
4 tasks done

[BUG] Websocket Heartbeat Interval TypeError on reconnect #1651

Scrxtchy opened this issue Apr 2, 2024 · 3 comments

Comments

@Scrxtchy
Copy link
Contributor

Scrxtchy commented Apr 2, 2024

Library Version

userapps @ 73c73fd

Describe the Bug

During a gateway reconnect event, the application crashed due to the either the d or heartbeat_interval values being not set, or the event payload somehow also being None

Steps to Reproduce

  1. Run app
  2. Wait for or force Reconnect
  3. receive invalid data?
  4. Crash

Expected Results

Library should either raise an error or handle it

Minimal Reproducible Code

No response

Traceback

POST::https://discord.com/api/v10/interactions/{clientid}/{token}/callback: 404
Ignoring exception in Autocomplete Callback for /ranking team - Option: SlashCommandOption(): HTTPException: 404|Not Found || Unknown interaction
Shard ID 0 | Traceback (most recent call last):
  File "/mnt/mpathaf/scratch/hidden/june/lib/python3.10/site-packages/interactions/api/gateway/state.py", line 110, in _ws_connect
    await self.gateway.run()
  File "/mnt/mpathaf/scratch/hidden/june/lib/python3.10/site-packages/interactions/api/gateway/gateway.py", line 171, in run
    await self.dispatch_opcode(data, op)
  File "/mnt/mpathaf/scratch/hidden/june/lib/python3.10/site-packages/interactions/api/gateway/gateway.py", line 194, in dispatch_opcode
    return await self.reconnect(resume=True, url=self.ws_resume_url)
  File "/mnt/mpathaf/scratch/hidden/june/lib/python3.10/site-packages/interactions/api/gateway/gateway.py", line 281, in reconnect
    await super().reconnect(resume=resume, code=code, url=url)
  File "/mnt/mpathaf/scratch/hidden/june/lib/python3.10/site-packages/interactions/api/gateway/websocket.py", line 262, in reconnect
    self.heartbeat_interval = hello["d"]["heartbeat_interval"] / 1000
TypeError: 'NoneType' object is not subscriptable

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.
  • I have attempted to debug this myself, and I believe this issue is with the library

Additional Information

No response

@eightween
Copy link
Member

In accordance with #1657 , please specify your Python version

@Scrxtchy
Copy link
Contributor Author

Python 3.10.14

@eightween
Copy link
Member

Please set the library logging level to logging.DEBUG and follow up with a full log leading up to the traceback error so we can further look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants