diff --git a/lib/data/entity.js b/lib/data/entity.js index 2c18c4fec..9a84db1c2 100644 --- a/lib/data/entity.js +++ b/lib/data/entity.js @@ -383,11 +383,9 @@ const getWithConflictDetails = (defs, audits, relevantToConflict) => { if (v.version > 1) { // v.root is false here - can use either const conflict = v.version !== (v.baseVersion + 1); - v.baseDiff = getDiffProp(v.dataReceived, defs[v.baseVersion - 1].data); - if ('label' in v.dataReceived && v.dataReceived.label !== defs[v.baseVersion - 1].label) v.baseDiff.push('label'); + v.baseDiff = getDiffProp(v.dataReceived, { ...defs[v.baseVersion - 1].data, label: defs[v.baseVersion - 1].label }); - v.serverDiff = getDiffProp(v.dataReceived, defs[v.version - 2].data); - if ('label' in v.dataReceived && v.dataReceived.label !== defs[v.version - 2].label) v.serverDiff.push('label'); + v.serverDiff = getDiffProp(v.dataReceived, { ...defs[v.version - 2].data, label: defs[v.version - 2].label }); if (conflict) { v.conflict = v.conflictingProperties && v.conflictingProperties.length > 0 ? ConflictType.HARD : ConflictType.SOFT;