diff --git a/lib/data/entity.js b/lib/data/entity.js index 936c00feb..3cfc115fe 100644 --- a/lib/data/entity.js +++ b/lib/data/entity.js @@ -373,11 +373,9 @@ const getWithConflictDetails = (defs) => { if (v.version > 1) { // v.root is false here - can use either const conflict = v.version !== (v.baseVersion + 1); - v.baseDiff = getDiffProp(v.dataReceived, defMap.get(v.baseVersion).data); - if ('label' in v.dataReceived && v.dataReceived.label !== defMap.get(v.baseVersion).label) v.baseDiff.push('label'); + v.baseDiff = getDiffProp(v.dataReceived, { ...defMap.get(v.baseVersion).data, label: defMap.get(v.baseVersion).label }); - v.serverDiff = getDiffProp(v.dataReceived, defMap.get(v.version - 1).data); - if ('label' in v.dataReceived && v.dataReceived.label !== defMap.get(v.version - 1).label) v.serverDiff.push('label'); + v.serverDiff = getDiffProp(v.dataReceived, { ...defMap.get(v.version - 1).data, label: defMap.get(v.version - 1).label }); if (conflict) { v.conflict = v.conflictingProp && v.conflictingProp.length > 0 ? ConflictType.HARD : ConflictType.SOFT;