Skip to content

Fix fresh-install PyTCP compatibility - #5

Merged
Lemelson merged 2 commits into
mainfrom
codex/fix-pytcp-compatibility
Nov 2, 2026
Merged

Lemelson merged 2 commits into
mainfrom
codex/fix-pytcp-compatibility

Conversation

@Lemelson

@Lemelson Lemelson commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fresh GeoShift 1.5.2 installations can resolve pymobiledevice3 9.31.0 with pmd-pytcp 0.3.7. That backend calls PyTCP synchronously, while pmd-pytcp 0.1.0 and newer expose async methods, preventing the developer tunnel from opening and triggering a QueueFull callback flood.

Constrain pmd-pytcp to >=0.0.4,<0.1.0 in every documented installation/test command and Python CI. Add real installed-version and synchronous TCP/UDP API regression checks, a forced reinstall command for affected uv installations, and troubleshooting notes separating the callback flood from reconnect retries and misleading restore-status text.

Verification

  • swift test: 21 tests passed.
  • Python worker tests: 21 tests passed in each of three separate Python 3.13 environments: constrained uv run, fresh uv tool install, and fresh pip venv. All resolved pymobiledevice3 9.31.0 + pmd-pytcp 0.0.6.
  • Regression control: the original unconstrained uv run resolved pmd-pytcp 0.3.7; the two new tests failed with eight version/API assertions before the install commands were corrected.
  • pip check: no broken requirements. The pairing helper imports successfully with the corrected backend.
  • git diff --check and packaging-script syntax checks passed.
  • Local release package built, ad-hoc signature verified, and the app's main screen and Settings opened on macOS. GUI launch used the Mac's existing compatible backend (pmd-pytcp 0.0.4).
  • English and Russian UI resources remain synchronized.
  • No generated app/build files, logs, device IDs, local paths, or pairing data included in the patch.

Physical-iPhone acceptance (2026-11-03, iOS 27.2 over trusted Wi-Fi): with the pinned backend (pmd-pytcp 0.0.6), GeoShift's worker code opened the developer tunnel and the DVT LocationSimulation channel, and the RSD UDID matched the target. An actual location set/clear (Start, Maps check, Restore GPS) was not exercised; the owner chose to merge without it. No release or version bump is part of this PR.

Safety impact

The constraint restores the synchronous dependency contract required by the existing tunnel implementation. Runtime safety logic for Start, Restore GPS, target identity, reconnect, heartbeat, termination, and pending clear is unchanged. Indefinite pending-clear retries remain necessary; general error deduplication and clearer device-discovery versus tunnel-failure UI are separate follow-ups.

Follow-up: detect an incompatible backend (8e80e3e)

  • Re-checked PyPI: pymobiledevice3 is at 11.49.4 (async pmd-pytcp>=0.3.8; the async switch happened in 10.0.0). It is not a drop-in upgrade. iter_remote_paired_identifiers moved out of remote.tunnel_service, and _create_no_root_tunnel_provider now takes three arguments, so the worker would fail. The pin stays, and the upgrade is a separate, device-tested change. pmd-pytcp 0.0.4→0.0.6 contains only teardown robustness fixes and keeps the same synchronous API.
  • keeper.py checks for pymobiledevice3 9.x combined with an async pmd_pytcp.stack.start before opening a tunnel. If it finds that combination, it raises IncompatibleBackendError, logs the repair command at most once a minute instead of a QueueFull flood, and writes problem: "incompatibleBackend" to status.json. Pending Restore GPS keeps retrying.
  • The app decodes the optional problem field (old status files still decode) and shows a dedicated English/Russian status message.
  • No other pin sites: the app has no dependency installer, and Scripts/ do not install Python packages.

Verification for the follow-up:

  • swift test: 23 tests passed; ./Scripts/package_app.sh release built.
  • Python 3.13.7: the unpinned uv tool install resolved pmd-pytcp 0.3.8 and failed 8 dependency assertions. The pinned uv tool install, uv tool install --force repair, uv run, and pip venv (+ pip check) each resolved 0.0.6 and passed 25 tests.
  • On the physical iPhone, the unpinned backend was rejected with the repair message before any tunnel was opened.

Fixes #4.

🤖 Generated with Claude Code

pymobiledevice3 9.x calls PyTCP synchronously; pmd-pytcp 0.1.0+ is async,
so an unpinned backend never opens a tunnel and floods QueueFull. The
worker now checks this up front, logs the repair command once a minute,
and reports problem=incompatibleBackend in status.json, which the app
shows as a dedicated status message. Restore GPS keeps retrying.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Lemelson
Lemelson marked this pull request as ready for review November 2, 2026 23:35
@Lemelson
Lemelson merged commit c74b632 into main Nov 2, 2026
2 checks passed
@Lemelson
Lemelson deleted the codex/fix-pytcp-compatibility branch November 2, 2026 23:36
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.

Fresh install cannot open the developer tunnel: unpinned pmd-pytcp >=0.1.0 breaks userspace_tunnel (QueueFull flood)

1 participant