Skip to content

Empty Folder Content #16139

@alperozturk96

Description

@alperozturk96

⚠️ 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

  1. Open root directory
  2. Create a folder from web and add some file in it
  3. Open same folder from app
  4. Empty folder will be shown, however file must be visible.
  5. This is not happening all the time and hard to reproduce.

Steps to reproduce

  1. Have a large number of images in nested directories
  2. Perform a fresh installation of the app
  3. Open the Media tab
  4. Navigate back to All Files
  5. Observe the database using App Inspection: files that previously had a valid parent ID are set to 0 after 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.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions