Skip to content

Un-optimized and buggy deletion of metadata #54274

@CarlSchwan

Description

@CarlSchwan

When deleting a folder definitively from the trash, with multiple entries, for each entry I get the following DB query:

Image

The first two queries are created by: OC\FilesMetadata\Listener\MetadataDelete::handle

The last one by: OCA\Files\Listener\SyncLivePhotosListener->handle

Both triggered by the same: CacheEntryRemovedEvent

There is at least 2 issues with that:

  • It's inefficient because the number of query scale linearly with the number of entries in deleted folder
  • We delete the entry in the metadata table and then fetch it to find the corresponding live photo. The fetching is always empty so if there was a live photo, it won't be deleted.

@artonge

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions