Skip to content
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

Don't break when one remote share is down #19861

Merged

Conversation

nickvergessen
Copy link
Member

getFileInfo can also return false
Found while trying to improve on #14797

getFileInfo can also return false

Signed-off-by: Joas Schilling <coding@schilljs.com>
@kesselb
Copy link
Contributor

kesselb commented Mar 9, 2020

var file = {
shareOwner: share.owner + '@' + share.remote.replace(/.*?:\/\//g, ''),
name: OC.basename(share.mountpoint),
mtime: share.mtime * 1000,
mimetype: share.mimetype,
type: share.type,
id: share.file_id,
path: OC.dirname(share.mountpoint),
permissions: share.permissions,
tags: share.tags || []
}

Please consider to update the code here. Right now all those fields are expected.

@nickvergessen
Copy link
Member Author

Sure we can add something like:

			$share['mimetype'] = 'httpd/unix-directory';
			$share['mtime'] = 0;
			$share['permissions'] = Constants::PERMISSION_READ | Constants::PERMISSION_DELETE;
			$share['type'] = 'dir';
			$share['file_id'] = 0;

But the main issue stays. The info is wrong and deleting doesnt work either. Also I don't see a problem in my console/UI without that (apart from no mimetype icon being displayed).

I think someone needs to have a proper look and handle unavailable shares in a much better fashion globally. For now getting rid of the broken part of the response is good enough for me.

Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

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

looks sane

@nickvergessen nickvergessen merged commit 24d0fb9 into master Mar 11, 2020
@nickvergessen nickvergessen deleted the bugfix/noid/load-remote-shares-also-when-one-is-down branch March 11, 2020 08:37
@nickvergessen
Copy link
Member Author

/backport to stable18

@backportbot-nextcloud
Copy link

backport to stable18 in #19886

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants