-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix: empty folder appearance #15819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix: empty folder appearance #15819
Conversation
app/src/main/java/com/owncloud/android/operations/RefreshFolderOperation.java
Outdated
Show resolved
Hide resolved
app/src/main/java/com/owncloud/android/operations/RefreshFolderOperation.java
Outdated
Show resolved
Hide resolved
app/src/main/java/com/owncloud/android/operations/RefreshFolderOperation.java
Outdated
Show resolved
Hide resolved
eaf5bdd to
8871c1e
Compare
| Log_OC.d(TAG, "✅ Successfully fetched metadata for: ${folder.remotePath}") | ||
| } else { | ||
| Log_OC.e(TAG, "❌ Failed to fetch metadata for: ${folder.remotePath}, resetting e-Tag") | ||
| resetETag(folder, storageManager) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can safely reset the e-Tag if the RefreshFolderOperation fails. Since the operation is only executed when the e-Tag differs, setting it back to null in the event of a failure is acceptable and will not trigger any unnecessary additional operations.
| mChildren = updatedFiles; | ||
|
|
||
| // update eTag | ||
| mLocalFolder.setEtag(remoteFolder.getEtag()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only update mLocalFolder e-Tag and file-length after saving all children files to the directory.
Later on in run fileDataStorageManager.saveFile(mLocalFolder); will be called after fetchAndSyncRemoteFolder
|
/backport to stable-3.34 |
c047c90 to
ee24b75
Compare
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
ee24b75 to
6cc31de
Compare
|
test-Unit test failed, but no output was generated. Maybe a preliminary stage failed. |
|
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/15819.apk |

Issue
Since
MetadataWorkerupdates theeTagnewly added files not determined by client any more, thus empty folder may appear.Screen.Recording.2025-10-20.at.15.07.15.mov
Demo
Changes
Only updates e-Tag after successful
RefreshFolderOperationotherwise resets e-Tag.Only stores new e-Tag after saving child files to storage.
How to test?