Skip to content

Sync upstream Trio dev (23bb3be36, 1.0.2.59) into Tai dev - #42

Merged
mountrcg merged 92 commits into
devfrom
sync/trio-2026-11-05
Nov 11, 2026
Merged

mountrcg merged 92 commits into
devfrom
sync/trio-2026-11-05

Conversation

@mountrcg

@mountrcg mountrcg commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Sync upstream Trio dev (23bb3be, 1.0.2.59) into Tai dev

Brings Tai dev up to upstream nightscout/Trio dev at 23bb3be36 — 88 upstream commits since the last sync base 26e457d96 (1.0.2.42), reported upstream as 165 files, +1190 / −2240.

What this sync brings

  • LoopKit next-dev ports adopted. LoopQuantity/LoopUnit at the LoopKit boundary, LoopKit-owned value types, the async pump/alert delegate APIs, async device deletion, and the async device-log fetch (upstream #1718, #1738, plus the per-kit commits they depend on).
  • LoopAlgorithm submodule removed (upstream #1726). The package reference, product dependency, .gitmodules entry and gitlink are gone; the algorithm code Tai uses lives in AlgorithmPackage and Trio/Sources/APS/OpenAPSSwift.
  • Reservoir read from the pump manager instead of stored (upstream #1712, #1703). monitor/reservoir.json and monitor/status.json are no longer loaded by OpenAPS, and the stored pump status is persisted through the new Core Data model (PumpStatusStored) instead.
  • One glucose formatter (upstream #1710, #1715): Decimal.formatted(for:), .formatted(withUnits:), .formattedDelta(for:), .formattedISF(for:). Formatter.glucoseFormatter(for:), NumberFormatter.glucoseFormatter and the formattedAsMmolL extensions are gone.
  • Critical-alert audio ownership (upstream #1716): an alert only stops the audio it owns; AlarmKit alarm IDs derive from the alert identifier.
  • Dead code and dead configuration removed (upstream #1693, #1711): ProgressBar, ConcurrentMap, MD5, Array+Extension, Color+Extensions, SettingsRowView, BolusProgressViewStyle, the AddCarbs module, the AutotuneConfig module, LibreConfigRootView, SettingsRootViewModel, ComputedBGTargets+Getter.
  • Smaller fixes: HealthKit insulin samples that end before they start are skipped (#1720), glucose-delta rounding (#1710), the Duo sheet/button layout fixes (#1682–#1685, #1686), and the glucose simulator's reset button colour (#1714).

Conflict resolution

The merge had 18 conflicted paths / 23 content hunks, plus 3 modify/delete paths and the MedtrumKit gitlink. Resolutions worth naming:

  1. autoISF kept end-to-end in Trio/Sources/APS/OpenAPS/OpenAPS.swift and Trio/Sources/APS/OpenAPSSwift/DetermineBasal/DetermineBasalGenerator.swift (Tai's +544 autoISF body, units: and pumpHistory: plumbing, autoISFStatus), while adopting upstream's reservoir removal in both files. Upstream's removal of the Decimal(string: rawReservoir) ?? 100 masking default is taken as-is — the reservoir is no longer synthesised when the pump does not report one.
  2. AutotuneConfig module accepted as deleted. Upstream removed the whole module; Tai has no Screen case or router registration for it either, so the modify/delete on AutotuneConfigStateModel.swift resolves to deletion and the remaining three module files go with it.
  3. History stays consolidated. Upstream split the History view into HistoryRootView+Adjustments.swift / +Glucose.swift; Tai's single HistoryRootView.swift (1118 lines) is kept and upstream's formatter migration is ported into it, so the two Tai-deleted extension files stay absent.
  4. AlgorithmSettingHints stayed the single source of hint text in AlgorithmAdvancedSettingsRootView, SMBSettingsRootView, TargetBehavoirRootView and UnitsLimitsSettingsRootView, instead of upstream's inline strings.
  5. MainChartHelper ID reconciliation in project.pbxproj: Tai's 49B21BBC/49B21BBD kept, the duplicate 582DF978/582DF979 set dropped, all other hunks unioned (Tai-only files kept, upstream's PumpStatus* files and two new test files added, LoopAlgorithm package refs removed).
  6. AutosensSettingsRootView adopts upstream's .formattedISF(for:) but keeps Tai's state.scope.preferences (not settingsManager.preferences).
  7. Chart Y-axis labels kept on the Tai fork's formatter. Upstream 6998a6cfb (#1711) deleted the per-view numberFormatter property from ISFEditorRootView and TargetsEditorRootView after removing its last use; Tai still labels both chart Y-axes through it, so the merge keeps the Tai call sites and restores the deleted property block in both editors — see Testing.

Submodules

15 pins updated, LoopAlgorithm removed, RoundWhiteDiscKit unchanged (still main). All 16 gitlink entries in the merged tree are byte-identical to upstream 23bb3be36:

AccuChekKit 3a784a8e2, CGMBLEKit 5bde830de, DanaKit 787a63924, EversenseKit ef496f168, G7SensorKit 08d488633, LibreLoop 0c90cd9a0, LibreTransmitter fb8e4ad28, LoopKit babddf045, MedtrumKit 1e761ef6a, MinimedKit 008aab09c, OmnipodKit 6fdf0e0e3, RileyLinkKit 52a652c93, SyaiKit d46674c54, TidepoolService 9cee9e138, dexcom-share-client-swift e7eda4029.

.gitmodules now tracks trio-next-dev for the loopandlearn kits, next-dev for OmnipodKit and dexcom-share-client-swift, main for RoundWhiteDiscKit, and nightscout/SyaiKit on trio-next-dev. scripts/define_common_trio.sh was updated to match.

MedtrumKit takes upstream's 1e761ef6a rather than Tai's c33699595: the upstream pin is publicly reachable on loopandlearn/MedtrumKit trio-next-dev and Tai's commit is its ancestor, so no fork work is lost.

Tai surface preserved

  • autoISF (AutoISF*, AimiB30, Determination+AutoISF) and the autoISF settings/history modules, including OpenAPS's autoISF columns.
  • AlgorithmSettingHints, the Tai Home dashboard panels (basalString/leftHeaderPanel), the Tai bolus/insulin formatters, and Tai's scope.preferences access path.
  • Garmin watch commands, trio-oref, the Tai bundle identifier and logging conventions.
  • Of the 163 changed files only two exist exclusively on Tai — Trio/Sources/Views/AlgorithmSettingHints.swift and Trio/Sources/Modules/Home/View/Chart/ChartElements/PeakLabelsOverlay.swift — and both were touched only by the mechanical formatter migration.
  • Localizable.xcstrings auto-merged; the net diff contains no localization changes.

Version

Config.xcconfig: APP_DEV_VERSION 1.0.2.42 → 1.0.2.59 (Tai's BUNDLE_IDENTIFIER unchanged).

Not included

  • No new Tai features and no behaviour change beyond what upstream shipped — this is a synchronization.
  • Reservoirs are no longer read from monitor/reservoir.json; anything that relied on that file sees the pump manager's value now.
  • The upstream History view split is not adopted; Tai keeps the consolidated file.
  • No release notes, no version promotion beyond upstream's build counter.

Testing

No local build or unit-test run was performed for this merge — verification was diff-based (merge provenance, submodule reachability, project-file object graph, formatter-reference sweep, git diff --check). CI on the exact head is the gate, and it caught two separate merge artifacts. Each was fixed in its own follow-up commit, and the final exact-head run is green.

  • Run 42073200286 on 5c077e40e: Algorithm Package (swift test) pass, Run Unit Tests fail at Build for testing — three compile errors in Trio/Sources/Modules/PumpConfig/PumpConfigProvider.swift (44:35, 45:31, 59:60). Upstream deleted savePreferences/save(settings:) from that provider; Tai's versions survived the merge without the LoopQuantity/LoopUnit port that every other DeliveryLimits call site in the tree received.

  • Fix 15c45e8c2 ("fix(sync): port PumpConfig delivery limits to LoopQuantity", 1 file, +3 / −3) ports PumpConfigProvider.save(settings:) to LoopQuantity(unit: .internationalUnitsPerHour, …) / LoopQuantity(unit: .internationalUnit, …) and the related LoopUnit read-back. Those three errors are gone from the next run.

  • Run 42078108303 on 15c45e8c2: Algorithm Package (swift test) pass (1m10s), Run Unit Tests fail (13m31s) at Build for testing, one error:

    Trio/Sources/Modules/ISFEditor/View/ISFEditorRootView.swift:195:34: error: cannot find 'numberFormatter' in scope
    

    Cause: upstream 6998a6cfb ("Remove unused formatters", #1711) deleted the private var numberFormatter: NumberFormatter property from both fork editors because upstream had also removed its last use; the merge keeps Tai's chart Y-axis label, which still calls it. Trio/Sources/Modules/TargetsEditor/View/TargetsEditorRootView.swift:175 carries the same dangling reference and fails as soon as ISFEditor compiles.

  • Fix b0458cc1f ("fix(sync): restore numberFormatter for the autoISF chart axis labels", 2 files, +14 / −0) restores the deleted computed property in ISFEditorRootView and TargetsEditorRootView, identical to the intact block in Trio/Sources/Modules/CSFEditor/View/CSFEditorRootView.swift: numberStyle = .decimal and maximumFractionDigits = state.units == .mmolL ? 1 : 0. Both call sites are untouched, and no other file, submodule gitlink, project-file entry or localization string changes.

  • Run 42082082361 on b0458cc1f (final head): Algorithm Package (swift test) pass (1m18s), Run Unit Tests pass (16m59s) — conclusion success.

Both merge defects are therefore fixed on the branch and CI is green on the head this PR is opened from.

Screenshots

Not applicable — no user-facing UI change is introduced by this sync.

gordolio and others added 30 commits October 27, 2026 08:01
Replace screen-based widths with container-relative sizing in basal profile, carb ratio, ISF, and target editors. Extend save bar backgrounds across horizontal safe areas.
Pin the List's top content margin to 35 pt in the Treatments sheet and the add and edit override and temp target forms. The iPhone Duo's closed display defaults it to 0, which put the first row under the sheet's bar.
Keep only vertical padding on the NavigationStack in SettingInputHintView and the override, temp target, and contact image help views. Pad the List and Got it! button horizontally instead, so the sheet's horizontal safe-area inset applies once.
Replace screen-based widths with container-relative sizing in the Add Contact, Edit Contact, CGM options, Adjustments stop and History meal editor bars. Extend the bar backgrounds across horizontal safe areas.
Replace screen-based widths with container-relative sizing for the load-error Retry button, the migration-error Proceed button and the Live Activity widget configuration preview.
Removes unused AddCarbs, Autotune, and Libre configuration screens, unused helper extensions (Array, ConcurrentMap, MD5), progress views, and their Xcode project references. No behavior change.
…tch session has ended

The reservoir file kept the previous pump's or patch's value, so Home and the Nightscout device status showed it until the new pump reported its own. A missing reservoir is now uploaded as no value rather than 0.
[Duo 1/5] Therapy editors: size the save bar to its container, not the screen
[Duo 2/5] Treatments and adjustment forms: pin the list's top content margin
[Duo 3/5] Help sheets: pad inside the NavigationStack, not around it
[Duo 4/5] Sticky action bars: size them to their container, not the screen
Fix glucose delta rounding in mmol/L and unify delta formatting
[Duo 5/5] Error screens and Live Activity preview: size to the container, not the screen
dnzxy and others added 28 commits November 1, 2026 16:17
…rmatting

Fix glucose decimals and unify glucose formatting
A temp basal dated across a clock change is stored with its end before its
start, so the upload built an HKQuantitySample whose endDate precedes its
startDate. HealthKit validates the sample when saving it and raises
_HKObjectValidationFailureException, an Objective-C exception that the
upload's do/catch cannot handle, so the app terminated on every attempt to
upload insulin until that row left the 24 hour query.

Both places that derive a sample's end from a pump event now skip the sample
and log it instead of building one whose end precedes its start.

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
…ple-dates

Skip Apple Health insulin samples that end before they start
Read the reservoir from the pump manager instead of storing it
Fix Critical Alarms Cut Off and AlarmKit Permission Issues
Adopt async device deletion and track next-dev
@mountrcg
mountrcg merged commit 7f7642d into dev Nov 11, 2026
2 checks passed
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.

6 participants