Silently handle remote folders removed while a full account refresh is run
authorDavid A. Velasco <dvelasco@solidgear.es>
Wed, 18 Nov 2015 08:29:15 +0000 (09:29 +0100)
committerDavid A. Velasco <dvelasco@solidgear.es>
Wed, 25 Nov 2015 08:42:18 +0000 (09:42 +0100)
src/com/owncloud/android/syncadapter/FileSyncAdapter.java

index 7dfe520..f04c8da 100644 (file)
@@ -298,7 +298,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
                 syncChildren(children);
             }
             
                 syncChildren(children);
             }
             
-        } else {
+        } else if (result.getCode() != ResultCode.FILE_NOT_FOUND) {
             // in failures, the statistics for the global result are updated
             if (    result.getCode() == RemoteOperationResult.ResultCode.UNAUTHORIZED ||
                     result.isIdPRedirection()
             // in failures, the statistics for the global result are updated
             if (    result.getCode() == RemoteOperationResult.ResultCode.UNAUTHORIZED ||
                     result.isIdPRedirection()
@@ -313,7 +313,10 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
             }
             mFailedResultsCounter++;
             mLastFailedResult = result;
             }
             mFailedResultsCounter++;
             mLastFailedResult = result;
-        }
+
+        } // else, ResultCode.FILE_NOT_FOUND is ignored, remote folder was
+          // removed from other thread or other client during the synchronization,
+          // before this thread fetched its contents
             
     }
 
             
     }