const auto sizeOnServer = isVirtualE2EePlaceholder ? serverEntry.size - Constants::e2EeTagSize : serverEntry.size;
const auto metaDataSizeNeedsUpdateForE2EeFilePlaceholder = isVirtualE2EePlaceholder && dbEntry._fileSize == serverEntry.size;
+ if (serverEntry.isDirectory) {
+ // Even if over quota, continue syncing as normal for now
+ _discoveryData->checkSelectiveSyncExistingFolder(path._server);
+ }
+
if (serverEntry.isDirectory != dbEntry.isDirectory()) {
// If the type of the entity changed, it's like NEW, but
// needs to delete the other entity first.
item->_instruction = CSYNC_INSTRUCTION_SYNC;
item->_type = ItemTypeVirtualFileDownload;
} else if (dbEntry._etag != serverEntry.etag) {
- const auto differingSize = sizeOnServer != item->_size;
-
item->_direction = SyncFileItem::Down;
item->_modtime = serverEntry.modtime;
item->_size = sizeOnServer;
if (serverEntry.isDirectory) {
ENFORCE(dbEntry.isDirectory());
-
- if (differingSize) {
- _discoveryData->checkSelectiveSyncExistingFolder(path._server, sizeOnServer);
- }
-
item->_instruction = CSYNC_INSTRUCTION_UPDATE_METADATA;
} else if (!localEntry.isValid() && _queryLocal != ParentNotChanged) {
// Deleted locally, changed on server
<< "serverEntry.isDirectory:" << serverEntry.isDirectory
<< "dbEntry.isDirectory:" << dbEntry.isDirectory();
}
- } else if (dbEntry._modtime != serverEntry.modtime && localEntry.size == serverEntry.size && dbEntry._fileSize == serverEntry.size && dbEntry._etag == serverEntry.etag) {
+ } else if (dbEntry._modtime != serverEntry.modtime && localEntry.size == serverEntry.size && dbEntry._fileSize == serverEntry.size
+ && dbEntry._etag == serverEntry.etag) {
item->_direction = SyncFileItem::Down;
item->_modtime = serverEntry.modtime;
item->_size = sizeOnServer;
});
}
-void DiscoveryPhase::checkSelectiveSyncExistingFolder(const QString &path, const qint64 folderSize)
+void DiscoveryPhase::checkSelectiveSyncExistingFolder(const QString &path)
{
// TODO: Check for setting to obey big folder sync
// If no size limit is enforced, or if is in whitelist (explicitly allowed) or in blacklist (explicitly disallowed), do nothing.
if (!activeFolderSizeLimit() || findPathInList(_selectiveSyncWhiteList, path) || findPathInList(_selectiveSyncBlackList, path)) {
return;
- } else if (folderSize >= _syncOptions._newBigFolderSizeLimit) { // If the folder is too big, notify the user and prompt for response.
- emit existingFolderNowBig(path);
}
+
+ checkFolderSizeLimit(path, [this, path](const bool bigFolder) {
+ if (bigFolder) {
+ // Notify the user and prompt for response.
+ emit existingFolderNowBig(path);
+ }
+ });
}
/* Given a path on the remote, give the path as it is when the rename is done */
const RemotePermissions rp,
const std::function<void(bool)> callback);
- void checkSelectiveSyncExistingFolder(const QString &path, const qint64 folderSize);
+ void checkSelectiveSyncExistingFolder(const QString &path);
/** Given an original path, return the target path obtained when renaming is done.
*