avoid concurrency conflicts when merging records
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 19 Oct 2015 10:12:55 +0000 (12:12 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 21 Oct 2015 10:39:20 +0000 (12:39 +0200)
... by setting the current seq of the updated record

Change-Id: Ib21a33b56219785f79f3f1611f8a8e224f90eb06
Reviewed-on: http://gerrit.tine20.com/customers/2290
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/js/widgets/dialog/DuplicateMergeDialog.js

index d457af5..72f242e 100644 (file)
@@ -109,13 +109,15 @@ Tine.widgets.dialog.DuplicateMergeDialog = Ext.extend(Ext.FormPanel, {
         
         Tine.log.debug('Tine.widgets.dialog.DuplicateMergeDialog::onUpdate() - allRecords:');
         Tine.log.debug(allRecords);
-        
+
         if (strategy === 'mergeTheirs') {
-            // we need to use the first id in update record
+            // we need to use the first id and seq in update record
             updateRecord.id = allRecords[0].id;
+            updateRecord.set('seq', allRecords[0].get('seq'));
         } else {
-            // we need to use the second id (clientRecord) in update record
+            // we need to use the second id + seq (from clientRecord) in update record
             updateRecord.id = allRecords[1].id;
+            updateRecord.set('seq', allRecords[1].get('seq'));
         }
         updateRecord.data.id = updateRecord.id;