nextcloud-desktop/csync/src
Jocelyn Turcotte e974771796 csync: Use an explicit instruction for should_update_metadata
The current way of tracking the need to update the metadata without
propagation using a separate flag makes it difficult to track
priorities between the local and remote tree. The logic is also
difficult to logically cover since the possibilities matrix isn't
100% covered, leaving the flag only used in a few situations
(mostly involving folders, but not only).

The reason we need to change this is to be able to track the sync
state of files for overlay icons. The instruction alone can't be
used since CSYNC_INSTRUCTION_SYNC is used for folders even though
they won't be propagated. Removing this logic is however not possible
without using something else than CSYNC_INSTRUCTION_NONE since too
many codepath interpret (rightfully) this as meaning "nothing to do".

This patch adds a new CSYNC_INSTRUCTION_UPDATE_METADATA instruction
to let the update and reconcile steps tell the SyncEngine to update
the metadata of a file without any propagation. Other flags are left
to be interpretted by the implementation as implicitly needing
metadata update or not, as this was already the case for most file
propagation jobs. For example, CSYNC_INSTRUCTION_NEW for directories
now also implicitly update the metadata.

Since it's not impossible for folders to emit CSYNC_INSTRUCTION_SYNC
or CSYNC_INSTRUCTION_CONFLICT, the corresponding code paths in the
sync engine have been removed.

Since the reconcile step can now know if the local tree needs metadata
update while the remote side might want propagation, the
localMetadataUpdate logic in SyncEngine::treewalkFile now simply use
a CSYNC_INSTRUCTION_UPDATE_METADATA for the local side, which is now
implemented as a different database query.
2016-08-17 15:39:31 +02:00
..
std Remove superfluous error checking from csync_create and csync_init 2016-02-25 20:53:13 +01:00
vio Windows: Skip symlinks and junctions again #5019 (#5036) 2016-07-07 08:07:19 +02:00
CMakeLists.txt OS X: Allow ampersand in APPLICATION_NAME #4657 2016-04-15 11:30:49 +02:00
csync_exclude.c Add TestSyncEngine and TestSyncFileStatusTracker auto tests 2016-08-17 15:39:30 +02:00
csync_exclude.h Add TestSyncEngine and TestSyncFileStatusTracker auto tests 2016-08-17 15:39:30 +02:00
csync_log.c Make it compile with the merge of csync mirall 2014-01-15 12:20:03 +01:00
csync_log.h Compile with GCC 5 2015-05-07 01:15:55 +02:00
csync_macros.h SyncEngine: Handle 403 Forbidden properly. 2015-11-18 15:31:55 +01:00
csync_misc.c csync_exclude: Use PathMatchSpecA instead of PathMatchSpecW 2015-10-20 18:38:47 +02:00
csync_misc.h Checksums: Skip uploads of .eml files only #4754 2016-04-28 12:59:39 +02:00
csync_private.h csync: Use an explicit instruction for should_update_metadata 2016-08-17 15:39:31 +02:00
csync_reconcile.c csync: Use an explicit instruction for should_update_metadata 2016-08-17 15:39:31 +02:00
csync_reconcile.h Move csync in order to merge it with mirall 2014-01-13 14:39:50 +01:00
csync_rename.cc csync walk tree: Try to find the 'other_node' in the source directory in case of renames 2015-05-12 16:32:00 +02:00
csync_rename.h csync walk tree: Try to find the 'other_node' in the source directory in case of renames 2015-05-12 16:32:00 +02:00
csync_statedb.c csync: Use the full file stat destructors (#4992) 2016-06-21 12:06:21 +02:00
csync_statedb.h fix typo occured->occurred 2016-02-20 10:33:13 +01:00
csync_time.c csync: Remove time_sync_required 2014-02-27 13:12:21 +01:00
csync_time.h csync: Remove time_sync_required 2014-02-27 13:12:21 +01:00
csync_update.c csync: Use an explicit instruction for should_update_metadata 2016-08-17 15:39:31 +02:00
csync_update.h SyncEngine: Use QNAM for csync_update 2015-01-20 18:27:25 +01:00
csync_util.c csync: Use an explicit instruction for should_update_metadata 2016-08-17 15:39:31 +02:00
csync_util.h Removed dead code from csync_utils. Functionality moved to Qt based code. 2015-07-08 18:13:39 +02:00
csync_version.h.in Use identical User Agents for csync and the Qt parts 2015-04-16 20:58:51 +02:00
csync.c csync: Use an explicit instruction for should_update_metadata 2016-08-17 15:39:31 +02:00
csync.h csync: Use an explicit instruction for should_update_metadata 2016-08-17 15:39:31 +02:00