Reconnect to any relay that needs it whenever there is a change in relayUrls.
This is similar to this pull request by @aussedatlo except that I have added a check to make sure that we don't try to reconnect to a relay if it is already connected. See this comment for discussion. To do this I create a new array aConnectedRelays which I derive from connectedRelays.
I have also added a check to disconnect from any relay that has been removed from relayUrls. However, that part of the pull request is incomplete. I am able to log to the console the correct url(s) that needs closing but haven't yet gotten the disconnect command (relay.close() ??) to work yet.
This does not address the issue of reconnecting to spontaneously dropped relays, which is addressed by my other PR and can be considered separately.
Reconnect to any relay that needs it whenever there is a change in
relayUrls
.This is similar to this pull request by @aussedatlo except that I have added a check to make sure that we don't try to reconnect to a relay if it is already connected. See this comment for discussion. To do this I create a new array
aConnectedRelays
which I derive fromconnectedRelays
.I have also added a check to disconnect from any relay that has been removed from
relayUrls
. However, that part of the pull request is incomplete. I am able to log to the console the correct url(s) that needs closing but haven't yet gotten the disconnect command (relay.close()
??) to work yet.This does not address the issue of reconnecting to spontaneously dropped relays, which is addressed by my other PR and can be considered separately.