diff --git a/src/Simplex/Messaging/Server/Names.hs b/src/Simplex/Messaging/Server/Names.hs index a533204ff..6c5faa2fa 100644 --- a/src/Simplex/Messaging/Server/Names.hs +++ b/src/Simplex/Messaging/Server/Names.hs @@ -106,7 +106,7 @@ mapAvailability NameStatusResp {nsStatus, nsExpires, nsGraceEnds, nsAuctionEnds, "expired" -> Right NAVailable "grace" -> Right $ maybe lapsed NAInGrace nsGraceEnds "auction" -> Right $ fromMaybe lapsed (NAAuction <$> nsPremium <*> nsAuctionEnds) - "reserved" -> Right $ NAReserved (maybe NRUnspecified mapReason nsReasonCode) + "reserved" -> Right $ NAReserved (maybe NRUnknown mapReason nsReasonCode) "registered" -> Right $ NATaken nsExpires -- registered, but its records point nowhere "noResolver" -> Right $ NATaken nsExpires diff --git a/tests/SMPNamesTests.hs b/tests/SMPNamesTests.hs index 7ac3a0a18..2498bda45 100644 --- a/tests/SMPNamesTests.hs +++ b/tests/SMPNamesTests.hs @@ -118,8 +118,9 @@ availabilitySpec = do (NAAuction "99999952316384526016153087" 1798191621) it "a reserved name says why it is held back" $ answers status404 "{\"error\":\"reserved\",\"reasonCode\":\"trademark\"}" (NAReserved NRTrademark) + -- an older resolver sends no reasonCode; that is not the chain saying "none" it "a reserved name with no reasonCode at all is still reserved" $ - answers status404 "{\"error\":\"reserved\"}" (NAReserved NRUnspecified) + answers status404 "{\"error\":\"reserved\"}" (NAReserved NRUnknown) -- a later version may name reasons this one cannot; the reservation must -- survive that, or a client would offer a name it cannot register it "a reason from a later version still reads as reserved" $