-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Improve github issue title #992
Improve github issue title #992
Conversation
@@ -53,7 +53,7 @@ document.addEventListener('DOMContentLoaded', _ => { | |||
qsBody += '**Stack Trace**:\n ```' + err.stack + '```'; | |||
|
|||
const base = 'https://github.com/googlechrome/lighthouse/issues/new?'; | |||
const title = encodeURI('title=Lighthouse Extension Error'); | |||
const title = encodeURI('title=Extension Error: ' + err.message); | |||
const body = '&body=' + encodeURI(qsBody); |
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 feel like this would benefit from some upper bound truncation in case the err.message
gets a little long.
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.
+1 on truncation. We don't gain much after the first line and the entire message is already in the body.
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.
@addyosmani @ebidel Done, and now this PR truncates appened error messages at 60 characters.
const title = encodeURI('title=Extension Error: ' + err.message); | ||
let titleError = err.message; | ||
if (titleError.length > MAX_ISSUE_ERROR_LENGTH) { | ||
titleError = err.message.substring(0, MAX_ISSUE_ERROR_LENGTH - 3) + '...'; |
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.
use titleError
:
titleError = `${titleError.substring(0, MAX_ISSUE_ERROR_LENGTH - 3)}...`;
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.
@ebidel 👍 concatenation replaced with template literal
@@ -53,7 +55,11 @@ document.addEventListener('DOMContentLoaded', _ => { | |||
qsBody += '**Stack Trace**:\n ```' + err.stack + '```'; | |||
|
|||
const base = 'https://github.com/googlechrome/lighthouse/issues/new?'; | |||
const title = encodeURI('title=Lighthouse Extension Error'); | |||
let titleError = err.message; | |||
if (titleError.length > MAX_ISSUE_ERROR_LENGTH) {; |
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.
delete semicolon
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.
@brendankenny done!
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.
LGTM!
🍻 |
Currently the Lighthouse Extension Errors create a generic title that is too ambiguous to differentiate duplicates without actually clicking on the issue.
This PR appends the JS error to the title.