From 23a9f7e0fb50adf5d53d2a20d179576fb4455b27 Mon Sep 17 00:00:00 2001 From: Andrew Sisley Date: Thu, 24 Aug 2023 14:05:33 -0400 Subject: [PATCH] Return clean document from Decode Fixes https://github.com/sourcenetwork/defradb/issues/1811 --- db/fetcher/encoded_doc.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/db/fetcher/encoded_doc.go b/db/fetcher/encoded_doc.go index 8427bd5d59..3e19eb2218 100644 --- a/db/fetcher/encoded_doc.go +++ b/db/fetcher/encoded_doc.go @@ -123,6 +123,11 @@ func Decode(encdoc EncodedDocument) (*client.Document, error) { doc.SchemaVersionID = encdoc.SchemaVersionID() + // client.Document tracks which fields have been set ('dirtied'), here we + // are simply decoding a clean document and the dirty flag is an artifact + // of the current client.Document interface. + doc.Clean() + return doc, nil }