core icon indicating copy to clipboard operation
core copied to clipboard

Post hooks sent for failed operation

Open MTGap opened this issue 13 years ago • 4 comments

Post hooks are sent for operations that fail. For example a call to unlink in the shared storage when delete permission is not set will return false. The post_delete hook sent then causes the file cache to remove the file even though the file was never deleted.

I think it would be a good idea to not send the post hooks if the operation returns false, but there are also areas that listen to the delete hook and expect the operation to work. So, should we also be checking permissions in OC\Files\View for the file manipulation functions as well to make sure no hooks are sent?

@dragotin @karlitschek @icewind1991 @schiesbn

MTGap avatar Apr 06 '13 16:04 MTGap

sounds reasonable to only call the hooks if the operation can be performed

schiessle avatar Apr 08 '13 11:04 schiessle

I'll work on it this weekend then.

MTGap avatar Apr 10 '13 17:04 MTGap

So I started adding permission checks so we wouldn't have code listening to hooks that will fail for sure because of permissions. Unfortunately shared storage has some special cases so it doesn't work out nicely.

The main problem though is that certain apps are doing things, i.e. files_versions, files_trashbin when listening to hooks and there is no way to verify the action occurred unless it listens to the post hooks instead. Does anyone have any ideas to improve this?

I'll push what I have now since it fixes #2484.

MTGap avatar Apr 13 '13 19:04 MTGap

Closing because it’s seemingly fixed.

jancborchardt avatar Aug 07 '13 18:08 jancborchardt