Controller reconnect optimizations (#1190)
* Enhance docs for Controller NodeState
* Set Reconnecting status more often
* Reconnect when re-subscription fails for whatever reason
* Optimize Resubmission send handling
* Optimize Message read handling
Handle StatusResponses too and convert
* Optimize Message read handling
* NoResponse is also a ResubmissionError
(just from the other side, but we can handle comparable)
* merge
* Allow to control if Promises are resolved on cancelling discoveries
* Cleanup EHOSTUNREACH error handling
... and move it to where it belongs. Just handle it as RetransmissionsLimitReached error because in fact we would end that way when we would send out the data anyway.
* Cleanup client interaction send error handling
closed channels can use the proper error class and also consider this as an error that requires also a reconnection because we want to send something
* Make CASE client expected processing time configurable
To allow shorter reconnect tries for reconnections for clients
* Retransmit message in all error cases if channel is not closed.
* Restructure DiscoveryError
in Fact Discovery Error means "Not found" or "tried to send but no valid response", so we can also chain the error for easier catching
* No channels means we already reconnect
If we already have removed all channels to the node we do not need the remove them again and can assume we are already having a reconnect happening
* take over new connect options on reconnects
* take over new connect options on reconnects
* Rework PairedNode reconnection handling
* make sure only one reconnection process runs at a time
* Makes sure to return error on command after 10-20s max. (20s if we found a new IP, else only 10s)
* Send out mdns query when client has first resubmission of message
* track running discoveries by type and replace/reuse when needed
* restructure some method signatures to combine params into object. slightly breaking if used
* makes sure Node state is always set correctly
* Rework PairedNode reconnection handling
* make sure only one reconnection process runs at a time
* Makes sure to return error on command after 10-20s max. (20s if we found a new IP, else only 10s)
* Send out mdns query when client has first resubmission of message
* track running discoveries by type and replace/reuse when needed
* restructure some method signatures to combine params into object. slightly breaking if used
* makes sure Node state is always set correctly
* Fix channel cleanup
In a refactoring we introduced a regression. it happened that a channel was already removed and the code was removing then the newest added channel again which is wrong clean this up.
* Fix subscription error handling
In a refactoring we unexpectedly changed behavior. The catch in sendUpdateMessage was supposed to only handle StatusResponseErrors but we now handled all errors to close the subscription on one error. This is now adjusted back to as it was before. Additionally, a catch is added to the timer based execution of sendUpdate to prevent crashes.
* fix
* Correctly set discoverytype when timed
* Final Fixes and test Adjustments
* Address review feedback
* Merge main
* fix linter