Skip to content

fix(ios): prefer USB entries for duplicate usbmux devices - #3191

Merged
thymikee merged 1 commit into
callstack:mainfrom
Arthur031221:fix/prefer-usb-usbmux-s39
Oct 4, 2026
Merged

thymikee merged 1 commit into
callstack:mainfrom
Arthur031221:fix/prefer-usb-usbmux-s39

Conversation

@Arthur031221

@Arthur031221 Arthur031221 commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

With Wi-Fi sync enabled, a cabled iPhone's Network entry could be selected before its USB entry. Prefer the matching USB entry, keeping the first match as a fallback.

Builds on the code @suyash-ls posted in #3149. Two files changed. Closes #3149.

Validation

At 249adafd, added socket tests for duplicate entries and fallback selection. pnpm check:affected --run passes. CI results are not verified. No physical iPhone run on this Linux host, so the reported Wi-Fi timeouts remain unverified locally.

Co-authored-by: Suyash Bansal 139199337+suyash-ls@users.noreply.github.com

Review in cubic

Co-authored-by: Suyash Bansal <139199337+suyash-ls@users.noreply.github.com>
Signed-off-by: Arthur031221 <levi74108520963@gmail.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

@thymikee

thymikee commented Oct 3, 2026

Copy link
Copy Markdown
Member

The change in 054390e looks correct: the usbmux ListDevices parser now prefers the USB entry when a device shows up twice, and the unit test covers it. The one reported check is green and no checks are failing. There are no conflicts.

I did not run the tests locally. I took the Connect DeviceID recording in serveUsbmuxDevices and postThroughFakeUsbmux from reading the diff and fixture. I also did not reproduce the USB versus Wi-Fi speed gap from the issue on a physical device. The change only picks a different DeviceID in a pure parse step, so the unit tests cover the logic.

One thing is still needed before this is ready: a run on a physical iPhone that is cabled with Wi-Fi sync on, showing that the USB entry is now selected and the reported timeouts are gone. @suyash-ls, could you try this branch on your setup?

@suyash-ls

Copy link
Copy Markdown
Contributor

Thanks for the fix, @Arthur031221, and for the review, @thymikee. I tested this branch on a physical iPhone.

Setup

Results

snapshot -i on the app's sign-in screen (22 nodes), 6 runs each:

Build Time per run
main (d396f3b) 51.4, 50.9, 51.5, 16.6, 51.0, 7.8 s
PR #3191 (054390e) 0.62, 0.57, 0.54, 0.57, 0.59, 0.61 s
  • All 12 runs returned the snapshot. None timed out.
  • Tap with --settle on the PR build: 2.4, 2.6, 2.5, 2.6 s.
  • On the PR build, each command appears once in the runner log (COMMAND_ACCEPTED, then COMMAND_COMPLETED ok=1). There were no repeated commands.

What I did not check

  • I did not look at the DeviceID in the Connect message. The USB route is inferred from the timing and the main comparison.
  • I did not test with Wi-Fi sync off, or with the phone on Wi-Fi only (no cable). The Network fallback is only covered by the unit tests.

On my Mac this fixes the problem from #3149.

@thymikee

thymikee commented Oct 4, 2026

Copy link
Copy Markdown
Member

Thanks, @suyash-ls. Your run on a cabled iPhone with Wi-Fi sync on is the validation I asked for at 054390e. With the Network entry listed first, snapshot -i dropped from 8-51 s on main to about 0.6 s on this branch, with no timeouts and no repeated runner commands. The Connect DeviceID was not checked directly, but the main comparison on the same phone and list order makes the USB route clear. The code verdict is unchanged and there are no conflicts, so this is ready for human review.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 4, 2026
@thymikee
thymikee merged commit 052cba8 into callstack:main Oct 4, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Physical iOS: usbmux picks the Wi-Fi sync (Network) entry before the USB entry, so the runner is slow or times out

3 participants