sui icon indicating copy to clipboard operation
sui copied to clipboard

SuiClient: Implement ws disconnect handler

Open ea-open-source opened this issue 2 years ago • 0 comments

Steps to Reproduce Issue

Currently there is no way to handle ws subscriber disconnect, the sdk abstracted away the underlying jsonrpsee client implementation so user will only receive logs.

  1. Use SuiClient to subscribe to Sui fullnode
  2. Disconnect the client i.e stop the fullnode

Expected Result

Logs about the disconnection and a way to handle it. Maybe attempt to retry or expose [async client]: add notify_on_disconnect hook when the connection is closed

Actual Result

Logs about the disconnection and spam of Poll::Ready(None)

[2022-10-26T15:04:30Z ERROR jsonrpsee_core::client::async_client] Error: Connection(Closed) terminating client [2022-10-26T15:04:30Z WARN jsonrpsee_core::client::async_client] Transport(WebSocket connection error: connection closed connection closed) Followed by an infinite amount of [2022-10-27T08:41:56Z INFO subscriber] None

System Information

  • OS: MacOs 12.5.1
  • Compiler: rustc 1.64.0 (a55dd71d5 2022-09-19)

ea-open-source avatar Oct 27 '22 08:10 ea-open-source