Skip to content

Backport: eager connect watchdog for InPlay/iPhone-16 wedges - #141

Draft
ps2 wants to merge 1 commit into
devfrom
backport/eager-connect-dev
Draft

Backport: eager connect watchdog for InPlay/iPhone-16 wedges#141
ps2 wants to merge 1 commit into
devfrom
backport/eager-connect-dev

Conversation

@ps2

@ps2 ps2 commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Backport of #133 to the dev line, squashed to a single commit.

What it brings

Mitigation for BLE connection wedges on InPlay-firmware DASH pods paired with an iPhone 16 (any variant) or 17e: a connect that stalls with no callback is torn down and retried rather than left to time out, plus a persistent notice in pod settings explaining the slower connections and a detail screen behind it.

It also carries the later fixes from that branch:

  • O5 fresh-advert connect — the fast-connect path was nested inside a DASH-only branch, so an Omnipod 5 could never take it. Foreground connects measured 5.9s against 0.4s for DASH.
  • Foreground-state seed — a pump manager constructed after the app has already become active never saw didBecomeActive, so isAppForeground stayed false and the link was idle-disconnected ~4s after each command while the user was on screen.
  • Test-beeps button no longer gates on hasConnection.

Conflicts

Two, both because dev predates the Pod Keep Alive rework (#125). Resolved by keeping dev's accessor and taking the eager-connect logic:

site resolution
shouldHoldConnection keeps podType.isDash && Storage.shared.podKeepAlive.value.keepsPodConnectedInBackground rather than podKeepAliveKeepsConnectedInBackground, with the eager-pod hold line added above it
pairing auto-enable keeps Storage.shared.podKeepAlive.value while adopting the consolidated UIDevice.hasPossibleInPlayBLEIssues

The now-redundant OmniPumpManager.iPhoneWithPossibleInPlayIssues is removed by the backport, as it was upstream; no stale references remain.

This does not build against LoopWorkspace/dev, and that is not new

Worth stating plainly before anyone merges expecting a working dev build.

OmnipodKit/dev already requires PumpHeartbeatRequest, a LoopKit type that the LoopKit pinned by LoopWorkspace/dev does not define:

BlePodComms.swift:64:      error: cannot find type 'PumpHeartbeatRequest' in scope
BluetoothManager.swift:509: error: cannot find type 'PumpHeartbeatRequest' in scope
OmniPumpManager.swift:317:  error: cannot find type 'PumpHeartbeatRequest' in scope

Those references arrived with a715d9a ("Connect-on-demand connectivity for DASH and O5, CGM aligned heartbeat, connectionless fault detection") and are present at ccd4438 before this backport — I verified 08c4efe, the commit LoopWorkspace/dev actually pins, has none of them, while the branch tip has three.

So the dev line has moved 43 commits past what the workspace pins, and picked up a LoopKit dependency along the way. Making LoopWorkspace/dev build needs its LoopKit bumped to a version defining PumpHeartbeatRequest, independently of this change.

This backport applies cleanly on top of that situation and keeps the eager-connect work from diverging further, but it does not resolve it.

Verification

Cherry-picked cleanly apart from the two conflicts above; the resolutions were reviewed line by line. Not built end to end, because the dev workspace cannot currently build OmnipodKit dev at all for the reason above — the three errors seen are exactly the pre-existing ones, with none originating in this change.

Backport of #133 from next-dev, squashed. Mitigates BLE connection
wedges on InPlay-firmware DASH pods paired with an iPhone 16 (any
variant) or 17e: a connect that stalls with no callback is torn down and
retried rather than left to time out, and the pod settings view gains a
persistent notice explaining the slower connections.

Also carries the later fixes from that branch: the O5 fresh-advert
connect, which cut foreground connects on Omnipod 5 from about six
seconds to under one; the foreground-state seed, so a pump manager built
after the app has already become active does not idle-disconnect between
commands; and the test-beeps button no longer gating on hasConnection.

Two conflicts against this line, both because dev predates the Pod Keep
Alive rework (#125). Resolved by keeping dev's accessor and taking the
eager-connect logic:

- shouldHoldConnection keeps podType.isDash &&
  Storage.shared.podKeepAlive.value.keepsPodConnectedInBackground rather
  than podKeepAliveKeepsConnectedInBackground
- the pairing auto-enable keeps Storage.shared.podKeepAlive.value while
  adopting the consolidated UIDevice.hasPossibleInPlayBLEIssues

Does not build against LoopWorkspace/dev as it stands, for reasons that
predate this change -- see the pull request.
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