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

core: suppress protocol timeout for app manifest bug in LR #7184

Merged
merged 4 commits into from
Feb 8, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions lighthouse-core/gather/gather-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,20 @@ class GatherRunner {
* @return {Promise<LH.Artifacts.Manifest|null>}
*/
static async getWebAppManifest(passContext) {
const response = await passContext.driver.getAppManifest();
if (!response) return null;
return manifestParser(response.data, response.url, passContext.url);
try {
const response = await passContext.driver.getAppManifest();
if (response) return manifestParser(response.data, response.url, passContext.url);
Copy link
Member

Choose a reason for hiding this comment

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

this should move below the catch so we aren't accidentally hiding errors in the parser

} catch (err) {
// LR will timeout fetching the app manifest in some cases
Copy link
Member

@brendankenny brendankenny Feb 7, 2019

Choose a reason for hiding this comment

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

LR will timeout fetching the app manifest in some cases

maybe just add ", move on without one." to this line, delete the lines after this, and link to the full https://github.com/GoogleChrome/lighthouse/issues/7147 (even better if there's a definitive summary comment to link to)

// for example, long polling (http://uninterested-badge.surge.sh/index4.html)
// or web workers (rarely https://exterkamp.codes/)
// see #7147 or b/124008171
// instead of failing completely by throwing a protocol timeout error,
// just pretend there is no app manifest.
log.error('Failed fetching manifest', err);
Copy link
Member

Choose a reason for hiding this comment

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

need a log.error('GatherRunner', 'Failed fetching...', err);

}
Copy link
Member

Choose a reason for hiding this comment

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

should the catch only apply for a err.code === 'PROTOCOL_TIMEOUT', otherwise rethrow?


return null;
}

/**
Expand Down