-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Check if the owner of a share exists #7348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
blizzz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested
Codecov Report
@@ Coverage Diff @@
## master #7348 +/- ##
============================================
- Coverage 50.91% 50.91% -0.01%
- Complexity 24699 24701 +2
============================================
Files 1586 1586
Lines 94116 94118 +2
Branches 1361 1361
============================================
+ Hits 47920 47921 +1
- Misses 46196 46197 +1
|
|
I remember that I discussed this issue with @blizzz a few days/weeks ago because I saw a similar issue on another instance. If I remember correctly our conclusion was that we should still show the folder but in a "temporarily not available" state, same as we do for external storage. If we just don't show it at all this will trigger the sync client to delete it and if the user back-end comes back the sync client will have to download everything again. Which can be really painful for large shared folders. |
AFAIK this is done via a |
Yes. |
|
But where to throw it :P?? |
|
@icewind1991 please see my two commits. I think they make it somewhat more sane. As the FailedStorage was not handle properly by the DAV app. Now it behaves better IMO. @schiessle The making red of the storage is actually handled by the files_external javascript. |
35a9e9c to
1fefe18
Compare
|
Ok, so my initial commit did not make much sense. As LDAP will also find out that the user is deleted. And still return it. Now the share will still show. But if you try to enter it you get a 'storage not available' notification. This is probably saner. |
|
One short question: how can the client request the server to get the current folder structure, if it is unable to log in, because the user backend is not available? Do you have any use case where one user is able to login but another user not because it is temporarly disabled? Can the user logged in by using a redis-session although the LDAP server is unavailable? |
|
@brunt82 no, LDAP is available. This case is about that a user disappeared from LDAP who was sharing a file or folder to another one, who logged in. And sees the shares, but has no way to access them and experiences confusing behaviour. |
|
Yes, I know. But you're discussing about an use case, which is unimportant (or maybe does not exist <- which was my question): it is difficult for me to imagine an use case where a LDAP user object is not available by a mistake. Let us assume the LDAP is not available. In this case all users are not able to login. So the clients cannot get the folder structure. But my question was: Does the redis-sessions still work, although the LDAP is not available? If yes, the clients may delete the folders, which are hidden by the server. A LDAP user will not be deleted by a mistake. And as I understood the issue, it is differed between an user object which was not found and a disabled object. So what other use cases do you know where an user object is not available for some time? |
0903076 to
7deaf59
Compare
|
Tests fixed |
| * @return Cache | ||
| */ | ||
| public function getCache($path = '', $storage = null) { | ||
| $this->init(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this causes a major performance hit.
Shared storage is left uninitialized for cache only work for a reason
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already the case.
https://github.com/nextcloud/server/blob/master/apps/files_sharing/lib/SharedStorage.php#L369
https://github.com/nextcloud/server/blob/master/apps/files_sharing/lib/Cache.php#L72
https://github.com/nextcloud/server/blob/master/apps/files_sharing/lib/SharedStorage.php#L458
https://github.com/nextcloud/server/blob/master/apps/files_sharing/lib/SharedStorage.php#L459
This just moves it earlier so the the cache of the storage is also set to FailedCache.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will need to fix that then...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough then let me drop this commit from here. As the first one is the most important one anyway I think
We have to double check. Since getting the info of the root returns a generic entry. But actually the stroage is not available. Else we get very weird sync and web behavior. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
7deaf59 to
d2fe30d
Compare
LukasReschke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐘
If the owner does not exist we should behave properly.
We can't delete the share at this point as a back end might just be temp
offline.
To test:
testfrom user1 to user2testBefore:
Now: