From fecff7d312b5230cd50a50d12ff200bae3c00797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Wed, 7 Feb 2024 12:17:07 +0100 Subject: [PATCH] Fix MongoDB forward compatibility issue caused by deserializing to an enum. --- mongodb/vibe/db/mongo/collection.d | 2 +- mongodb/vibe/db/mongo/connection.d | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mongodb/vibe/db/mongo/collection.d b/mongodb/vibe/db/mongo/collection.d index 3db435858..16dab6816 100644 --- a/mongodb/vibe/db/mongo/collection.d +++ b/mongodb/vibe/db/mongo/collection.d @@ -1477,7 +1477,7 @@ struct MaxWireVersion MaxWireVersion until(WireVersion v) @safe { return MaxWireVersion(v); } /// Unsets nullable fields not matching the server version as defined per UDAs. -void enforceWireVersionConstraints(T)(ref T field, WireVersion serverVersion, +void enforceWireVersionConstraints(T)(ref T field, int serverVersion, string file = __FILE__, size_t line = __LINE__) @safe { import std.traits : getUDAs; diff --git a/mongodb/vibe/db/mongo/connection.d b/mongodb/vibe/db/mongo/connection.d index 5cc296966..1adac1560 100644 --- a/mongodb/vibe/db/mongo/connection.d +++ b/mongodb/vibe/db/mongo/connection.d @@ -1120,7 +1120,7 @@ struct ServerDescription Nullable!BsonDate lastWriteDate; Nullable!BsonObjectID opTime; ServerType type = ServerType.unknown; - WireVersion minWireVersion, maxWireVersion; + int minWireVersion, maxWireVersion; string me; string[] hosts, passives, arbiters; string[string] tags; @@ -1153,7 +1153,8 @@ enum WireVersion : int v50 = 13, v51 = 14, v52 = 15, - v53 = 16 + v53 = 16, + v60 = 17 } private string getHostArchitecture()