nextcloud / nextcloud/groupfolders

Trash backend doesn't emit notifications when deleting/restoring items

Open
#442 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop bug feature: trashbin good first issue
Dominant language
PHP
Stars
343
Forks
106
Avg merge
2d 3h
Merged PRs (30d)
34

Description

files_trashbin emits several events when a file is removed or restored from the trashbin. These are not emitted by the lib/Trash/TrashBackend.php

https://github.com/nextcloud/groupfolders/blob/4d672956b8f1ac761b16a32cae02681ad1657bfe/lib/Trash/TrashBackend.php#L87

https://github.com/nextcloud/groupfolders/blob/4d672956b8f1ac761b16a32cae02681ad1657bfe/lib/Trash/TrashBackend.php#L111

Specifically the events are:

\OC_Hook::emit('\OCP\Trashbin', 'delete', array('path' => $path));
\OC_Hook::emit('\OCP\Trashbin', 'preDelete', array('path' => $path));
\OCP\Util::emitHook('\OCA\Files_Trashbin\Trashbin', 'post_restore', array('filePath' => Filesystem::normalizePath('/' . $location . '/' . $uniqueFilename),
				'trashPath' => Filesystem::normalizePath($file)));

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review lib/Trash/TrashBackend.php at the referenced deletion and restoration locations, then compare its behavior with the listed files_trashbin hook events. The work is complete when the trash backend emits the specified delete, preDelete, and post_restore notifications with the documented path values.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.