Skip to content

Un-optimized and buggy deletion of metadata #54274

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

Activity

  1. added theissue type on Aug 6, 2025
  2. self-assigned this
    on Aug 6, 2025
  3. added 2 commits that reference this issue on Aug 6, 2025
    3b26682
    ff6d8b0
  4. CarlSchwan commented on Aug 6, 2025

    @CarlSchwan
    MemberAuthor

    I now have two MRs:

  5. moved this from To triage to In progress in 🧑‍🤝‍🧑 Community triageon Aug 6, 2025
  6. added 2 commits that reference this issue on Aug 6, 2025
    ad8efbc
    9fef97c
  7. added 2 commits that reference this issue on Aug 7, 2025
    ac7bb4a
    1c7fb05
  8. added a commit that references this issue on Aug 24, 2025
    dfe5214
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions