You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
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?
Activity
schiessle commentedon Apr 8, 2013
sounds reasonable to only call the hooks if the operation can be performed
MTGap commentedon Apr 10, 2013
I'll work on it this weekend then.
MTGap commentedon Apr 13, 2013
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.
jancborchardt commentedon Aug 7, 2013
Closing because it’s seemingly fixed.