Skip to content

Post hooks sent for failed operation #2765

Closed

Description

@MTGap

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

Activity

  1. schiessle commented on Apr 8, 2013

    @schiessle
    Contributor

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

  2. MTGap commented on Apr 10, 2013

    @MTGap
    ContributorAuthor

    I'll work on it this weekend then.

  3. MTGap commented on Apr 13, 2013

    @MTGap
    ContributorAuthor

    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.

  4. jancborchardt commented on Aug 7, 2013

    @jancborchardt
    Contributor

    Closing because it’s seemingly fixed.

  5. locked as resolved and limited conversation to collaborators on Aug 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions