Skip to content

Add failNextConnects: leave service discovery unanswered, then hang up - #29

Merged
ps2 merged 1 commit into
ignore-next-messagesfrom
fail-next-connects
Nov 4, 2026
Merged

ps2 merged 1 commit into
ignore-next-messagesfrom
fail-next-connects

Conversation

@ps2

@ps2 ps2 commented Nov 4, 2026

Copy link
Copy Markdown

Stacked on #28 (ignoreNextMessages). Merge that first, or review only the second commit.

POST /command {"command": "failNextConnects", "value": N, "hangUpAfter": 7} makes the next N connects fail the way some pods do in loopandlearn/OmnipodKit#199:

  1. The link comes up.
  2. Service and characteristic discovery go unanswered.
  3. The pod hangs up after hangUpAfter seconds (default 7) with CBErrorDomain code 7, "The specified device has disconnected from us."

Only -transport impossible supports it. For the app to see code 7 rather than a generic ImpossiBLE error, its ImpossiBLE needs mickeyl/ImpossiBLE#9.

Testing:

  • The new Go test checks four things:
    • discovery goes unanswered on a failing connect
    • the hang-up carries domain and code
    • the pod is disconnected afterwards
    • the next connect is served normally
  • go test ./pkg/bluetooth passes.
  • Ran it against Loop next-dev in the iOS Simulator with an Omnipod DASH. Two failing connects reproduced the #199 pattern:

POST /command {"command": "failNextConnects", "value": N, "hangUpAfter": 7}
makes the next N connects fail the way some pods do in
loopandlearn/OmnipodKit#199: the link comes up, service and
characteristic discovery go unanswered, and the pod hangs up after
hangUpAfter seconds with CBErrorDomain code 7. Only the ImpossiBLE
transport supports it, and the app's ImpossiBLE has to pass the error
domain and code through on didDisconnect.
@ps2
ps2 merged commit 1e5ccc0 into ignore-next-messages Nov 4, 2026
1 check passed
ps2 added a commit that referenced this pull request Nov 4, 2026
#31)

Reapplies #29, which was merged into ignore-next-messages after that branch had already been squash-merged into main.
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