Skip to content

Conversation

@mohangowdak
Copy link
Contributor

@mohangowdak mohangowdak commented Sep 22, 2025

When using Appium Inspector, we observed an issue where the inspector stops working if the USB/Wifi connection is lost after a session has started. In order to continue inspecting and interacting with other pages, users previously had to quit the session, re-enter all capabilities, and start a new session. This process was both time-consuming and inconvenient.

This PR introduces a fix to handle session loss more seamlessly. Now, whenever a debugging disconnection occurs, the old session is automatically quit, and the page source is refreshed. This allows users to continue their workflow without needing to exit the inspector window or manually reconfigure the session.

With this improvement, users can enjoy a smoother and more efficient experience when working with Appium Inspector.

@github-actions github-actions bot added the enhancement New feature or request label Sep 22, 2025
@mohangowdak
Copy link
Contributor Author

mohangowdak commented Sep 23, 2025

Hi @eglitise @KazuCocoa @jlipps ,
I’ve created a pull request.
When you have some time, could you please review it and share your feedback?
Thanks a lot!

@KazuCocoa
Copy link
Member

Could you give us more context?

Is this when you run appium on your local, and attach to the local Appium server? Then, the host machine's WiFi reconnection caused this issue you addressed? USB is... do you mean for example the appium session disconnected when the connected Android device, for example, disconnected from the host machine?

@mohangowdak
Copy link
Contributor Author

mohangowdak commented Sep 23, 2025

@KazuCocoa Thanks for reaching out to me

Yes, exactly. this happens when Appium is running locally and the device is attached either via local Appium server + WiFi connection or via USB cable.
In the case of WiFi, if the host machine temporarily loses or reconnects its WiFi network, the active Appium session can get disconnected.
In the case of USB, if the physical connection is unstable (for example, a loose cable or the device briefly disconnecting from the host machine), the Appium session also drops.

Previously, when such disconnects happened, the only option in Appium Inspector was to quit the broken session and start a fresh one, which interrupted the workflow. Here is the video link demonstrating the current Appium Inspector Existing Production Build of Appium Inspector

With this change, instead of forcing a quit + restart, we now handle the session refresh internally. That way, users don’t need to manually restart the session, it will be recovered seamlessly. PR Build of Appium Inspector

As a result, the overall experience is smoother and uninterrupted, allowing users to continue inspecting and interacting with elements seamlessly without worrying about connectivity glitches.

@KazuCocoa
Copy link
Member

Thank you for the explanation.

I personally like not to hide too much like this, re-creating a new session behind the error, because this re-created session might have a different state before the error.

So, I'm wondering if it makes sense to add an option to enable this kind of behavior, or add a button to do this reconnection behavior explicitly

@github-actions github-actions bot added the i18n Translation changes label Sep 25, 2025
@mohangowdak
Copy link
Contributor Author

@KazuCocoa, Thanks for the suggestion.
I completely agree with your suggestion. Re-creating a new session behind the error may indeed introduce inconsistencies, as the session state could differ from before the error. Instead of enforcing this behaviour, I have committed changes in the latest push to give users the flexibility to enable or disable it as needed. This ensures transparency while also enhancing the overall user experience, empowering users to make the choice themselves and maintain control over their workflow. You can also refer to the attached screenshots for more details.

Screenshot 2025-09-25 at 6 46 22 PM Screenshot 2025-09-25 at 6 48 15 PM

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Sep 25, 2025
@mohangowdak mohangowdak requested a review from eglitise October 9, 2025 15:51
@mykola-mokhnach
Copy link
Contributor

@mohangowdak Would it be possible to see the updated UI (preferably animated) before the PR is merged?

@mohangowdak
Copy link
Contributor Author

mohangowdak commented Oct 10, 2025

Would it be possible to see the updated UI (preferably animated) before the PR is merged?

@mykola-mokhnach, Thanks for asking. Here’s the updated UI, including a screenshots for reference.

  • The user can choose whether to enable Auto Session Restart when the device disconnects using the toggle:
Screenshot 2025-10-10 at 7 34 20 AM
  • If the user enables the Auto Session Restart option, then while capturing or interacting with elements (e.g., navigating from one screen to another), if the device disconnects due to a loose connection, the session will automatically restart and show the following message:
Screenshot 2025-10-10 at 7 39 18 AM

@eglitise eglitise removed the documentation Improvements or additions to documentation label Oct 10, 2025
@eglitise eglitise merged commit 9b0f1f0 into appium:main Oct 10, 2025
7 checks passed
@KazuCocoa KazuCocoa added size:S contribution size: S size:M contribution size: M and removed size:S contribution size: S labels Nov 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request i18n Translation changes size:M contribution size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants