Emit preDelete/postDelete file hooks for files removed during user deletion
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
Nextcloud have (pre|post)Delete hooks for both files and users. However, when user is deleted, all its files are gone too, but apps do not receive file delete hook, just user delete hooks. If app is dealing with user's files and keeping them internally and need to delete internal records when file is removed (basically - any app that subscribes to postDelete file hook) will end up with rows that cannot be cleaned up once user is deleted. Impact is that internal state (database) is getting bigger, and app developer need to hook into postDelete user and handle deleting bunch of files from another hook.
Repro:
- Create user
- Create bunch of files for that user
- Observe bunch of postCreate file hooks
- Delete user
- Observe lack of postDelete file hooks
Maybe this is a bug (should work, but it is not working), maybe this is request for a feature, maybe a 'by-design' (you like it this way and do not plan to change it).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the PHP server code for user-deletion handling and the existing preDelete/postDelete file-hook dispatch; the issue names no implementation files or tests. Reproduce the listed user-and-files scenario, then verify that observers receive the expected file hooks for each removed file without breaking user deletion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100