Connection to the substrate client broken after a while
The connection to the given substrate client works fine when launching the app. But after a few minutes it is broken:
DEBUG:substrateinterface.base:RPC request #34: "chain_getHead"
ERROR:root:[Errno 32] Broken pipe
Traceback (most recent call last):
File "/home/pini/projets/tikka/tikka/adapters/network/accounts.py", line 36, in get_balance
result = self.connections.rpc.client.query("System", "Account", [address])
File "/home/pini/.cache/pypoetry/virtualenvs/tikka-td9PeKy3-py3.9/lib/python3.9/site-packages/substrateinterface/base.py", line 1300, in query
block_hash = self.get_chain_head()
File "/home/pini/.cache/pypoetry/virtualenvs/tikka-td9PeKy3-py3.9/lib/python3.9/site-packages/substrateinterface/base.py", line 741, in get_chain_head
response = self.rpc_request("chain_getHead", [])
File "/home/pini/.cache/pypoetry/virtualenvs/tikka-td9PeKy3-py3.9/lib/python3.9/site-packages/substrateinterface/base.py", line 581, in rpc_request
self.websocket.send(json.dumps(payload))
File "/home/pini/.cache/pypoetry/virtualenvs/tikka-td9PeKy3-py3.9/lib/python3.9/site-packages/websocket/_core.py", line 278, in send
return self.send_frame(frame)
File "/home/pini/.cache/pypoetry/virtualenvs/tikka-td9PeKy3-py3.9/lib/python3.9/site-packages/websocket/_core.py", line 306, in send_frame
l = self._send(data)
File "/home/pini/.cache/pypoetry/virtualenvs/tikka-td9PeKy3-py3.9/lib/python3.9/site-packages/websocket/_core.py", line 520, in _send
return send(self.sock, data)
File "/home/pini/.cache/pypoetry/virtualenvs/tikka-td9PeKy3-py3.9/lib/python3.9/site-packages/websocket/_socket.py", line 170, in send
return _send()
File "/home/pini/.cache/pypoetry/virtualenvs/tikka-td9PeKy3-py3.9/lib/python3.9/site-packages/websocket/_socket.py", line 147, in _send
return sock.send(data)
File "/usr/lib/python3.9/ssl.py", line 1173, in send
return self._sslobj.write(data)
BrokenPipeError: [Errno 32] Broken pipe
And nothing on the UI tells the user that she has to reconnect.