Skip to content

Changing share permissions should trigger an etag change #16587

Closed

Description

@ckamm

As discussed with @guruz @ogoffart @PVince81: Whenever file metadata (mtime, permissions, ...) changes, the parent folder's etag should change. That notifies sync clients and allows them to check for changes.

The particular issue here is that changing the permissions of a share (readonly<->readwrite) does not trigger an etag change. Therefore the sync client does not notice that the permissions of the shared files have changed.

Required for owncloud/client#3244

Activity

  1. PVince81 commented on May 27, 2015

    @PVince81
    Contributor

    Raised #16589 for the other metadata/properties

  2. PVince81 commented on May 27, 2015

    @PVince81
    Contributor

    @DeepDiver1975 @karlitschek @cmonteroluque scheduling for 8.2.
    Please adjust tags if necessary.

  3. added this to the milestone on May 27, 2015
  4. PVince81 commented on May 28, 2015

    @PVince81
    Contributor
  5. ghost added this to the milestone on Jun 19, 2015
  6. ghost removed this from the milestone on Jun 19, 2015
  7. DeepDiver1975 commented on Jun 19, 2015

    @DeepDiver1975
    Contributor

    Dependency for owncloud/client#3244 as reason to fix in 8.1

    This would require to change which might have a too big impact on the overall system.
    @PVince81 was absolutely right to schedule this for 8.2

    Furthermore @dragotin and myself had a discussion recently if we should introduce a second etag which changes only on meta data modifications - where as the original etag is only to be used for content changes.

    Topic to be discussed -> 8,2

  8. guruz commented on Jun 22, 2015

    @guruz
    Contributor

    Furthermore @dragotin and myself had a discussion recently if we should introduce a second etag which changes only on meta data modifications - where as the original etag is only to be used for content changes.

    No need to do that, just change the directory etag (up to the root as usual) and the sync client could re-PROPFIND the directory to get the meta data of each file in a dir.

  9. PVince81 commented on Jun 22, 2015

    @PVince81
    Contributor

    @icewind1991 can you evaluate the complexity and impact ? Thanks

  10. DeepDiver1975 commented on Jun 22, 2015

    @DeepDiver1975
    Contributor

    No need to do that, just change the directory etag (up to the root as usual) and the sync client could re-PROPFIND the directory to get the meta data of each file in a dir.

    I had a different impression on this while talking to @dragotin - anyway nothing to think about right now.

  11. DeepDiver1975 commented on Jun 22, 2015

    @DeepDiver1975
    Contributor

    @cmonteroluque please move to 8.2 - THX

  12. 2 remaining items

  13. ghost removed this from the milestone on Jun 22, 2015
  14. guruz commented on Jun 22, 2015

    @guruz
    Contributor

    @dragotin No it does not :) We'll need an UpdateEtagJob in the client for the behaviour that @ckamm @ogoffart and me had discussed. @ckamm Did you create a client-side issue for this?

    @dragotin Changing the ETag of the file when the permissions/metadata changed would be the simple behaviour that always works (also currently) but however would get the client to re-download possibly a lot of things.

  15. ogoffart commented on Jun 23, 2015

    @ogoffart

    Changing the etag of the parent directory is enough.
    When the etag of the parent directory changes, the client will do an PROFPFIND with depth 1 on the directory and that will fetch all the metadata of every file in that directory. Then if the permissions or other metadata changed (but not the etag) the flag should_update_etag is set which means we will re-write the entry into the database.

    And we should not change the etag of the file when the permissions changes otherwise we would need to download it again and that is not good.

  16. dragotin commented on Jun 23, 2015

    @dragotin
    Contributor

    ok, thanks @ogoffart, that's a clear explanation.

  17. PVince81 commented on Sep 22, 2015

    @PVince81
    Contributor

    Do will still want this addition for 8.2 ? Is there an agreement to implement this on the server already ?

    @DeepDiver1975 @icewind1991 @cmonteroluque

  18. PVince81 commented on Sep 28, 2015

    @PVince81
    Contributor

    I guess we'll need a new sharing hook "post_changesharepermission". Then hook it up with Shared_Updater like the other hooks and trigger correctUsersFolder() for each recipient which will update the etag of every parent. Not sure about nested reshares though. @icewind1991

    Another tricky piece is to detect that only the permissions of a share has changed (and nothing else) inside the share.php jungle and trigger the hook from there. @rullzer @schiesbn

  19. icewind1991 commented on Sep 28, 2015

    @icewind1991
    Contributor

    We could maybe trigger the same etag propagation for shares which is used for writes

  20. DeepDiver1975 commented on Oct 1, 2015

    @DeepDiver1975
    Contributor

    @icewind1991 can I ask you to come up with a PR on this? THX

  21. icewind1991 commented on Oct 1, 2015

    @icewind1991
    Contributor

    Will look into it

  22. icewind1991 commented on Oct 1, 2015

    @icewind1991
    Contributor

    PR is here: #19511

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions