Repository navigation
chore: deprecate the logs broadcasting listeners - #2504
mykola-mokhnach merged 4 commits into
Conversation
There was a problem hiding this comment.
🟡 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
LogInspectormigration 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
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>
There was a problem hiding this comment.
🔵 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
| - 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
| 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())); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>


Summary
The Appium drivers deprecated the
mobile: startLogsBroadcastandmobile: stopLogsBroadcastextensions in favour of the BiDilog.entryAddedevent (driver-lib / UIA2 / Espresso / XCUITest). This marks the corresponding client API as deprecated for removal:ListensToLogcatMessagesandAndroidDriver#getLogcatClient()ListensToSyslogMessagesandIOSDriver#getSyslogClient()io.appium.java_client.ws.StringWebSocketClientandCanHandleMessages,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.mdgets a "Migrating from the logs broadcast" section with an example based on the Selenium bridge andLogInspector. The removal warnings inside the deprecated types and inAndroidDriver/IOSDriverare suppressed, so the build stays free of warnings. Behaviour is unchanged.compileJava,javadoc,checkstyleMain,checkstyleTestandcompileTestJavapass. The e2e tests were not run.