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

    XMLWordPrintable

Details

    • Bug
    • Status: Backlog
    • Minor - P4
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kaitlin.mahar@mongodb.com Kaitlin Mahar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: