Skip to content

fix: do not re-enter the driver from inside the command hook - #378

Merged
vishnuv688 merged 5 commits into
mainfrom
fix/374-no-nested-page-calls-in-hook
Sep 16, 2026
Merged

vishnuv688 merged 5 commits into
mainfrom
fix/374-no-nested-page-calls-in-hook

Conversation

@vishnuv688

@vishnuv688 vishnuv688 commented Sep 15, 2026

Copy link
Copy Markdown
Member

What & why

Type of change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Polish (an improvement to an existing feature)
  • Breaking change (existing behavior changes for users)
  • Documentation
  • Internal (build, CI, dependencies, tooling)

Packages touched

  • shared (types and contracts)
  • core (framework-agnostic capture/reporting)
  • elements (published element/snapshot API — @wdio/elements)
  • service (WebdriverIO adapter)
  • nightwatch-devtools (Nightwatch adapter)
  • selenium-devtools (Selenium adapter)
  • selenium-devtools-py (Selenium Python adapter)
  • backend (server)
  • app (UI)
  • script (page-injected runtime)
  • trace (Trace mode)

Notes for reviewers

Screenshots / recordings

@greptile-apps

greptile-apps Bot commented Sep 15, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the two previously identified transport defects are addressed and no actionable new issue was found.

Findings

  1. P1 Response failures escape handling

Summary

The PR prevents Appium command-hook deadlocks by routing capture probes directly to the configured WebDriver HTTP endpoint while preserving the normal WebdriverIO path for sessions that permit re-entry.

  • Adds a shared, best-effort WebDriver HTTP transport with timeout, authentication, HTTPS, path-prefix, IPv6, and response-failure handling.
  • Uses direct probes for Appium collector drains, script execution, snapshots, screenshots, URL/title reads, and native page source reads.
  • Reuses the shared transport in the Nightwatch adapter.
  • Adds transport-level and Appium regression tests.

Diagram

sequenceDiagram
  participant Hook as WDIO beforeCommand
  participant Probe as Direct probe adapter
  participant HTTP as Core WebDriver HTTP transport
  participant Driver as Appium/WebDriver
  Hook->>Probe: Request pre-command capture
  Probe->>HTTP: Execute script/read state
  HTTP->>Driver: Direct /session/:id request
  Driver-->>HTTP: W3C value or transport failure
  HTTP-->>Probe: Value or null
  Probe-->>Hook: Capture result or undefined
Loading

Reviews (2) · Last reviewed commit: "fix(core): bracket an IPv6 host and sett..."

Comment thread packages/core/src/webdriver-http.ts Outdated
Comment thread packages/core/src/webdriver-http.ts
@vishnuv688
vishnuv688 merged commit bab6417 into main Sep 16, 2026
9 checks passed
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.

WDIO service deadlocks a mobile-web Appium session: beforeCommand awaits page commands inside the command hook

1 participant