Skip to content

Fix OmniTests: pass decisionId to UnfinalizedDose#77

Merged
marionbarker merged 2 commits into
loopandlearn:loop-next-devfrom
loopkitdev:loop-next-dev
Jun 12, 2026
Merged

Fix OmniTests: pass decisionId to UnfinalizedDose#77
marionbarker merged 2 commits into
loopandlearn:loop-next-devfrom
loopkitdev:loop-next-dev

Conversation

@loopkitdev

Copy link
Copy Markdown

Summary

UnfinalizedDose's bolus initializer now requires decisionId: UUID?, but OmniTests/PodCommsSessionTests.swift (testBolusFinishedEarlyOnPodIsMarkedNonMutable) still calls it without one, so the OmniTests target fails to compile:

PodCommsSessionTests.swift:69: missing argument for parameter 'decisionId' in call

The app/source call sites were already updated (e.g. UnfinalizedDose(decisionId: nil, bolusAmount: ...)); this just brings the test in line. Surfaces in CI test (not plain build, which doesn't compile the test target).

Change

One line — add decisionId: nil, to the test's bolus construction.

Test plan

  • OmniTests target compiles
  • testBolusFinishedEarlyOnPodIsMarkedNonMutable passes

…ests

UnfinalizedDose's bolus initializer gained a required decisionId: UUID?
parameter; the source call sites were updated but
testBolusFinishedEarlyOnPodIsMarkedNonMutable was missed, so the
OmniTests target failed to compile ("missing argument for parameter
'decisionId'"). Passes decisionId: nil, matching the other test/source
call sites.
ps2 added a commit to LoopKit/LoopWorkspace that referenced this pull request Jun 10, 2026
loopandlearn/OmnipodKit loop-next-dev HEAD (f529581a) has a test that
fails to compile -- UnfinalizedDose's bolus init now requires
decisionId but PodCommsSessionTests wasn't updated, breaking the CI
`test` step. Points OmnipodKit at loopkitdev/OmnipodKit loop-next-dev
@ d03b34d (f529581a + the one-line test fix); upstream PR is
loopandlearn/OmnipodKit#77. Revert to loopandlearn once that merges.
CryptoSwift 1.9.0 removed its `Data.bytes -> [UInt8]` extension (renamed
to `byteArray`). On the Xcode 26 SDK, `data.bytes` then resolves to
Foundation's new native `Data.bytes`, which returns a `RawSpan` -
breaking every crypto call site with errors like:

  Cannot convert value of type 'RawSpan' to expected argument type 'Array<UInt8>'
  Value of type 'RawSpan' has no member 'toHexString'

Builds pinned to CryptoSwift <= 1.8.5 are unaffected, so this only bites
users whose package resolution floats up to 1.9.0/1.10.0 (e.g. after
'Update to Latest Package Versions').

Replace `<data>.bytes` with `Array(<data>)`, which yields the same
[UInt8] and compiles against every CryptoSwift version (and doesn't
depend on CryptoSwift at all). Verified building OmnipodKit against
CryptoSwift 1.10.0 on Xcode 26.5.
@marionbarker

Copy link
Copy Markdown
Contributor

Test Summary

✅ successful test

Note that the patch found in OmnipodKit/patches/update_omnipodkit_for_LoopWorkspace_tidepool-sync-2026.patch should also be updated. I will do that in a separate PR.

Background

Note: this PR is using loopkitdev:loop-next-dev as the source branch and that branch has 2 commits:
c5162ea Use Array(data) instead of Data.bytes for CryptoSwift 1.9+ compatibility
d03b34d Fix OmniTests: pass decisionId to UnfinalizedDose in PodCommsSessionTests

This PR encompasses both PR #77 and PR #78.

Confirm this in a local clone, and then merge #78 first followed by #77.

I expected this PR to update after merging PR #78 and just show the one commit to add decisionID to OmniTests.
That did not happen although I can confirm in a local clone that only the decisionID is different in the 2 branches referenced in this PR.

Work in local clone

Start with LoopWorkspace next-dev brach
commit bc52c97

That branch references the source branch in the PR.
✅ The OmniTests succeed.

If I switch to the target branch in this PR, OmniTests cannot be built:

  • this demonstrates the error being solved
Screenshot 2026-06-12 at 3 59 34 PM

I confirmed locally that the only difference between loopandlearn:loop-next-dev and loopkitdev:loop-next-dev is the following:

OmnipodKit % git diff loop-next-dev  loopkitdev-loop-next-dev              
diff --git a/OmniTests/PodCommsSessionTests.swift b/OmniTests/PodCommsSessionTests.swift
index 7f6aace..84486da 100644
--- a/OmniTests/PodCommsSessionTests.swift
+++ b/OmniTests/PodCommsSessionTests.swift
@@ -66,7 +66,7 @@ class PodCommsSessionTests: XCTestCase, PodCommsSessionDelegate {
 
     func testBolusFinishedEarlyOnPodIsMarkedNonMutable() {
          let mockStart = Date()
-         podState.unfinalizedBolus = UnfinalizedDose(bolusAmount: 4.45, startTime: mockStart, scheduledCertainty: .certain, insulinType: .novolog)
+         podState.unfinalizedBolus = UnfinalizedDose(decisionId: nil, bolusAmount: 4.45, startTime: mockStart, scheduledCertainty: .certain, insulinType: .novolog)
          let session = PodCommsSession(podState: podState, transport: mockTransport, delegate: self)
 
          // Simulate a status request a bit before the bolus is expected to finish

@marionbarker marionbarker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve by code review and test.

@marionbarker marionbarker merged commit f37fc10 into loopandlearn:loop-next-dev Jun 12, 2026
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.

3 participants