aries-framework-go
aries-framework-go copied to clipboard
Can't reconnect mediator after connection terminated from server side
What I'm trying to do
I'm using AFGO WASM and I'm trying to reconnect to all the mediators using mediator.reconnectAll() after one connection timed out from the server side and was reported as "Closing Abnormally" (I know, the server was not the friendliest and just sad "Going away" as the status, but that's AWS API GW for you...).
Expected result
The app should reconnect to the mediator.
Actual result
I get the following error
Error: aries wasm: code: 5006, message: send noop request: outboundDispatcher.Send: failed to send msg using outbound transport: websocket write message : failed to write: WebSocket closed: unclean connection close: status = StatusAbnormalClosure and reason = ""
Root cause
This was was actually difficult to spot! But the root cause is nothing cleans up the abnormally terminated connections. If you check the function below, verKeys always stays an empty array:
https://github.com/hyperledger/aries-framework-go/blob/6c0c224401eed96cc4ad6d8478664374885596fc/pkg/didcomm/transport/ws/pool.go#L82-L96