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
{{ message }}
Repository navigation
Changing share permissions should trigger an etag change #16587
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.
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.
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.
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.
@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.
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.
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
Activity
PVince81 commentedon May 27, 2015
Raised #16589 for the other metadata/properties
PVince81 commentedon May 27, 2015
@DeepDiver1975 @karlitschek @cmonteroluque scheduling for 8.2.
Please adjust tags if necessary.
PVince81 commentedon May 28, 2015
CC @icewind1991 FYI
DeepDiver1975 commentedon Jun 19, 2015
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
guruz commentedon Jun 22, 2015
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.
PVince81 commentedon Jun 22, 2015
@icewind1991 can you evaluate the complexity and impact ? Thanks
DeepDiver1975 commentedon Jun 22, 2015
I had a different impression on this while talking to @dragotin - anyway nothing to think about right now.
DeepDiver1975 commentedon Jun 22, 2015
@cmonteroluque please move to 8.2 - THX
2 remaining items
guruz commentedon Jun 22, 2015
@dragotin No it does not :) We'll need an
UpdateEtagJobin 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.
ogoffart commentedon Jun 23, 2015
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_etagis 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.
dragotin commentedon Jun 23, 2015
ok, thanks @ogoffart, that's a clear explanation.
PVince81 commentedon Sep 22, 2015
Do will still want this addition for 8.2 ? Is there an agreement to implement this on the server already ?
@DeepDiver1975 @icewind1991 @cmonteroluque
PVince81 commentedon Sep 28, 2015
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. @icewind1991Another 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
icewind1991 commentedon Sep 28, 2015
We could maybe trigger the same etag propagation for shares which is used for writes
DeepDiver1975 commentedon Oct 1, 2015
@icewind1991 can I ask you to come up with a PR on this? THX
icewind1991 commentedon Oct 1, 2015
Will look into it
icewind1991 commentedon Oct 1, 2015
PR is here: #19511