Closed sjmcdowall closed 6 years ago
@sjmcdowall you are correct. The instances
value here should be used to confirm an instance is available - if indeed the message in question directly references an instanceID in the UMF message to
field. Otherwise, any available instance should be used.
https://github.com/flywheelsports/hydra/blob/master/index.js#L1378
Looking at the _sendMessage code .. I think we have a corner case condition where we can silently fail to send a message ..
Use Case: Invoke sendMessage with an invalid (or dead) specific instance ID .
https://github.com/flywheelsports/hydra/blob/master/index.js#L1385
The code appears to blindly accept the instance given .. even if it is either totally bogus or not - running. It seems to be there should be a check before the _sendMTC to see if the instance is actually in the array returned from _getServicePresence() and if not, invoke reject()