-
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
polish: show audits with debug string, don't fail loadfast4pwa on network latencies, works-offline change #2294
Changes from 2 commits
519da14
fe1b87d
8fa5061
3d33258
721cb5e
d50d55a
1b4b930
7ffa569
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,14 +41,16 @@ class WorksOffline extends Audit { | |
*/ | ||
static audit(artifacts) { | ||
let debugString; | ||
const passed = artifacts.Offline === 200; | ||
if (!URL.equalWithExcludedFragments(artifacts.URL.initialUrl, artifacts.URL.finalUrl)) { | ||
debugString = 'WARNING: You may be failing this check because your test URL ' + | ||
`(${artifacts.URL.initialUrl}) was redirected to "${artifacts.URL.finalUrl}". ` + | ||
'Try testing the second URL directly.'; | ||
const explanation = passed ? 'Your test URL' : | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we want to show this at all if they passed? If they passed, it means that the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. had that originally actually but it makes some sense that we flag that we don't know for sure if the original URL they wanted can be loaded offline, but the message is still a little off, I'll adjust it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. eh you know what, I'll just hide it if it passed, we don't have any actionable information for them in that scenario anyway since LH won't test it |
||
'You may be failing this check because your test URL'; | ||
debugString = `WARNING: ${explanation} (${artifacts.URL.initialUrl}) was redirected to ` + | ||
`"${artifacts.URL.finalUrl}". Try testing the second URL directly to verify .`; | ||
} | ||
|
||
return { | ||
rawValue: artifacts.Offline === 200, | ||
rawValue: passed, | ||
debugString | ||
}; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -343,7 +343,8 @@ class CategoryRenderer { | |
|
||
const manualAudits = category.audits.filter(audit => audit.result.manual); | ||
const nonManualAudits = category.audits.filter(audit => !manualAudits.includes(audit)); | ||
const passedAudits = nonManualAudits.filter(audit => audit.score === 100); | ||
const passedAudits = nonManualAudits.filter(audit => audit.score === 100 && | ||
!audit.result.debugString); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. add this to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ya done |
||
const nonPassedAudits = nonManualAudits.filter(audit => !passedAudits.includes(audit)); | ||
|
||
for (const audit of nonPassedAudits) { | ||
|
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.
lets keep this