fix(native-mobile-core): honour capability-level launcher options#440
Merged
Conversation
Contributor
goosewobbler
added a commit
that referenced
this pull request
Jun 19, 2026
Run-level launcher decisions read this.options (the service-registration options) only, so options set on the capability (wdio:<framework>ServiceOptions — the idiomatic WDIO pattern) were silently ignored: manageMetro never started Metro, and doctor/autoInstallDriver no-opped. Add MobileBaseLauncher.resolveLauncherOptions(capabilities) — global options merged with the per-capability options (capability wins) — read for autoInstallDriver + doctor (base) and manageMetro/metroProjectRoot/prebundle/ metroPort (RN onPrepare + onWorkerStart). Flutter inherits the base fix. Also thread the resolved metroHost/metroPort into the RN Metro doctor check: doctorChecks runs inside super.onPrepare, so onPrepare stashes the merged options on the instance (#resolvedOptions) for it to read — otherwise a capability-only metroPort would make the doctor probe the default 8081 (Greptile #440). Tests: native-mobile-core +2 (autoInstallDriver + doctor from the capability), react-native-service +2 (manageMetro from the capability; doctor probes the capability-level metroPort). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
797f038 to
927c3f0
Compare
Run-level launcher decisions read this.options (the service-registration options) only, so options set on the capability (wdio:<framework>ServiceOptions — the idiomatic WDIO pattern) were silently ignored: manageMetro never started Metro, and doctor/autoInstallDriver no-opped. Add MobileBaseLauncher.resolveLauncherOptions(capabilities) — global options merged with the per-capability options (capability wins) — read for autoInstallDriver + doctor (base) and manageMetro/metroProjectRoot/prebundle/ metroPort (RN onPrepare + onWorkerStart). Flutter inherits the base fix. Also thread the resolved metroHost/metroPort into the RN Metro doctor check: doctorChecks runs inside super.onPrepare, so onPrepare stashes the merged options on the instance (#resolvedOptions) for it to read — otherwise a capability-only metroPort would make the doctor probe the default 8081 (Greptile #440). Tests: native-mobile-core +2 (autoInstallDriver + doctor from the capability), react-native-service +2 (manageMetro from the capability; doctor probes the capability-level metroPort). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ehaviour With resolveLauncherOptions the launcher reads run-level options from the service registration AND the capability, so the prior 'NOT from the capability' note (and the now-historical footgun post-mortem) no longer hold. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
927c3f0 to
ccf0d4c
Compare
Contributor
|
Standing release PR: #400 · 12 packages queued · open 63h 58m · ✅ ready to merge Release Preview — 12 packages
These changes will be added to the release PR (#400) when merged: ChangelogProject-wide changesChanged
Fixed
@wdio/dioxus-service N/A → 1.0.1Changed
@wdio/electron-cdp-bridge wdio-electron-cdp-bridge@v10.0.0 → 10.0.1Changed
@wdio/electron-service wdio-electron-service@v10.0.0 → 10.0.1Changed
@wdio/flutter-service v1.0.0-next.0 → 1.0.1Changed
@wdio/native-cdp-bridge v0.1.0-next.0 → 0.1.1Changed
@wdio/native-mobile-core v1.0.0 → 1.0.1Fixed
@wdio/native-spy wdio-native-spy@v1.1.0 → 1.1.1Changed
@wdio/native-types wdio-native-types@v2.3.1 → 2.3.2Changed
@wdio/native-utils wdio-native-utils@v2.4.0 → 2.4.1Changed
@wdio/react-native-service v1.0.0-next.0 → 1.0.1Fixed
@wdio/tauri-service wdio-tauri-service@v1.1.0 → 1.1.1Changed
dioxus-package-test-app v0.1.0 → 0.1.1Changed
After merge — predicted release
Updated automatically by ReleaseKit |
This was referenced Jun 19, 2026
Merged
Merged
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.
Stacked on #426 (feat/406-rn-metro-lifecycle) — review/merge that first; this PR's diff is the launcher-options delta.
The footgun
The mobile launchers read run-level options (
autoInstallDriver,doctor, and RN'smanageMetro/metroProjectRoot/prebundle/metroPort) fromthis.options— the service-registration options (['react-native', {…}]). If a user instead configures the service on the capability (wdio:reactNativeServiceOptions— the idiomatic WDIO pattern, and what the e2e dogfooding conf did), those options are silently ignored.This is exactly what broke #426's RN Android E2E:
manageMetrowas set only on the capability, so managed Metro never started → the app couldn't load its bundle → "Hermes inspector is not connected" on everyexecute/mockspec. Worse,doctor: { strict: true }— the check meant to catch "Metro not reachable" — was disabled by the same gap, so nothing flagged it. (The conf itself is fixed on #426 by passing options at the service level; this PR fixes the underlying footgun so capability-only config also works.)Fix
MobileBaseLauncher.resolveLauncherOptions(capabilities)returns the global options merged with the per-capabilitywdio:<framework>ServiceOptions(capability wins, matching the precedencemergeServiceOptionsalready uses formutateCapability). Run-level decisions now read it:onPrepare):autoInstallDriver,doctor→ so Flutter inherits the fix automatically (its doctor was also silently off when configured on the capability).onPrepare):manageMetro/metroProjectRoot/prebundle/platform; (onWorkerStart):metroPort/platformfor the pre-launchadb reverse.The per-capability
mutateCapabilitymerge is unchanged (it correctly uses each cap's own options).Tests
native-mobile-core+2:autoInstallDriveranddoctor: { strict: true }set on the capability drive the launcher.react-native-service+1:manageMetroon the capability starts managed Metro.🤖 Generated with Claude Code