align code with changes from unique-ids commit 5af449d from itsmojo#5
Merged
Conversation
Unique controller ids support, working eap seq # podIds * persistent id created at startup or deactvation as needed * eap seq # now incremented for each new session * podId #'s now cycle between next of 3 values on deactivate * temp fake podState no longer used to implement pairing
Collaborator
Author
|
This code compiled and built and passed the simulator test. A transfer branch, dev-unique-ids, was created in line with LoopKit OmniBLE dev branch commit 14ae79a. Of the 11 files affected, 6 (i.e., 1, 2, 3, 4, 6 and 7) could be modified by |
…heral from auto-connect when discarding pod
ps2
added a commit
that referenced
this pull request
Aug 15, 2023
marionbarker
added a commit
that referenced
this pull request
Apr 6, 2024
put Silence Pod and Pod Diagnostics behind build-time flag
vanzaam
pushed a commit
to vanzaam/OmniBLE
that referenced
this pull request
Apr 16, 2026
threecee
pushed a commit
to threecee/OmniBLE
that referenced
this pull request
May 2, 2026
…LoopKit#5) Adds 3 sub-tests (one per gate) to WatchAlgorithmEndToEndTests, each running the full algorithm iteration with one gate set to "fail" and asserting that: - pod insulinDelivered did NOT change - no temp basal was installed (basalDeliveryState != .tempBasal) Gates covered: - testGateSuppression_warmingUp_noDoseEnacted - testGateSuppression_automaticDosingDisabled_noDoseEnacted - testGateSuppression_dosingNotAllowed_noDoseEnacted These complement the gate-logic UNIT tests in Phase 2 (which used a RecordingPumpManager mock). The unit tests prove the gate logic is right in isolation; these integration tests prove the gates actually prevent the dose from reaching the real pod through the full production plumbing (real OmniBLEPumpManager + emulated pod, real WatchAlgorithmKit driver, real LoopAlgorithmRunner). Each test takes ~10-30s (pod pairing + algorithm iteration + assertion); the full WatchAlgorithmEndToEndTests suite is ~1-2 min total. Extracted a shared GateTestSetup helper + assertSuppressedEndToEnd helper to keep the 3 sub-tests focused on their differentiating gate parameter. threecee-claude
threecee
pushed a commit
to threecee/OmniBLE
that referenced
this pull request
May 2, 2026
…oopKit#5) Adds claimedOwner: HandoffOwner? field to PhoneWatchHeartbeat. Each side will populate it from local handoffState.currentOwner (Loop-side wiring lands in Phase 3). On reception, the watch detects split-brain when its local state says it's the owner AND the inbound heartbeat says counterpart claims ownership too. Phone-wins arbitration: watch silently demotes itself. Bumps PhoneWatchProtocol.currentVersion 2 -> 3. Backward-compatible: - Old (v2) sender + new (v3) receiver: decodes claimedOwner as nil -> no split-brain detection on that heartbeat (degrades silently). - New (v3) sender + old (v2) receiver: ignores unknown field via Swift JSONDecoder default behavior. Updates 3 tests in PhoneWatchMessageTests (testCurrentVersionIsTwo -> IsThree; testAcceptsLowerOrCurrentProtocolVersion now accepts v3; testRejectsHigherProtocolVersion now rejects v4 instead of v3). Adds 2 new Codable round-trip tests: - claimedOwner field survives encode -> decode - v2-shaped JSON decodes with claimedOwner = nil threecee-claude
threecee
pushed a commit
to threecee/OmniBLE
that referenced
this pull request
May 4, 2026
Deduplicates the iOS<->watch bootstrap chain that LoopAppManager and ExtensionDelegate hand-built (~54 LOC of duplicated wiring per /simplify quality LoopKit#5). Single static factory constructs all 6 stack components in dependency order, parameterized by HandoffRole + closure injection points for the role-conditional behavior: - pumpManager: OmniBLEPodOwner? (phone supplies, watch nil) - settingsSyncProvider: phone-only (settings sync is phone -> watch) - onSettingsSyncReceived / onSnapshotReceived: watch-only cache writes - makeWatchSidePumpManager: watch-only lazy pump-manager construction Factory is intentionally small: it constructs and wires components but does NOT call start(), publish .shared singletons, or install host- specific peripherals (HealthKit, G7, AlgorithmStateSnapshotEmitter, ExtendedRuntimeCoordinator). Those stay with the host bootstrap so the factory can be exercised in unit tests without polluting global state. Tests: assemble_phone_buildsStack, assemble_watch_buildsStack, assemble_isReentrant_returnsDistinctInstances. All green. threecee-claude
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unique controller ids support, working eap seq # podIds