Skip to content

chore: bump @metamask/device-mcp to ^0.7.0 - #72

Merged
cryptotavares merged 1 commit into
mainfrom
cryptotavares/bump-device-mcp-0.7.0
Oct 29, 2026
Merged

cryptotavares merged 1 commit into
mainfrom
cryptotavares/bump-device-mcp-0.7.0

Conversation

@cryptotavares

Copy link
Copy Markdown
Collaborator

Summary: Upgrade @metamask/device-mcp to ^0.7.0. 0.7.0 declares DeviceBackend.dispose(), so the mobile driver calls it without a type cast. iOS sessions get private IDB companion teardown and recovery.

Problem

Core pins @metamask/device-mcp ^0.6.0. On 0.x a caret range does not pick up 0.7.0.

  • The DeviceBackend type in 0.6.0 has no dispose(). feat: dispose session-owned platform drivers on teardown #70 therefore calls the hook through a structural cast in MobilePlatformDriver.dispose().
  • The README says core "does not update the core dependency range" and that older device-mcp versions stay compatible. That text was correct before 0.7.0 was released.

Solution

Adopt the device-mcp 0.7.0 release. Remove the cast and the temporary README text.

0.7.0 contains:

  • device-mcp#43: optional DeviceBackend.dispose() and reconnect(), one private IDB companion per iOS backend, and recovery when the companion or the simulator HID connection is lost.
  • device-mcp#44: correct recovery error reporting, and no resend of commands that can change the device.
  • device-mcp#42: Android clipboard helper.
flowchart TD
    A[mm cleanup / launch --force / stop] --> B[DriverLifecycle]
    B --> C[MobilePlatformDriver.dispose]
    C --> D{backend.dispose?}
    D -->|IdbBackend 0.7.0| E[Stop the private companion and recording]
    D -->|AdbBackend: no hook| F[Nothing to release]

    classDef new fill:#fff3cd,stroke:#d39e00
    class C,E new
Loading

Yellow boxes change: the driver calls the typed hook, and the 0.7.0 iOS backend releases its companion.

What changes

Boundary Before After
package.json dependency range @metamask/device-mcp ^0.6.0 ^0.7.0
yarn.lock resolution npm 0.6.0 npm 0.7.0 (dependencies unchanged)
MobilePlatformDriver.dispose() Casts the backend to DeviceBackend & { dispose?() } Calls this.#backend.dispose?.() on the typed DeviceBackend
README.md teardown paragraph Older device-mcp versions are compatible; the range is not updated Core requires 0.7.0 or later; iOS releases its companion; Android has no hook
Disposal test name "supports device-mcp versions without disposal" "completes for backends without a disposal hook"

Decisions for reviewers

Decision Reason
Keep the optional call dispose?.() dispose() is still optional in the 0.7.0 DeviceBackend type. IdbBackend implements it; AdbBackend and AppiumBackend do not.
Keep the test for a backend without the hook It now covers the ADB backend, not an older device-mcp version.
Async IIFE instead of Promise.resolve().then(...) Same behaviour, simpler, and the same style as device-mcp.
chore:, not breaking Core's own API does not change. Every symbol core imports from device-mcp still exists. The selectDevice() break in 0.7.0 is on LazyDeviceBackend, which core does not use.
No changelog entry Matches the previous bump (#69).

Review guide

# File What to check
1 package.json, yarn.lock The range is ^0.7.0. Only the device-mcp entry and the workspace range change.
2 src/platform/mobile-platform-driver.ts The cast is gone. Shared concurrent disposal and retry after failure are unchanged.
3 README.md The teardown paragraph under "Session-scoped device teardown".
4 src/platform/mobile-platform-driver.dispose.test.ts Only the test name changes.
Testing

Device-mcp 0.7.0 is installed from npm, without yalc.

  • yarn build passes.
  • yarn lint passes, including ESLint, formatting, constraints, dependency and dedupe checks, and changelog validation.
  • yarn test passes: 53 files and 1,835 tests. Typechecking and coverage thresholds pass. Thresholds are unchanged.
  • tsc --noEmit -p tsconfig.test.json reports 8 errors on main and 8 on this branch. All 8 already exist on main.
  • In the installed package, dist/backends/types.d.mts declares dispose?(): Promise<void> and reconnect?(): Promise<void> on DeviceBackend. IdbBackend declares dispose(); AdbBackend and AppiumBackend do not.

No device run for this PR. The live teardown and recovery checks are in device-mcp#43 and #70, and they used the same code.

@cryptotavares
cryptotavares requested a review from a team as a code owner October 29, 2026 17:55
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​metamask/​device-mcp@​0.6.0 ⏵ 0.7.093 +19100100 +197 +180

View full report

@cryptotavares
cryptotavares merged commit e4ce5ed into main Oct 29, 2026
27 checks passed
@cryptotavares
cryptotavares deleted the cryptotavares/bump-device-mcp-0.7.0 branch October 29, 2026 19:28
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