-
Type: Bug
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
We currently determine if a ServerDescription has changed and a corresponding ServerDescriptionChangedEvent needs to be emitted by checking if values in the previous and new HelloCommandResponse have changed via its PartialEq implementation. (here)
However, currently the PartialEq implementation checks a few fields that are not actually relevant to check for this purpose according to SDAM - we should only be checking those annotated with an = here.
As a result, we could emit extra SDAM monitoring events incorrectly, though this seems like an unlikely bug for users to encounter as the extra values we compare are all essentially constants (besides serviceId; I am not sure under what circumstances that would change.)
patrick.freed@mongodb.com suggested it would be better to explicitly compare the fields from the hello response we care about in the ServerDescription impl of PartialEq so the dependency is more explicit.