-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
fix(files): failsafe when executing actions methods #49685
Conversation
1a3fca5
to
0d7e5ae
Compare
/backport to stable30 |
/backport to stable29 |
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.
Good idea 👍
/backport to stable28 |
return action.displayName([this.source], this.currentView) | ||
} catch (e) { | ||
logger.error('Error while getting action display name', { action, e }) | ||
return '' |
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 should be at least some name, the empty string is not a good state also for ux.
Maybe use the ID.
if (title) return title | ||
} | ||
return action.displayName([this.source], this.currentView) | ||
} catch (e) { |
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.
} catch (e) { | |
} catch (error) { |
So the key in the logger context is meaningful
} | ||
return action.displayName([this.source], this.currentView) | ||
} catch (e) { | ||
logger.error('Error while getting action display name', { action, e }) |
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.
logger.error('Error while getting action display name', { action, e }) | |
logger.error('Error while getting action display name', { action, error }) |
try { | ||
return action?.inline?.(this.source, this.currentView) | ||
} catch (e) { | ||
logger.error('Error while checking if action is inline', { action, e }) |
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.
logger.error('Error while checking if action is inline', { action, e }) | |
logger.error('Error while checking if action is inline', { action, error }) |
let displayName = action.id | ||
try { | ||
displayName = action.displayName([this.source], this.currentView) | ||
} catch (e) { |
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.
} catch (e) { | |
} catch (error) { |
try { | ||
displayName = action.displayName([this.source], this.currentView) | ||
} catch (e) { | ||
logger.error('Error while getting action display name', { action, e }) |
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.
logger.error('Error while getting action display name', { action, e }) | |
logger.error('Error while getting action display name', { action, error }) |
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
0d7e5ae
to
4470dd6
Compare
/compile |
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Should avoid breaking the files app entirely when an external app have written invalid code.