diff --git a/src/sync.d b/src/sync.d index 6eec4afa..ef77894b 100644 --- a/src/sync.d +++ b/src/sync.d @@ -2990,11 +2990,17 @@ final class SyncEngine // Perform the database lookup - is the parent in the database? if (!itemdb.selectByPath(dirName(path), parent.driveId, parent)) { // parent is not in the database - log.vdebug("Parent path is not in the database - need to add it"); + log.vdebug("Parent path is not in the database - need to add it: ", dirName(path)); uploadCreateDir(dirName(path)); } - // still enforce check of parent path. if the above was triggered, the below will generate a sync retry and will now be sucessful - enforce(itemdb.selectByPath(dirName(path), parent.driveId, parent), "The parent item id is not in the database"); + + // Is the parent a 'folder' from another user? ie - is this a 'shared folder' that has been shared with us? + if (defaultDriveId == parent.driveId){ + // enforce check of parent path. if the above was triggered, the below will generate a sync retry and will now be sucessful + enforce(itemdb.selectByPath(dirName(path), parent.driveId, parent), "The parent item id is not in the database"); + } else { + log.vdebug("Parent drive ID is not our drive ID - parent most likely a shared folder"); + } JSONValue driveItem = [ "name": JSONValue(baseName(path)),