Skip to content

Version 7.2.5

Latest
Compare
Choose a tag to compare
@notheotherben notheotherben released this 07 Jul 10:08
· 33 commits to main since this release

This release addresses an issue in the diff calculator which is showcased in #83, specifically when you are computing a diff on an array of documents where properties of some change while other documents are removed. This would result in only the removal operation being generated and would leave the changed documents in their original state.

const original = { array: [
  { x: 1, y: 1 },
  { x: 2, y: 2 }
]}

const current = { array: [
  { x: 1, y: 2 }
]}

const expectedDiff = {
  "$set": {
    "array": [
      { x: 1, y: 2 }
    ]
  }
}

const brokenDiff = {
  "$pull": {
    "array": { x: 2, y: 2 }
  }
}

Thank you to @fduplessisduplessis for the comprehensive reproduction case which enabled us to identify and resolve the issue.