[chronik-client] Fix WebSocket retry loop issues during disconnection
Summary:
Removed the previous delay handling. Only ensure in this diff that faulty urls can be switched correctly. The improvements to the WsEndpoint object mentioned in the diff will be handled in future diffs.
before modification: When a WebSocket connection to a URL is terminated due to a fault, triggering the onclose event callback function, the system automatically attempts to reconnect to this closed url for failover, which may not be successful and poses a risk of recursion.
After modification: When a WebSocket connection to a URL is terminated due to a fault, triggering the onclose event callback function, the system automatically attempts to connect to the next available url for failover.
Test Plan: npm test
Reviewers: Fabien, bytesofman, emack, O1 Bitcoin ABC, #bitcoin_abc
Reviewed By: Fabien, bytesofman, O1 Bitcoin ABC, #bitcoin_abc
Differential Revision: https://reviews.bitcoinabc.org/D17974