-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
⚠️ Before posting ⚠️
- This is a bug, not a question or an enhancement.
- I've searched for similar issues and didn't find a duplicate.
- I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
- I agree to follow Nextcloud's Code of Conduct.
Steps to reproduce
- Open root directory
- Create a folder from web and add some file in it
- Open same folder from app
- Empty folder will be shown, however file must be visible.
- This is not happening all the time and hard to reproduce.
Steps to reproduce
- Have a large number of images in nested directories
- Perform a fresh installation of the app
- Open the Media tab
- Navigate back to All Files
- Observe the database using App Inspection: files that previously had a valid parent ID are set to
0after visiting the Media tab
Expected behaviour
Folder contents should be displayed correctly.
Actual behaviour
Sometimes folder contents looks empty.
Android version
11
Device brand and model
Emulator
Stock or custom OS?
Stock
Nextcloud android app version
3.34.0
Nextcloud server version
32
Additional information
MetadataWorker and normal folder navigation triggers RefreshFolderOperation.java in this class, we check eTag and update content of the folder. synchronizeData(List<Object> folderAndFiles) responsible for the updating logic.
However, in some cases child file saved into the DB but parent ID of it becomes 0 thus it is causing connection lost between child file and parent dir.
This happens because files are saved before their parent directories, causing their parentId to be set to 0.
Why files are saved before their parent?
Because saveFile and saveFolder operations can be triggered from certain places like:
Shared root, Favorites root, and the Media tab display files in a flat hierarchy, which can cause files to be updated before their parent directories. Since the eTag is updated in this state, subsequent refresh attempts do not restore the parent–child relationship, making a manual pull-to-refresh necessary.