Skip to content

Slideshow is left when deleting file #15636

@PhilLab

Description

@PhilLab

Steps to reproduce

  1. have multiple images in a folder
  2. click on one, to open slide show
  3. delete one
  4. --> folder listing is shown

Expected behaviour

  1. have multiple images in a folder
  2. click on one, to open slide show
  3. delete one
  4. --> another image is shown

Actual behaviour

The slideshow is left and the parent folder is shown again.

Nextcloud android app version

3.32.3 . Also reproducible on master

Additional information

This functionality seems to break from time to time:

  1. Initially it was fixed in When deleting image in preview activity, move to the next image #11919
  2. The logic was improved and made more explicit in pull/13016
  3. Somewhere it regressed again
  4. Was fixed again in showDirectoryWhenDeletionCompleted set to false? #14646
  5. Then it broke again. I suspect Finish PreviewImageActivity After Image Deletion #14782 , which added finishPreviewImageActivity() to the RemoveFilesDialogFragment, so that PreviewImageActivity::onRemoteOperationFinish() with the responsible logic is never called

On a secondary notice, the position handling in PreviewImageActivity::onRemoteOperationFinish() also seems to have some bugs, which we could fix in the same go:

  1. When deleting the first image in a folder, it doesn't jump to the second, but the third image. If there is no third, an empty view appears
  2. Sometimes (don't know yet, when) it also jumps out of the slideshow.

Lastly all this regressing and being faulty indicates we need an automated test for this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions