Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix: android flag as object - #142

#142
Open
bruno-s-freitas wants to merge 1 commit into
sitespeedio:mainsitespeedio/plugin-lighthouse:mainfrom
bruno-s-freitas:patch-1bruno-s-freitas/plugin-lighthouse:patch-1Copy head branch name to clipboard
Open

fix: android flag as object#142
bruno-s-freitas wants to merge 1 commit into
sitespeedio:mainsitespeedio/plugin-lighthouse:mainfrom
bruno-s-freitas:patch-1bruno-s-freitas/plugin-lighthouse:patch-1Copy head branch name to clipboard

Conversation

@bruno-s-freitas

Copy link
Copy Markdown

Description:
This change fixes a bug where the Lighthouse plugin always selects the mobile preset, even when sitespeed.io is run without --mobile, --android, or --ios.

Root cause:
The plugin checks options.mobile || options.android || options.ios to decide whether to use Lighthouse mobile settings. In sitespeed.io, options.android is always populated as an object, even when Android is disabled, so the condition is always truthy and the mobile preset is selected every time.

Fix:
I added an explicit desktop Lighthouse flags file for desktop runs and stopped passing the bare --lighthouse flag together with nested lighthouse flags, because that combination causes yargs to merge lighthouse options incorrectly.

Validation:
I reproduced the issue locally with the Docker image, confirmed that the old setup always landed in the mobile preset path, and verified that the new desktop flags file is now loaded correctly for desktop runs.

Description:
This change fixes a bug where the Lighthouse plugin always selects the mobile preset, even when sitespeed.io is run without --mobile, --android, or --ios.

Root cause:
The plugin checks options.mobile || options.android || options.ios to decide whether to use Lighthouse mobile settings. In sitespeed.io, options.android is always populated as an object, even when Android is disabled, so the condition is always truthy and the mobile preset is selected every time.

Fix:
I added an explicit desktop Lighthouse flags file for desktop runs and stopped passing the bare --lighthouse flag together with nested lighthouse flags, because that combination causes yargs to merge lighthouse options incorrectly.

Validation:
I reproduced the issue locally with the Docker image, confirmed that the old setup always landed in the mobile preset path, and verified that the new desktop flags file is now loaded correctly for desktop runs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.