Skip to content

fix(calls): bind the Online HFP modem (skip stale offline modems)#133

Open
quad341 wants to merge 3 commits into
mainfrom
cohelper/tincand-prefer-online-modem
Open

fix(calls): bind the Online HFP modem (skip stale offline modems)#133
quad341 wants to merge 3 commits into
mainfrom
cohelper/tincand-prefer-online-modem

Conversation

@quad341

@quad341 quad341 commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Follow-up to #132. CallController._discover_modem bound the first MAC-matching iPhone HFP modem without checking Online; with the iPhone HFP-connected on two adapters it could bind an offline modem (no VoiceCallManager), so every Dial/Answer failed with UnknownMethod. Now prefers an Online modem (sort Online-first). Proven live during a real call (Dial -> active). Regression test tracked as a follow-up bead.

_discover_modem bound the first MAC-matching iPhone HFP modem without checking
Online. With the iPhone HFP-connected on two adapters it could bind an offline
modem (no VoiceCallManager) — every Dial/Answer then failed with UnknownMethod.
Prefer an Online modem (sort Online-first).

Proven live: with both adapters Online, tincand binds the live (dongle) modem
and Dial places the call. Regression test tracked as a follow-up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@quad341

quad341 commented Jun 18, 2026

Copy link
Copy Markdown
Owner Author

Thanks @quad341 — this is a clean fix for a genuinely nasty failure mode. Binding the first MAC-matching modem without checking Online looks fine right up until the iPhone is HFP-connected on two adapters and you silently grab the dead one with no VoiceCallManager, so every Dial/Answer dies with UnknownMethod. Collecting the candidates, sorting Online-first (stable, so single-modem behavior is unchanged), and still falling through to retry when there are none is exactly the right shape — and the comment spelling out the UnknownMethod chain will save whoever touches this next. Nice that you proved it live with a real Dial→active.

Merging as-is — CI's green, branch is mergeable, and there's no integration work on my side.

One thing for the follow-up bead you already mentioned: _on_modem_added still binds the first HFP iPhone modem without the Online check, so the same offline-bind can sneak back in through the dynamic-add path. Worth folding into the same two-modem (one offline, one online) regression fixture when you get to it. Appreciate the tight, well-explained change.


Reviewers: Qwen (local) — ok · Claude (claude-opus-4-8[1m]) — ok · Codex (gpt-5.5) — ok
Synthesis: claude-opus-4-8[1m]

Verified locally + tests pass. Ready to merge — clicking the button is the only step left.

quad341 and others added 2 commits June 19, 2026 06:33
…-a6yeb)

Add §6 TestDiscoverModemOnlinePreference covering the regression fixed in the
previous commit: when GetModems returns multiple iPhone HFP modems, the Online
one must be bound (an offline modem has no VoiceCallManager → Dial fails with
UnknownMethod).

Four cases: online wins listed-second, online wins listed-first, offline-only
falls back to first candidate, non-matching MAC is ignored.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@quad341

quad341 commented Jun 19, 2026

Copy link
Copy Markdown
Owner Author

Re-reviewed 9c64e4621..ea63ad268 (2 new commits since the last review): no new concerns — the prior review stands.

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.

1 participant