mLocalFile.getLocalModificationTimestamp() > mLocalFile.getLastSyncDateForData()
);
- Log_OC.d(TAG, "TOKENs checked to SYNC " + mRemotePath );
- Log_OC.d(TAG, " server#modificationTimestamp " + mServerFile.getModificationTimestamp());
- Log_OC.d(TAG, " local#modificationTimestampAtLastSyncForData " + mServerFile.getModificationTimestampAtLastSyncForData());
- Log_OC.d(TAG, " local#modificationTimestamp " + mLocalFile.getLocalModificationTimestamp());
- Log_OC.d(TAG, " local#lastSyncDateForData " + mLocalFile.getLastSyncDateForData());
-
/// decide action to perform depending upon changes
//if (!mLocalFile.getEtag().isEmpty() && localChanged && serverChanged) {
if (localChanged && serverChanged) {
result = new RemoteOperationResult(ResultCode.SYNC_CONFLICT);
+ getStorageManager().saveConflict(mLocalFile, mServerFile.getEtag());
} else if (localChanged) {
if (mSyncFileContents && mAllowUploads) {
mServerFile.setLastSyncDateForData(mLocalFile.getLastSyncDateForData());
mServerFile.setStoragePath(mLocalFile.getStoragePath());
mServerFile.setParentId(mLocalFile.getParentId());
+ mServerFile.setEtag(mLocalFile.getEtag());
getStorageManager().saveFile(mServerFile);
}
result = new RemoteOperationResult(ResultCode.OK);
}
- }
+ // safe blanket: sync'ing a not in-conflict file will clean wrong conflict markers in ancestors
+ if (result.getCode() != ResultCode.SYNC_CONFLICT) {
+ getStorageManager().saveConflict(mLocalFile, null);
+ }
+ }
}