Repository navigation
Add locking to modifying operation of the OCS Share API - #22989
Conversation
| } | ||
|
|
||
| if (!$this->canAccessShare($share)) { | ||
| return new \OC_OCS_Result(null, 404, 'could not delete share'); |
There was a problem hiding this comment.
@icewind1991 told me that we unlock anyway when shutting down the request...
There was a problem hiding this comment.
would still be good to unlock early like we do in the View.
The reason for unlock on shutdown is just a failsafe in case of uncaught exceptions
d407f82 to
39e2f5d
Compare
39e2f5d to
eeae157
Compare
|
Please rereview |
eeae157 to
3dc7914
Compare
|
We really need some kind of middleware for OCS as well. because it is not becoming more readable now... @PVince81 @MorrisJobke please have another look |
|
I tested this and it works. 👍 |
|
The only thing I noticed:
The feedback is properly shown, if the sidebar is already open. |
|
@rullzer do you want to fix the web UI part here or separately ? |
|
Lets fix the UI stuff in a different PR |
Fixes #17243 This is done in the OCS Share API instead of the share manager since we want lazy shares in general. However when doing modifying calls via the OCS Share API it is fine to force real nodes. * Updated unit tests to work with logging
3dc7914 to
b5cb700
Compare
|
Rebased to fix the conficts |
b5cb700 to
8a652d1
Compare
| return $this->getSharedWithMe($path); | ||
| $result = $this->getSharedWithMe($path); | ||
| if ($path !== null) { | ||
| $path->unlock(ILockingProvider::LOCK_SHARED); |
There was a problem hiding this comment.
why only if $path === null? Do we really want to keep the lock if the path is null? We will leave the method with the return statement below and the file will remain locked.
There was a problem hiding this comment.
Because there is no unlock() method on null ;) It's a !== ;)
There was a problem hiding this comment.
well yeah exactly that ;)
There was a problem hiding this comment.
Ah, now I see that you do the unlock directly on $path.... my mistake. I thought that in case of the storage root of shared mount it could be null... But forget about it 😀
|
Didn't tests it but code looks good 👍 |
|
Tested and works 👍 |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Fixes #17243
This is done in the OCS Share API instead of the share manager since we
want lazy shares in general. However when doing modifying calls via the
OCS Share API it is fine to force real nodes.
CC: @PVince81 @icewind1991 @schiesbn