Skip to content

fix(preview): delete version metadata by preview ID - #63251

Open
joshtrichards wants to merge 2 commits into
masterfrom
jtr/fix-previewMapper-delete
Open

fix(preview): delete version metadata by preview ID#63251
joshtrichards wants to merge 2 commits into
masterfrom
jtr/fix-previewMapper-delete

Conversation

@joshtrichards

@joshtrichards joshtrichards commented Aug 14, 2026

Copy link
Copy Markdown
Member
  • Resolves: #

Summary

Delete version metadata using the specific preview_versions row referenced by the preview.

insert() creates one preview_versions row whose ID is the preview ID, and stores that ID in previews.version_id. The delete() query should therefore use version_id rather than (file_id, version), which can match multiple previews (i.e. different dimensions) for the same file version.

Previously, deleting one preview could remove the preview_versions rows belonging to other previews of the same file version.

Changes:

  • Read the preview's version_id.
  • Delete the corresponding row from preview_versions by its id.
  • Preserve the existing handling for non-versioned previews, whose persisted version_id is -1

TODO

  • ...

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards added this to the Nextcloud 35 milestone Aug 14, 2026
@joshtrichards
joshtrichards requested a review from a team as a code owner August 14, 2026 16:46
@joshtrichards
joshtrichards requested review from come-nc and icewind1991 and removed request for a team August 14, 2026 16:46
@joshtrichards

Copy link
Copy Markdown
Member Author

/backport to stable34

@joshtrichards

Copy link
Copy Markdown
Member Author

/backport to stable33

Signed-off-by: Josh <josh.t.richards@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants