Closed abom closed 2 years ago
It gives the following error
2022-08-04T14:29:42.013Z DEBUG [rmb::http_workers::work_runner] can not retrieve twin from substrate for this id '114' because of Rpc error: The background task been terminated because: Networking or low-level protocol error: WebSocket connection error: connection closed; restart required
The reason was clear that websocket connection is dropped, I tried to see why it's dropped nearly after 1min, I tried to check the subtx or even jsonrpsee-client but didn't reach anything, wither the client or even the server who closes the connection (I thought there should be something to keep this connection alive)
anyway, I'll go for the easy solution, which is reconnecting again manually as this feature is not yet implemented for subxt, see this issue here.
After some trials, the same connection is dropped in case it was idle for sometime. I added a simple reconnecting client where it would build a new substrate client in case it's not connected.
Verified on devnet.
I sent a message first then i left rmb idle for about 25 minutes i sent another message and as seen in the screenshot below the client was disconnected and a new one was rebuilt automatically and the message was received sucessfully.
Quoting @muhamadazmy