Selective sync: Skip excluded folders when reading db
authorChristian Kamm <mail@ckamm.de>
Mon, 15 May 2017 12:46:09 +0000 (14:46 +0200)
committerChristian Kamm <mail@ckamm.de>
Tue, 16 May 2017 11:58:45 +0000 (13:58 +0200)
commitc5a0ce5a43c5539b0b22ca3a5b81d327465adb5f
tree0d6bfb05887dc748cff23356cb42fecb4934b192
parent6d74601cf3546ec5ddf7a511a9f2214445169b65
Selective sync: Skip excluded folders when reading db

When a new folder becomes selective-sync excluded, we already mark it
and all its parent folders with _invalid_ etags to force rediscovery.

That's not enough however. Later calls to csync_statedb_get_below_path
could still pull data about the excluded files into the remote tree.

That lead to incorrect behavior, such as uploads happening for folders
that had been explicitly excluded from sync.

To fix the problem, statedb_get_below_path is adjusted to not read the
data about excluded folders from the database.

Currently we can't wipe this data from the database outright because we
need it to determine whether the files in the excluded folder can be
wiped away or not.

See owncloud/enterprise#1965
csync/src/csync_statedb.c
src/libsync/syncjournaldb.h
test/testsyncengine.cpp