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

fix(files): handle empty view with error #48625

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ShGKme
Copy link
Contributor

@ShGKme ShGKme commented Oct 9, 2024

Summary

Handles error during content fetching.

In Nextcloud 27 in case of an error it redirected to the / root and (sometimes) showed a toast message with an error.

if (status === 401) {
// We are not authentificated, so reload the page so that we get
// redirected to the login page while saving the current url.
location.reload();
}
// Firewall Blocked request?
if (status === 403) {
// Go home
this.changeDirectory('/');
OC.Notification.show(t('files', 'This operation is forbidden'), {type: 'error'});
return false;
}
// Did share service die or something else fail?
if (status === 500) {
// Go home
this.changeDirectory('/');
OC.Notification.show(t('files', 'This directory is unavailable, please check the logs or contact the administrator'),
{type: 'error'}
);
return false;
}
if (status === 503) {
// Go home
if (this.getCurrentDirectory() !== '/') {
this.changeDirectory('/');
// TODO: read error message from exception
OC.Notification.show(t('files', 'Storage is temporarily not available'),
{type: 'error'}
);
}
return false;
}
if (status === 400 || status === 404 || status === 405) {
// go back home
this.changeDirectory('/');
return false;
}

After migrating to Vue, there is no error handling. It just shows a folder as an empty folder.

It is especially confusing when it was supposed to be a valid link:

  • Unshared/deleted shared folder
  • Unavailable storage

It looks like the folder is available, just empty.

I found redirecting to the root less convenient to a user in flavor of explicitly showing an error and a button to reload it.

But I'm not sure about the text/design.

Screenshots

Before After
image image

Checklist

@ShGKme ShGKme added this to the Nextcloud 31 milestone Oct 9, 2024
@ShGKme ShGKme self-assigned this Oct 9, 2024
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
@ShGKme ShGKme force-pushed the fix/files--handle-empty-view-with-error branch from 4ebe5a3 to 6dec370 Compare October 14, 2024 16:05
@ShGKme ShGKme requested review from susnux and Pytal October 14, 2024 18:45
@ShGKme ShGKme added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Oct 14, 2024
@ShGKme ShGKme changed the title [wip] fix(files): handle empty view with error fix(files): handle empty view with error Oct 14, 2024
@ShGKme ShGKme marked this pull request as ready for review October 14, 2024 18:47
@ShGKme ShGKme requested a review from skjnldsv as a code owner October 14, 2024 18:47
<template #icon>
<IconReload :size="20" />
</template>
{{ t('files', 'Reload') }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe retry?

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.

"No files" display on Files tab w/ faulty federation shares or External Storage
2 participants