alttester / alttester/AltTester-Unity-SDK

Class WebsocketConnection's _create_connection function got err alttester.exceptions.ConnectionError: the JSON object must be str, bytes or bytearray, not NoneType

未關閉
#1,679 0 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視
bug no version
主要語言
C#
星號
121
分支
24
PR 合併指標
30 天內沒有已合併 PR

描述

Python 3
Unity 2022.3.39
AltTester® Unity SDK a 2.1.2
Android
macOS

### Summary

Class WebsocketConnection's _create_connection fuction got err alttester.exceptions.ConnectionError: the JSON object must be str, bytes or bytearray, not NoneType

### Steps to reproduce
When AltDriver connect to AltServer, WebsocketConnection called connect(). But when it call _create_connection with message like this
`++Rcv decoded: fin=1 opcode=1 data=b'{"messageId":null,"driverId":null,"commandName":"driverRegistered","isNotification":true}'`
The msg that _on_message received is `'{"messageId":null,"driverId":null,"commandName":"driverRegistered","isNotification":true}'`
After that, it parsed msg to json by `response = json.loads(message)`. And in `self._notification_handler.handle_notification(response)`, it continue parsed msg to json again by
`data = json.loads(message.get("data"))`. There's no data key on this json, so it cause ConnectionError when I call cls.alt_driver = AltDriver() with my Unity Android app

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。