Skip to content

fix(files_trashbin): cleanup trash metadata after failed cross-user moves - #63070

Open
joshtrichards wants to merge 1 commit into
masterfrom
jtr/fix-trashbin-move2file-failureCleanup-db
Open

fix(files_trashbin): cleanup trash metadata after failed cross-user moves#63070
joshtrichards wants to merge 1 commit into
masterfrom
jtr/fix-trashbin-move2file-failureCleanup-db

Conversation

@joshtrichards

Copy link
Copy Markdown
Member
  • Resolves: #

Summary

Discovered this while working on #63069.

When moving a shared file to the trash fails (after its metadata row has been inserted), the failure-cleanup path calls deleteTrashRow() with the deleting user.

The row was inserted for the file owner (not deleting user), so this leaves orphaned files_trash metadata whenever the owner and deleting user differ.

Doesn't impact success path; just the rollback path.

This change uses $owner for the cleanup call, ensuring the inserted metadata row is removed. Other call sites for deleteTrashRow() in the class are correct in their context.

TODO

Checklist

AI (if applicable)

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

When moving a shared file to the trash fails after its metadata row has been inserted, the failure-cleanup path calls `deleteTrashRow()` with the deleting user.

The row was inserted for the file owner, so this leaves orphaned `files_trash` metadata whenever the owner and deleting user differ.

Doesn't impact success path; just the rollback path.

This change uses `$owner` for the cleanup call, ensuring the inserted metadata row is removed.

Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards

Copy link
Copy Markdown
Member Author

/backport to stable34

@joshtrichards
joshtrichards marked this pull request as ready for review August 8, 2026 03:00
@joshtrichards
joshtrichards requested a review from a team as a code owner August 8, 2026 03:00
@joshtrichards
joshtrichards requested review from Altahrim, leftybournes, provokateurin and salmart-dev and removed request for a team August 8, 2026 03:00
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