-
Notifications
You must be signed in to change notification settings - Fork 345
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
webui: Adding report for JS bugs #5225
webui: Adding report for JS bugs #5225
Conversation
14eebfe
to
063f4a6
Compare
36d1c84
to
cfc20ec
Compare
cfc20ec
to
5feef0f
Compare
ui/webui/src/components/Error.jsx
Outdated
{exceptionNamePrefix + exception.message} | ||
</Text> | ||
</TextContent> | ||
{exception.stack && |
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.
I know this was cherry-picked from the commit that I wrote, but as said on slack, I think we do not need to show the stracktrace inside the error modal.
The reason we show the log from journal is to allow the user to edit it so as to remove sensitive information like passwords etc.
So I think it's enough to store the stackstrace into a file, like webui-js-stacktrace.txt, and that we inform the user about the existence of it.
The design can be discussed with @garrett
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.
I'll definitely edit it again, I honestly didn't really understand the messages I have to do here, so I at least got the existing solution to work in all cases. Now I get it and I'll edit it
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.
I agree with @KKoukiou about not showing the stacktrace.
And we wouldn't even show the log, except that it might have some user identifiable parts (although even this is somewhat questionable, as it's on a live system without user data... I suppose a created user or IP address might be shown? I can't think of much else that would be user-identifiable in the logs.)
Ideally, we'd just show a basic summary. People encountering errors can't really do anything about them for the most part.
ui/webui/src/components/app.jsx
Outdated
|
||
// Listen on JS errors | ||
window.onerror = (err, url, line, col, errObj) => { | ||
setOops(errObj); |
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.
Please remove the console.error, this was used for debugging.
@garrett If it would be possible, I would like to include in this error reporting window instead of the stacktrace block, just a short description of the error and a button to download the stacktrace in txt format, because as @KKoukiou said, there is no need to show the stacktrace unlike the log. This is of course just a sketch, it may turn out differently |
What can someone do with a stack trace, if they're not an Anaconda developer? (They could report it, but shouldn't that already be handled when they click the button to report it?) |
They can add the file to the bugzilla for us. |
There's a send button. Why not send that over? Why make someone download a file somewhere, then go to the issue, and attach it? Worse yet, they may need to reboot into a working OS or use another computer... and then somehow find the URL for the bug. And this is even assuming that they made an account and signed in with it to report the bug in the first place. This is an extremely high barrier to actually do anything with a backtrace. It needs to be attached to the report when clicking the button. Anything else is madness, and people will generally not do this (nor even be able to). |
This would of course be the ideal situation if pressing the button would automatically pass everything to the bugzilla, since I talked with Radek, the log is added to the bugzilla later using a log file that is taken directly from the device, because the log is in most cases larger than the maximum message size in the bugzilla. |
I'd suggest to:
|
5feef0f
to
e1cc8b2
Compare
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.
I think we should keep the backdrop behind the dialog.
de9ed41
to
06bb035
Compare
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 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.
Please test this with automation tests.
ui/webui/src/components/Error.jsx
Outdated
); | ||
newUrl.searchParams.append( | ||
"comment", | ||
"Installer WebUI Critical Error:\n" + context + exception.name + ": " + exception.message | ||
"Installer WebUI Critical Error:\n" + context + name + exception.message + "\n\n StackTrace: " + exception.stack |
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.
For backend errors , the StrackTrace is not going to be there. Maybe remove this from the bug report?
ui/webui/src/components/Error.jsx
Outdated
@@ -228,7 +229,6 @@ export const CriticalError = ({ exception, isBootIso, isConnected, reportLinkURL | |||
buttons={[quitButton(isBootIso)]} | |||
isConnected={isConnected} | |||
/> |
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.
This is an unrelated change, please make sure to keep your PRs clean from unrelated changes.
ui/webui/src/components/Error.jsx
Outdated
@@ -93,7 +93,7 @@ export const BZReportModal = ({ | |||
detailsLabel, | |||
detailsContent, | |||
buttons, | |||
isConnected | |||
isConnected, |
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.
This is an unrelated change, please make sure to keep your PRs clean from unrelated changes.
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.
Sorry, I dont clean it after my changes.
ui/webui/src/components/app.jsx
Outdated
// Listen on JS errors | ||
window.onerror = (err, url, line, col, errObj) => { | ||
setJsEroor(errObj); | ||
err = null; |
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.
Where do you use the err? Why you set it to null?
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.
This is probably not the ideal solution, but the parameters here are necessary for the function to work properly, but lint will display an error if I don't work/maintain the variable in any way, so this seemed like the least painful solution if we don't want to write it out.
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.
Ah for that the common way to approach is to use underscore instead of the variable name so (_, _, _, _, errObj)
ui/webui/src/components/app.jsx
Outdated
onAddErrorNotification={onAddErrorNotification} | ||
{(criticalError || jsError) && | ||
<CriticalError | ||
exception={{ ...criticalError, message: jsError?.message || criticalError?.message, stack: jsError?.stack }} |
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.
THis is fine as first go probably, but I feel we might need to expect backend and front end crashing in parallel, so we need to report both.
ui/webui/src/components/app.jsx
Outdated
isBootIso={isBootIso} | ||
isConnected={state.network.connected} | ||
reportLinkURL={bzReportURL} />} | ||
{!jsError && |
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.
Hm, I think it's fine to show the page in the background if an error occured. It's blurred anyhow - and the user can't get out of the CriticalError modal without quiting the installer eventually.
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.
Unfortunately, the page must be hidden during a JS error where the error occurs in order to display the modal at all. If the js error is still running it is no longer possible to display any JS code.
64da690
to
f35c6ec
Compare
155da1f
to
f820f12
Compare
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.
Please add a test (always :)) You can test raising an exception from the UI with:
with self.assertRaisesRegex(RuntimeError, "TypeError:.*undefined"):
@@ -177,14 +177,18 @@ export const BZReportModal = ({ | |||
|
|||
const addExceptionDataToReportURL = (url, exception) => { | |||
const newUrl = new URL(url); | |||
const backendMessage = exception.backendMessage ? exception.backendMessage + (exception.jsMessage ? " " : "") : ""; |
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.
You will probaly need new lines between then backend, jsMessage and stackTrace. Did you try it but I am not sure they are included in the errors (the new lines)
Can you please verify?
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.
I checked and there are no newlines at the end of the reports. I added them to the url.
9212db0
to
9a853c0
Compare
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.
Please add the screenshot and rebase.
ui/webui/test/check-basic
Outdated
b.wait_visible("#critical-error-bz-report-modal.pf-c-modal-box") | ||
self._testLogReview(b, m, "critical-error") | ||
|
||
b.assert_pixels( |
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 was not screenshot generated or added by you. I think it's because the class it wrong.
39ec4ee
to
8e3eebd
Compare
8e3eebd
to
da80325
Compare
da80325
to
b832747
Compare
/kickstart-test --waive webui only |
Modification of the existing bug report system and addition of a report option for critical bugs related to JS.
Based on commit: e242c12
Report looks like this:
Bugzilla: