diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2011-09-30 11:56:28 +0200 |
---|---|---|
committer | Patrick Ohly <patrick.ohly@intel.com> | 2011-09-30 18:19:59 +0200 |
commit | cc492faa50afceaa4b8d6942ecfcd9453dff8e09 (patch) | |
tree | 56da48eed2e611448d54628153d2fe23387366b1 | |
parent | dbb5e1829e572b198694366a535e8b92ec0c07aa (diff) |
DB_Conflict (409): correctly count updated and unmodified items
TLocalEngineDS::engProcessRemoteItemAsServer() in localengineds.cpp
counts Add commands as "added items", even if later on a 409 DB result
causes the item to be updated or be left unmodified.
Instead changing the whole statistics logic, this patch merely fixes
the statistics locally in the 409 handling code.
-rwxr-xr-x | src/sysync/customimplds.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/sysync/customimplds.cpp b/src/sysync/customimplds.cpp index 373cf4f..bd56491 100755 --- a/src/sysync/customimplds.cpp +++ b/src/sysync/customimplds.cpp @@ -2874,7 +2874,18 @@ bool TCustomImplDS::implProcessItem( else sta = LOCERR_OK; // in server case, further process like backend merge (but no need to fetch again, we just keep augmentedItemP) - if (IS_SERVER && sta==LOCERR_OK) sta = DB_DataMerged; + if (IS_SERVER && sta==LOCERR_OK) { + // TLocalEngineDS::engProcessRemoteItemAsServer() in + // localengineds.cpp already counted the item as added + // because it didn't know that special handling would be + // needed. Instead of a complicated mechanism to report + // back the actual outcome, let's fix the statistics + // here. + fLocalItemsAdded--; + if (changedDBVersion) + fLocalItemsUpdated++; + sta = DB_DataMerged; + } } } if (IS_SERVER) { |