Also use mangled paths when looking for entries below a path
authorKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 30 Jun 2020 12:19:55 +0000 (14:19 +0200)
committerKevin Ottens (Rebase PR Action) <er-vin@users.noreply.github.com>
Wed, 1 Jul 2020 16:58:29 +0000 (16:58 +0000)
Otherwise on second sync we wouldn't find anything under a mangled path
and just end up thinking said files were removed.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
src/common/syncjournaldb.cpp

index 43b0b045ce803e410c394af87965ed3a7c10950e..df3360879a4caaaa2b06b1680a8088d419c32cb9 100644 (file)
@@ -1098,6 +1098,7 @@ bool SyncJournalDb::getFilesBelowPath(const QByteArray &path, const std::functio
         if (!_getFilesBelowPathQuery.initOrReset(QByteArrayLiteral(
                 GET_FILE_RECORD_QUERY
                 " WHERE " IS_PREFIX_PATH_OF("?1", "path")
+                " OR " IS_PREFIX_PATH_OF("?1", "e2eMangledName")
                 // We want to ensure that the contents of a directory are sorted
                 // directly behind the directory itself. Without this ORDER BY
                 // an ordering like foo, foo-2, foo/file would be returned.