fix: android flag as object - #142
#142Open
bruno-s-freitas wants to merge 1 commit into
Open
fix: android flag as object#142bruno-s-freitas wants to merge 1 commit into
bruno-s-freitas wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.