Skip to content

Commit

Permalink
fix: Only update updated fields via update requests (#1817)
Browse files Browse the repository at this point in the history
## Relevant issue(s)

Resolves #1811

## Description

Only updates updated fields via update requests by returning a clean
document from Decode.
  • Loading branch information
AndrewSisley authored Aug 24, 2023
1 parent 5240086 commit 856ff58
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions db/fetcher/encoded_doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 856ff58

Please sign in to comment.