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

Fails when tokenExpires date is null #12

Open
the6thBook opened this issue Jul 14, 2022 · 0 comments
Open

Fails when tokenExpires date is null #12

the6thBook opened this issue Jul 14, 2022 · 0 comments

Comments

@the6thBook
Copy link

On login, if tokenExpires is null DDPClient produces a TypeError and doesn't execute the callback

{"msg":"result","id":"1","result":{"id":"SOME-ID","token":"SOME-TOKEN","tokenExpires":{"$date":null},"type":"resume"}}
Exception in thread <<<{"msg": "connect", "version": "1", "support": ["1", "pre2", "pre1"], "session": "qfNH8MtjGqqhkG5qs"}

WebSocketClient:
Traceback (most recent call last):
File "/var/lang/lib/python3.9/threading.py", line 980, in _bootstrap_inner

{"server_id":"0"}
{"msg":"connected","session":"SOME=SESSION"}

  • RECONNECTED
    self.run()
    File "/var/lang/lib/python3.9/threading.py", line 917, in run
    self._target(*self._args, **self._kwargs)
    File "/opt/python/ws4py/websocket.py", line 528, in run
    if not self.once():
    File "/opt/python/DDPClient.py", line 53, in once
    return super(DDPSocket, self).once()
    File "/opt/python/ws4py/websocket.py", line 410, in once
    if not self.process(self.buf[:requested]):
    File "/opt/python/ws4py/websocket.py", line 480, in process
    self.received_message(s.message)
    File "/opt/python/DDPClient.py", line 41, in received_message
    self.emit('received_message', data)
    File "/opt/python/pyee/base.py", line 176, in emit
    handled = self._call_handlers(event, args, kwargs)
    File "/opt/python/pyee/base.py", line 154, in _call_handlers
    self._emit_run(f, args, kwargs)
    File "/opt/python/pyee/base.py", line 130, in _emit_run
    f(*args, **kwargs)
    File "/opt/python/DDPClient.py", line 162, in received_message
    data = ejson.loads(str(data))
    File "/opt/python/ejson/init.py", line 132, in loads
    return json.loads(obj, *args, cls=kwargs.pop('cls', EJSONDecoder), **kwargs)
    File "/var/lang/lib/python3.9/json/init.py", line 359, in loads
    return cls(**kw).decode(s)
    File "/opt/python/ejson/init.py", line 126, in decode
    return self._decode(o)
    File "/opt/python/ejson/init.py", line 117, in _decode
    return {k: self._decode(v) for k, v in o.items()}
    File "/opt/python/ejson/init.py", line 117, in
    return {k: self._decode(v) for k, v in o.items()}
    File "/opt/python/ejson/init.py", line 117, in _decode
    return {k: self._decode(v) for k, v in o.items()}
    File "/opt/python/ejson/init.py", line 117, in
    return {k: self._decode(v) for k, v in o.items()}
    File "/opt/python/ejson/init.py", line 104, in _decode
    return datetime.fromtimestamp(o["$date"] / 1000.0, timezone.utc)
    TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'
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

1 participant