Uploaded image for project: 'Rust Driver'
  1. Rust Driver
  2. RUST-1370

Extra fields from hello response are compared when checking if a ServerDescription has changed

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.6.0
    • 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.

            Assignee:
            abraham.egnor@mongodb.com Abraham Egnor
            Reporter:
            kaitlin.mahar@mongodb.com Kaitlin Mahar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: