Skip to content

Crash during background carbohydrate uploads in BaseTidepoolManager.uploadCarbs(_:) #656

@dnzxy

Description

@dnzxy

Describe the bug

When the Trio app (v0.5.0 (22)) processes pending carbohydrate uploads on its background network queue, it crashes instead of completing the sync. The fault occurs in the BaseTidepoolManager.uploadCarbs(_:) closure on the BaseNetworkManager.processQueue thread, rather than successfully sending the data.

Attach a Log

org.nightscout.trio_issue_28e30203958fd16bda3d7870c0bddeac_crash_session_97189b2a7bbc4873822e27f4ba40c3b2_DNE_0_v2_stacktrace.txt

To Reproduce

Steps to reproduce the behavior:

  1. Launch the Trio app (version 0.5.0 (22)).
  2. Create or have a pending carbohydrate entry in HealthKit (e.g., log a meal in the app).
  3. Ensure the device has network connectivity.
  4. Wait for the automatic background sync to trigger.
  5. Observe the crash on the BaseNetworkManager.processQueue thread.

Expected behavior

Carbohydrate entries should upload to the Tidepool backend without crashing, and the app should continue operating normally after the sync completes.

Screenshots

No screenshots available; crash happens during a background network operation.

Setup Information (please complete the following information):

Smartphone:

  • Hardware: iPhone 15 Pro
  • OS Version: iOS 17.5

Pump:

  • Manufacturer: Insulet
  • Model: Omnipod Dash

CGM:

  • Device: Dexcom G7
  • Manager app: Dexcom App

Trio Version:

  • Version Number: 0.5.0 (22)
  • Repo: nightscout/trio
  • Git Reference: commit hash unknown

Technical Details

  • Thread: BaseNetworkManager.processQueue

  • Faulting frame:

    0  Trio    0x4449a4 closure #1 in BaseTidepoolManager.uploadCarbs(_:) + 4367796644
    1  Trio    0x3a64d0 <deduplicated_symbol> + 4367148240
    …
    
  • Likely cause: an unexpected nil or race condition inside the carb-upload closure leading to an uncaught exception or memory fault during network‐queue processing

Additional context

This issue appears only when the background sync processes carbohydrate data. Other network operations (e.g., uploading insulin or glucose) seem to complete without error. It may be triggered by a malformed carb entry or a threading issue within BaseTidepoolManager.uploadCarbs(_:).

Metadata

Metadata

Assignees

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions