Skip to content

fix(app-management): resolve app names against rehydrated sessions - #488

Merged
KazuCocoa merged 1 commit into
appium:mainfrom
Mochxd:fix/app-id-rehydrate
Aug 15, 2026
Merged

fix(app-management): resolve app names against rehydrated sessions#488
KazuCocoa merged 1 commit into
appium:mainfrom
Mochxd:fix/app-id-rehydrate

Conversation

@Mochxd

@Mochxd Mochxd commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Problem

getInstalledApps looks the driver up with the raw store getter:

const driver = getDriver(sessionId);
if (!driver) {
  throw new Error(noActiveDriverSessionMessage(sessionId));
}

That skips resolveDriver, so it never re-attaches a persisted remote session. After an MCP process recycle, appium_app_lifecycle resolved by name fails with "No active driver session" while the same action by id succeeds on the same session, because the lifecycle handlers (activate, terminate, uninstall, …) call resolveDriver themselves but only after resolveId has already run.

permissions.ts does not hit this, since it calls resolveDriver before resolveAppId.

Fix

Resolve the driver through resolveDriver so name lookups rehydrate the session like every other tool. The thrown message is unchanged when the session genuinely cannot be resolved.

Test

Added src/tests/tools/app-management/resolve-app-id.test.ts:

  • with an empty in-memory driver cache, the name is resolved against the rehydrated driver
  • an unresolvable session still reports "No active driver session" and never queries the device

@KazuCocoa
KazuCocoa merged commit f268e87 into appium:main Aug 15, 2026
5 checks passed
github-actions Bot pushed a commit that referenced this pull request Aug 15, 2026
## [1.92.3](v1.92.2...v1.92.3) (2026-08-15)

### Bug Fixes

* **app-management:** resolve app names against rehydrated sessions ([#488](#488)) ([f268e87](f268e87))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.92.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants