Skip to content
This repository has been archived by the owner on Jul 31, 2020. It is now read-only.

Commit

Permalink
Ignore conflicted records CREATE+existing_not_null during resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyBarabash committed Oct 21, 2019
1 parent 286884d commit 92884d9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions client/recordUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,16 @@ module.exports.resolveRecords = (recordsAndExistingObjects) => {
normalizeBookmark(item[1])
}
})

// Remove obvious conflicting records
for (var i = recordsAndExistingObjects.length - 1; i >= 0; --i) {
if (recordsAndExistingObjects[i] && recordsAndExistingObjects[i][0]) {
if (recordsAndExistingObjects[i][0].action === proto.actions.CREATE && recordsAndExistingObjects[i][1]) {
recordsAndExistingObjects.splice(i, 1)
}
}
}

const merged = mergeRecords(recordsAndExistingObjects)
merged.forEach(([record, existingObject]) => {
const resolved = this.resolve(record, existingObject)
Expand Down

0 comments on commit 92884d9

Please sign in to comment.