Browse Source

Skip root folder for two way sync

Signed-off-by: ZetaTom <70907959+ZetaTom@users.noreply.github.com>
ZetaTom 6 months ago
parent
commit
398a851cb9

+ 7 - 0
app/src/main/java/com/nextcloud/client/jobs/InternalTwoWaySyncWork.kt

@@ -52,6 +52,13 @@ class InternalTwoWaySyncWork(
                     return checkFreeSpaceResult
                 }
 
+                // do not attempt to sync root folder
+                if (folder.remotePath == OCFile.ROOT_PATH) {
+                    folder.internalFolderSyncTimestamp = -1L
+                    fileDataStorageManager.saveFile(folder)
+                    continue
+                }
+
                 Log_OC.d(TAG, "Folder ${folder.remotePath}: started!")
                 val operation = SynchronizeFolderOperation(context, folder.remotePath, user, fileDataStorageManager)
                     .execute(context)