Skip to content

refactor: Network extension to remove legacy command fallbacks - #1258

Merged
KazuCocoa merged 3 commits into
appium:masterfrom
Dor-bl:refactor/remove-network-fallback-7102057085996419728
Aug 2, 2026
Merged

refactor: Network extension to remove legacy command fallbacks#1258
KazuCocoa merged 3 commits into
appium:masterfrom
Dor-bl:refactor/remove-network-fallback-7102057085996419728

Conversation

@Dor-bl

@Dor-bl Dor-bl commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

This pull request refactors the Android network extension in the Appium Python client to remove legacy MJSONWP (Mobile JSON Wire Protocol) code paths and dependencies, standardizing all network-related commands to use W3C WebDriver extension scripts. The code is simplified by removing fallback logic, unused imports, and direct command registrations. Corresponding unit tests are updated to reflect these changes.

Refactoring to W3C-only network commands:

  • Removed all fallback logic and dependencies related to MJSONWP commands in the Network class; now only W3C extension scripts are used for network operations such as getting/setting network connection, toggling WiFi, and setting network speed (appium/webdriver/extensions/android/network.py). [1] [2] [3] [4] [5] [6]

Code cleanup:

  • Removed unused imports and the CanRememberExtensionPresence mixin from the Network class, as well as command registration for legacy endpoints (appium/webdriver/extensions/android/network.py). [1] [2] [3]

Unit test updates:

  • Updated tests to remove references to MJSONWP endpoints and ensure assertions match the new W3C-only behavior, including checking the correct script and arguments are sent (test/unit/webdriver/network_test.py). [1] [2] [3]

Dor-bl added 3 commits July 20, 2026 21:04
Remove `try/except UnknownMethodException` fallback logic from `network_connection`, `set_network_connection`, `toggle_wifi`, and `set_network_speed` methods in the `Network` extension, relying solely on their corresponding `mobile:` scripts.

Also removes the inheritance from `CanRememberExtensionPresence`, unneeded imports, and clears `_add_commands` as these endpoints are now completely deprecated. Updates unit tests to remove mocks for legacy endpoints.
Remove `try/except UnknownMethodException` fallback logic from `network_connection`, `set_network_connection`, `toggle_wifi`, and `set_network_speed` methods in the `Network` extension, relying solely on their corresponding `mobile:` scripts.

Also removes the inheritance from `CanRememberExtensionPresence`, unneeded imports, and clears `_add_commands` as these endpoints are now completely deprecated. Updates unit tests to remove mocks for legacy endpoints.

Fixed ruff format issue.
execute_script's raw result doesn't match the method's documented int
return type; return self.network_connection after setting instead.
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 21, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

@KazuCocoa

Copy link
Copy Markdown
Member

@Dor-bl Can you handle the CLA for claude like override their commits with your email address

@Dor-bl

Dor-bl commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@Dor-bl Can you handle the CLA for claude like override their commits with your email address

Sure. I'll look into it.

@Dor-bl
Dor-bl force-pushed the refactor/remove-network-fallback-7102057085996419728 branch from 05c70d2 to c2b087a Compare August 2, 2026 05:32
@KazuCocoa
KazuCocoa merged commit 9097a5a into appium:master Aug 2, 2026
11 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.

2 participants