Skip to content

refactor(trash): Port deletion code of Trashbin to node based API - #54278

Merged
susnux merged 3 commits into
masterfrom
cleanup-legacy-trash
Nov 18, 2026
Merged

susnux merged 3 commits into
masterfrom
cleanup-legacy-trash

Conversation

@CarlSchwan

Copy link
Copy Markdown
Member

Summary

Instead of using a mix of View and Node based file system manipulation, use the 'new' node based API everywhere.

Replace the hooks used in the admin_audit related to the deletion to new typed event that expose the deleted nodes.

And remove old calculateSize to get the size of the deleted folder and instead rely on the Node::getSize information.

Checklist

@CarlSchwan CarlSchwan added this to the Nextcloud 32 milestone Aug 6, 2025
@CarlSchwan CarlSchwan self-assigned this Aug 6, 2025
@CarlSchwan
CarlSchwan requested a review from a team as a code owner August 6, 2025 13:30
@CarlSchwan CarlSchwan added the technical debt 🧱 🤔🚀 label Aug 6, 2025
@CarlSchwan
CarlSchwan requested review from Altahrim, icewind1991 and leftybournes and removed request for a team August 6, 2025 13:30
@CarlSchwan
CarlSchwan force-pushed the cleanup-legacy-trash branch from 0291ef5 to 9114ebb Compare August 6, 2025 13:32
@CarlSchwan CarlSchwan changed the title cleanup(trash): Port deletion code of Trashbin to node based API refactor(trash): Port deletion code of Trashbin to node based API Aug 6, 2025
@CarlSchwan
CarlSchwan force-pushed the cleanup-legacy-trash branch 2 times, most recently from d0be8fd to 299859f Compare August 6, 2025 14:01
@CarlSchwan CarlSchwan added the 3. to review Waiting for reviews label Aug 6, 2025
@CarlSchwan
CarlSchwan marked this pull request as draft August 7, 2025 07:13
@skjnldsv skjnldsv added the ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring) label Aug 19, 2025
@github-actions

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@CarlSchwan
CarlSchwan force-pushed the cleanup-legacy-trash branch 2 times, most recently from 0e8f8b3 to f5294e5 Compare September 3, 2025 13:12
@CarlSchwan
CarlSchwan marked this pull request as ready for review September 3, 2025 13:21
Comment thread apps/files_trashbin/lib/Trashbin.php Resolved
@susnux susnux added the pending documentation This pull request needs an associated documentation update label Sep 3, 2025
Comment thread apps/files_trashbin/lib/Trashbin.php Resolved
@CarlSchwan
CarlSchwan force-pushed the cleanup-legacy-trash branch 2 times, most recently from a044d76 to 541b45e Compare September 3, 2025 14:55
@CarlSchwan CarlSchwan modified the milestones: Nextcloud 32, Nextcloud 33 Sep 3, 2025
Comment thread apps/files_trashbin/lib/Trashbin.php Resolved
@CarlSchwan
CarlSchwan force-pushed the cleanup-legacy-trash branch from 541b45e to ac029d1 Compare October 6, 2025 14:07
@blizzz blizzz added this to the Nextcloud 34 milestone Feb 16, 2026
This was referenced Jun 5, 2026
@susnux susnux removed this from the Nextcloud 34.0.1 milestone Jun 9, 2026
@CarlSchwan
CarlSchwan force-pushed the cleanup-legacy-trash branch 2 times, most recently from 0e56bba to b1d6386 Compare July 1, 2026 10:40
@CarlSchwan
CarlSchwan force-pushed the cleanup-legacy-trash branch 2 times, most recently from 0cf8b07 to f4c89a6 Compare July 10, 2026 08:11

@come-nc come-nc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

Comment thread apps/files_trashbin/lib/Trashbin.php Resolved
Carl Schwan and others added 3 commits November 18, 2026 22:22
Instead of using a mix of View and Node based file system manipulation,
use the 'new' node based API everywhere.

Replace the hooks used in the admin_audit related to the deletion to new
typed event that expose the deleted nodes.

And remove old calculateSize to get the size of the deleted folder and
instead rely on the Node::getSize information.

Signed-off-by: Carl Schwan <carlschwan@kde.org>
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
- Remove the reference to the non-existent BeforeAllNodeDeletedEvent
  and fix the descriptions of the trash bin deletion events.
- Add a test that Trashbin::delete returns the size of deleted files
  and folders, now that it relies on Node::getSize.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
The trash bin deletion and restore entries are now logged by
TrashbinEventListener, so the hook based action is no longer used.
Move its unit test to the listener.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux
susnux force-pushed the cleanup-legacy-trash branch from f4c89a6 to 6dcaeb6 Compare November 18, 2026 21:22
@susnux
susnux requested review from a team as code owners November 18, 2026 21:22
@susnux
susnux requested review from GhassenKefi and pabzm and removed request for a team November 18, 2026 21:22
@susnux
susnux merged commit d5d7cb0 into master Nov 18, 2026
214 of 229 checks passed
@susnux
susnux deleted the cleanup-legacy-trash branch November 18, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews AI assisted feedback-requested pending documentation This pull request needs an associated documentation update ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring) technical debt 🧱 🤔🚀

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants