nextcloud/server

File delete hooks on user deletion hook

Open

#14,004 创建于 2019年2月3日

在 GitHub 查看
 (0 评论) (1 反应) (0 负责人)PHP (4,865 fork)batch import
1. to developenhancementfeature: users and groupsgood first issue

仓库指标

Star
 (34,953 star)
PR 合并指标
 (平均合并 20天) (30 天内合并 627 个 PR)

描述

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).

贡献者指南