We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f29d01d commit 15ac5cfCopy full SHA for 15ac5cf
mongo/description/server.go
@@ -423,11 +423,13 @@ func (s Server) Equal(other Server) bool {
423
return false
424
}
425
426
- if s.TopologyVersion.CompareToIncoming(other.TopologyVersion) != 0 {
427
- return false
+ // If TopologyVersion is nil for both servers, CompareToIncoming will return -1 because it assumes that the
+ // incoming response is newer. We want the descriptions to be considered equal in this case, though, so an
428
+ // explicit check is required.
429
+ if s.TopologyVersion == nil && other.TopologyVersion == nil {
430
+ return true
431
-
- return true
432
+ return s.TopologyVersion.CompareToIncoming(other.TopologyVersion) == 0
433
434
435
func sliceStringEqual(a []string, b []string) bool {
0 commit comments