Skip to content

chore: deprecate the logs broadcasting listeners - #2504

Merged
mykola-mokhnach merged 4 commits into
appium:masterfrom
mykola-mokhnach:chore/deprecate-logs-listeners
Nov 21, 2026
Merged

mykola-mokhnach merged 4 commits into
appium:masterfrom
mykola-mokhnach:chore/deprecate-logs-listeners

Conversation

@mykola-mokhnach

Copy link
Copy Markdown
Contributor

Summary

The Appium drivers deprecated the mobile: startLogsBroadcast and mobile: stopLogsBroadcast extensions in favour of the BiDi log.entryAdded event (driver-lib / UIA2 / Espresso / XCUITest). This marks the corresponding client API as deprecated for removal:

  • ListensToLogcatMessages and AndroidDriver#getLogcatClient()
  • ListensToSyslogMessages and IOSDriver#getSyslogClient()
  • io.appium.java_client.ws.StringWebSocketClient and CanHandleMessages, CanHandleErrors, CanHandleConnects, CanHandleDisconnects (only used by the two interfaces above)

The deprecations use @Deprecated(since = "11.1.0", forRemoval = true) and the Javadoc points to the BiDi replacement. docs/selenium-bridge.md gets a "Migrating from the logs broadcast" section with an example based on the Selenium bridge and LogInspector. The removal warnings inside the deprecated types and in AndroidDriver/IOSDriver are suppressed, so the build stays free of warnings. Behaviour is unchanged.

compileJava, javadoc, checkstyleMain, checkstyleTest and compileTestJava pass. The e2e tests were not run.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Active issues remain: migration examples contain an incorrect event type and non-compiling API usage, and the concrete listener methods are not deprecated to warn consumers before removal.

4 open issues
What changed in this PR

This PR deprecates the legacy Appium log-broadcasting WebSocket APIs in favor of Selenium BiDi log.entryAdded events, documents the migration path, and updates CI to skip Flutter E2E jobs when the driver is incompatible with the selected Appium server.

Changes:

  • Adds removal deprecations and BiDi migration guidance to log-listener, WebSocket handler, and Android/iOS driver APIs.
  • Adds Selenium bridge documentation with a BiDi LogInspector migration example.
  • Adds Flutter driver compatibility resolution and conditional E2E execution in CI.
File Description
src/​main/​java/​io/​appium/​java_client/​ws/​StringWebSocketClient.java Deprecates the legacy log-broadcasting WebSocket client.
src/​main/​java/​io/​appium/​java_client/​ws/​CanHandleMessages.java Deprecates WebSocket message-handler support.
src/​main/​java/​io/​appium/​java_client/​ws/​CanHandleErrors.java Deprecates WebSocket error-handler support.
src/​main/​java/​io/​appium/​java_client/​ws/​CanHandleDisconnects.java Deprecates WebSocket disconnection-handler support.
src/​main/​java/​io/​appium/​java_client/​ws/​CanHandleConnects.java Deprecates WebSocket connection-handler support.
src/​main/​java/​io/​appium/​java_client/​ios/​ListensToSyslogMessages.java Deprecates the iOS syslog broadcasting APIs.
src/​main/​java/​io/​appium/​java_client/​ios/​IOSDriver.java Deprecates access to the iOS syslog client.
src/​main/​java/​io/​appium/​java_client/​android/​ListensToLogcatMessages.java Deprecates the Android logcat broadcasting APIs.
src/​main/​java/​io/​appium/​java_client/​android/​AndroidDriver.java Deprecates access to the Android logcat client.
docs/​selenium-bridge.md Documents migration from log broadcasting to BiDi logging through the Selenium bridge.
.github/​workflows/​ci.yml Applies Flutter driver compatibility checks and conditionally skips unsupported Flutter E2E jobs.
.github/​scripts/​resolve-appium-versions.mjs Adds optional handling and step outputs for unsupported driver and server combinations.

Review effort: Lite

Comment thread docs/selenium-bridge.md Resolved
Comment thread docs/selenium-bridge.md Resolved
Deprecate the interface methods themselves so callers get removal warnings,
and fix the BiDi migration example (generic log entry, syslog type).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The workflow changes affect live Appium/driver resolution and dynamically skip Flutter E2E jobs based on npm metadata, while those E2E paths were not run and therefore still require runtime and integration validation.

No open issues 🎉

4 resolved since last review

Review effort: Lite

Comment thread .github/workflows/ci.yml
- name: Resolve Flutter Integration driver version
id: flutter-driver
if: startsWith(matrix.e2e-tests, 'flutter')
run: node .github/scripts/resolve-appium-versions.mjs --stable --skip-if-unsupported appium appium-flutter-integration-driver

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both Flutter jobs passed on this PR with e2eFlutterTest skipped. When the Flutter driver lags behind a new Appium major, every subsequent PR can pass without exercising either Flutter platform. Could the Flutter jobs fall back to the newest stable Appium release supported by both the Flutter and platform drivers, or pin a compatible major until the Flutter driver catches up?

@mykola-mokhnach mykola-mokhnach Nov 21, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Flutter Integration driver is third-party, so we cannot influence its release lifecycle or when it adds support for a new Appium major. Falling back to an older Appium or pinning a major would run the Flutter jobs against a server that the rest of the CI has already moved off, so they would not reflect what users get with the current Appium either. Skipping is the honest outcome: it is visible in the job log, and the Flutter jobs start running again automatically once the driver publishes a compatible release. If the gap ever turns out to be long-lived, we can revisit and add a dedicated pin then.

Comment thread docs/selenium-bridge.md Outdated
var driver = new AndroidDriver(serverUrl, options.enableBiDi());
var selenium = SeleniumBridge.asRemoteWebDriver(driver);
try (var logInspector = new LogInspector(selenium)) {
logInspector.onGenericLog(entry -> System.out.println(entry.getText()));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the migration example check "syslog".equals(entry.getType()) before forwarding entry.getText()? onGenericLog also receives other Appium log types, including crashlog and, when enabled, safariNetwork on iOS. Filtering here would preserve the device-log stream that existing logcat and syslog consumers expect.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, fixed in d23f107: the example now forwards only syslog entries, and the text below it notes that other types such as crashlog arrive on the same listener.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@mykola-mokhnach
mykola-mokhnach merged commit 9dba8df into appium:master Nov 21, 2026
12 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.

3 participants