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(installable-manifest): pipeline-restarted check #13365

Merged
merged 8 commits into from
Nov 17, 2021
15 changes: 11 additions & 4 deletions lighthouse-core/audits/installable-manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const UIStrings = {
'columnValue': 'Failure reason',
/**
* @description [ICU Syntax] Label for an audit identifying the number of installability errors found in the page.
*/
*/
'displayValue': `{itemCount, plural,
=1 {1 reason}
other {# reasons}
Expand Down Expand Up @@ -56,9 +56,9 @@ const UIStrings = {
'manifest-missing-suitable-icon': `Manifest does not contain a suitable icon - PNG, SVG or WebP format of at least {value0}\xa0px is required, the sizes attribute must be set, and the purpose attribute, if set, must include "any".`,

/**
* @description Error message explaining that the manifest does not supply an icon of the correct format.
* @example {192} value0
*/
* @description Error message explaining that the manifest does not supply an icon of the correct format.
* @example {192} value0
*/
'no-acceptable-icon': `No supplied icon is at least {value0}\xa0px square in PNG, SVG or WebP format, with the purpose attribute unset or set to "any"`,

/** Error message explaining that the icon could not be downloaded. */
Expand Down Expand Up @@ -95,6 +95,8 @@ const UIStrings = {
'warn-not-offline-capable': `Page does not work offline. The page will not be regarded as installable after Chrome 93, stable release August 2021.`,
/** Error message explaining that Lighthouse failed while detecting a service worker, and directing the user to try again in a new Chrome. */
'protocol-timeout': `Lighthouse could not determine if there was a service worker. Please try with a newer version of Chrome.`,
/** Message logged when the web app has been uninstalled o desktop, signalling that the install banner state is being reset. */
'pipeline-restarted': 'PWA has been uninstalled and installability checks resetting.',
};
/* eslint-enable max-len */

Expand Down Expand Up @@ -146,6 +148,11 @@ class InstallableManifest extends Audit {
continue;
}

// Filter out errorId 'pipeline-restarted' since it only applies when the PWA is uninstalled.
if (err.errorId === 'pipeline-restarted') {
continue;
}

// @ts-expect-error errorIds from protocol should match up against the strings dict
const matchingString = UIStrings[err.errorId];

Expand Down
3 changes: 3 additions & 0 deletions shared/localization/locales/en-US.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions shared/localization/locales/en-XL.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ Array [
`);
});

// TODO: https://github.com/GoogleChrome/lighthouse/issues/13147
it.skip('are each handled explicitly in the gatherer', () => {
it('are each handled explicitly in the gatherer', () => {
const errorStrings = Object.keys(InstallableManifestAudit.UIStrings)
.filter(key => chromiumErrorIds.includes(key))
.sort();
Expand Down