Browse Source

Merge pull request #6751 from grote/6726-documentsprovider-0-bytes

Reset last sync date of files written via DocumentsProvider
Tobias Kaminsky 4 năm trước cách đây
mục cha
commit
ad7564b942

+ 5 - 2
src/main/java/com/owncloud/android/providers/DocumentsStorageProvider.java

@@ -244,7 +244,8 @@ public class DocumentsStorageProvider extends DocumentsProvider {
                             showToast();
                         }
                     }
-                } catch (Exception exception) {
+                } catch (Exception e) {
+                    Log_OC.e(TAG, "Error syncing file", e);
                     showToast();
                 }
             });
@@ -253,7 +254,7 @@ public class DocumentsStorageProvider extends DocumentsProvider {
             try {
                 syncThread.join();
             } catch (InterruptedException e) {
-                Log.e(TAG, "Failed to wait for thread to finish");
+                Log.e(TAG, "Failed to wait for thread to finish", e);
             }
         }
 
@@ -266,6 +267,8 @@ public class DocumentsStorageProvider extends DocumentsProvider {
 
         if (isWrite) {
             try {
+                // reset last sync date to ensure we will be syncing this write to the server
+                ocFile.setLastSyncDateForData(0);
                 Handler handler = new Handler(context.getMainLooper());
                 return ParcelFileDescriptor.open(file, accessMode, handler, l -> {
                     RemoteOperationResult result = new SynchronizeFileOperation(newFile, oldFile, user, true,