fix(manager.py): catch all exceptions instead of just TypeError when loading JSON payload to handle any parsing errors

feat(index.tsx): add authentication token to WebSocket URL to authenticate the user
This commit is contained in:
anovazzi1 2023-08-25 18:15:59 -03:00
commit 927379b245
2 changed files with 5 additions and 3 deletions

View file

@ -191,7 +191,7 @@ class ChatManager(Service):
json_payload = await websocket.receive_json()
try:
payload = orjson.loads(json_payload)
except TypeError:
except Exception:
payload = json_payload
if "clear_history" in payload:
self.chat_history.history[client_id] = []