Skip to content

Conversation

@rullzer
Copy link
Member

@rullzer rullzer commented Nov 30, 2017

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:

  1. Setup NC with LDAP
  2. Share a folder test from user1 to user2
  3. Delete user1 from LDAP
  • DO NOT NOTIFY NEXTCLOUD
  1. Login as user2
  2. navigate to test

Before:

  • If you enter test you will not see any content and warnings will be thrown
  • Weird sync behavior

Now:

  • Warning that the storage is temporaly unavailable
  • Sync client skips the folder because it is not available

blizzz
blizzz previously approved these changes Nov 30, 2017
Copy link
Member

@blizzz blizzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested

@codecov
Copy link

codecov bot commented Nov 30, 2017

Codecov Report

Merging #7348 into master will decrease coverage by <.01%.
The diff coverage is 50%.

@@             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
Impacted Files Coverage Δ Complexity Δ
apps/dav/lib/Connector/Sabre/ObjectTree.php 56.97% <50%> (-0.17%) 34 <0> (+2)

@schiessle
Copy link
Member

schiessle commented Nov 30, 2017

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.

@MorrisJobke
Copy link
Member

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 StorageNotAvailableException right, @icewind1991 ?

@icewind1991
Copy link
Member

AFAIK this is done via a StorageNotAvailableException right, @icewind1991 ?

Yes.

@rullzer
Copy link
Member Author

rullzer commented Nov 30, 2017

But where to throw it :P??

@rullzer
Copy link
Member Author

rullzer commented Nov 30, 2017

@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.

@rullzer rullzer force-pushed the filterout_shares_of_nonexisting_users branch from 35a9e9c to 1fefe18 Compare November 30, 2017 20:38
@rullzer
Copy link
Member Author

rullzer commented Nov 30, 2017

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.

@brunt82
Copy link

brunt82 commented Dec 1, 2017

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?

@blizzz
Copy link
Member

blizzz commented Dec 1, 2017

@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.

@blizzz blizzz dismissed their stale review December 1, 2017 09:42

code changed

@brunt82
Copy link

brunt82 commented Dec 1, 2017

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?

@rullzer rullzer force-pushed the filterout_shares_of_nonexisting_users branch from 0903076 to 7deaf59 Compare December 1, 2017 11:40
@rullzer
Copy link
Member Author

rullzer commented Dec 1, 2017

Tests fixed

* @return Cache
*/
public function getCache($path = '', $storage = null) {
$this->init();
Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

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>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@rullzer rullzer force-pushed the filterout_shares_of_nonexisting_users branch from 7deaf59 to d2fe30d Compare December 4, 2017 14:23
Copy link
Member

@LukasReschke LukasReschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐘

@rullzer rullzer merged commit 1287da8 into master Dec 6, 2017
@rullzer rullzer deleted the filterout_shares_of_nonexisting_users branch December 6, 2017 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants