-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Files or folders are not shown as shared unless the page is refreshed #6813
Comments
Anything in the logs ? Browser log ? Could be a race condition |
I don't see anything which seems important or related to this issue in the logs or browser logs. |
Ok I think this is because all shares are loaded and cached the first time the files list is loaded. |
I can still reproduce this in stable7 |
Yes, this is not fixed. Need a good solution, but I don't want to revert back to loading ALL shares every time the user navigates between folders. Ideally I'd like to move all sharing calls to the OCS Share API, maybe it would be a good start here for OC 8. |
@PVince81 Is this still open? |
Yes |
CC @rullzer just for information. |
Yes. But how to do this is not trivial. A possible solution for new shares is a function get shares since. Which would just check for the stime (share time). However that would not solve the other case where a share is deleted. Of course the best solution would be to have a push channel from the server. But I do not see that happening any time soon. Maybe the best (and easiest) fix would be to add ETag stuff to the OCS responses. So the browser makes regular polls to the server for the shares of the current directory. It adds the IF_NONE_MATCH header (which it caches). So if new shares are found (or removed) the ETag won't match and updates have to be performed. If it is a 304 nothing needs to happen. The ETag in OCS responses can then just be the MD5 or so of the response. Which will be the same if nothing in the shares changed. It will not be instant that way but polling every minute is already a better UX. And as a bonus we could also use this in the clients for if the dialog is open. |
I would rate this a duplicate of #983 |
The point here is to keep the user synced as much as possible, and since up to now is the only way to do it, in the mobile client we are updating share files while the user navigates. We are doing a lot of requests for that, but doing that we ensure that the user is always up to date. Since a mobile device have less resources than the web, we expect the same behaviour on the web. |
The Anything else is out of scope as it would require having something that monitors changes on the server, which is in the same level as detecting changes in the file list listing (and shares) and updating the UI in real-time. See #983 |
Yeah... that does not scale... 😞 |
Note that OC 5 did that when we didn't have ajax file navigation back then. It would reload the full page when switching folders, so the shares were always up to date... |
So to be clear, currently we cache the results?
Is this currently what is happening? |
The cache is simply the JS variable |
The TTL might not work properly, this is old API and we don't have direct proper control to detect when it is being read... The easiest would be to clear that array after switching folders. |
Moving the code to the OCS Share API will help fixing this: the list of shares for the current folder is retrievable with "subfiles=true". So every time the folder is switched, this call needs to be made for the current folder. I believe this is how mobile/desktop clients do to be able to display sharing statuses. See #21554 for the port to OCS Share API |
Fixed in 9.0 through #21554. When switching folders, the status icons are re-fetched from the server for the current folder. |
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. |
Expected behaviour
File is shown as shared
Actual behaviour
File is not shown as shared unless the page is refreshed
Steps to reproduce
Other steps to reproduce is using curl
curl -u user http://serverName/owncloud/ocs/v1.php/apps/files_sharing/api/v1/shares -d path=/documents/file.png -d shareType=3
where user is the user you are using
and -d path is where the file is
The same bug happens when a folder is shared
Server configuration
Owncloud version: It was tested in daily
{"installed":"true","version":"6.90.0.1","versionstring":"7.0 pre alpha","edition":""}e:
Client configuration
Browser: chrome, firefox
Operating system: MaOs 10.7.5
The text was updated successfully, but these errors were encountered: