Fix local_mode set to undefined in logs#1124
Open
vivianludrick wants to merge 1 commit into
Open
Conversation
xxshubhamxx
approved these changes
Jun 10, 2026
harshit-browserstack
approved these changes
Jun 10, 2026
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.
TL;DR
--cli-debugprintedlocal_mode set to undefinedwhenever a user explicitly setconnection_settings.local_modeinbrowserstack.json. The log was readinglocal_mode_inferred, which only gets populated on the inferred-default path. Switched the log to readlocal_mode(the resolved final value), which is guaranteed set before the log fires.Issue
In
bin/helpers/utils.js→exports.setLocalMode, the debug log referenced the wrong property:local_mode_inferredis only assigned whenlocalModeInferred && localModeUndefined— i.e. only when the user did not supplylocal_mode. When the user explicitly setsconnection_settings.local_mode = "always-on"(or"on-demand"),localModeUndefined === false, so the assignment is skipped and the property staysundefined. The log fires unconditionally →local_mode set to undefined.Repro
browserstack.json:Command:
npx browserstack-cypress run --cli-debugOutput (broken):
Fix
One-line change — log
bsConfig.connection_settings.local_mode(set just above in the same function) instead oflocal_mode_inferred:Verification matrix
Reproduced via a dummy cypress project against 3
connection_settingsshapes.connection_settings{local:true, local_mode:"always-on"}local_mode set to undefined❌local_mode set to always-on✅{local:true, local_mode:"on-demand"}local_mode set to undefined❌local_mode set to on-demand✅{local:true}local_mode set to on-demand✅local_mode set to on-demand✅Files changed
bin/helpers/utils.jsbsConfig.connection_settings.local_mode_inferredwithbsConfig.connection_settings.local_modein the debug log insideexports.setLocalMode.