Skip to content

NSClientV3 / Insight: delivered bolus upload can fail with 400 Field eventType cannot be modified by the client #4715

@PieterGit

Description

@PieterGit

Summary

I am seeing a bolus upload problem with Boost 3.4 dev and Nightscout 15.0.6 that looks related to treatment identifier reuse.

A Bolus Wizard entry is uploaded successfully first, but when the actual delivered bolus is later uploaded as Meal Bolus, Nightscout returns:

FAIL BS {"status":400,"message":"Field eventType cannot be modified by the client"}

From the logs and the Nightscout API responses, it looks like the identifier used for the new bolus already belongs to an older, unrelated treatment. Nightscout then appears to treat the new upload as an update to that older treatment and rejects the eventType change.

This looks related in symptom to AndroidAPS issue #3404, although the failure mode here seems more specific: an identifier collision rather than only “missing insulin”.

Note: the Nightscout identifier values below are pseudonymised consistently for privacy. The repeated identifier still represents the same collision pattern.

Environment

  • Boost / AAPS version: 3.4.2.1
  • Build: ac20a2113b-2026.04.11
  • Remote: https://github.com/tim2000s/Boost-in-AAPS_3.4.git (Dev branch)
  • Flavor: fullrelease
  • Nightscout version: 15.0.6
  • Pump: ACCU_CHEK_INSIGHT
  • NS client: v3

Setup notes

  • Dexcom Native app in use
  • xDrip used as companion app
  • AAPS/Boost is the Nightscout uploader

Expected behaviour

A bolus calculator entry and the actual delivered bolus should both be stored in Nightscout without colliding with an unrelated older treatment.

Actual behaviour

The initial Bolus Wizard entry is accepted by Nightscout, but the later Meal Bolus upload fails with:

{"status":400,"message":"Field eventType cannot be modified by the client"}

As a result, the insulin from the delivered bolus is not shown correctly in Nightscout.

Relevant log excerpt

21:29:01.542 [RxCachedThreadScheduler-52] D/NSCLIENT: [NSClientV3Plugin$onStart$8.accept():268]: ► UPDATE treatments Sent PairBolus 8c7d4f12-4a6e-53bd-b912-1f3c09d8a7ef <i>{"date":1776022141445,"eventType":"Meal Bolus","identifier":"8c7d4f12-4a6e-53bd-b912-1f3c09d8a7ef","insulin":0.14,"isBasalInsulin":false,"isReadOnly":false,"isValid":true,"pumpId":62,"pumpSerial":"123456","pumpType":"ACCU_CHEK_INSIGHT","type":"NORMAL","utcOffset":60}</i> 5085/5086
21:29:01.601 [DefaultDispatcher-worker-6] D/EVENTS: [RxBusImpl.send():25]: Sending EventNSClientNewLog[action=◄ FAIL,date=1776022141600,logText=BS {"status":400,"message":"Field eventType cannot be modified by the client"},timeFormat=java.text.SimpleDateFormat@8140d380]
21:29:01.602 [RxCachedThreadScheduler-52] D/EVENTS: [RxBusImpl.send():25]: Sending EventNSClientUpdateGuiData[]

Nightscout data

The Bolus Wizard entry is created successfully with its own identifier:

{
  "status": 200,
  "result": [
    {
      "app": "AAPS",
      "date": 1776022137844,
      "eventType": "Bolus Wizard",
      "created_at": "2026-04-12T19:28:57.844Z",
      "identifier": "6f2c8d41-7b13-5ab0-9d74-2b61f0a4e3c9"
    }
  ]
}

The failing Meal Bolus upload uses identifier:

8c7d4f12-4a6e-53bd-b912-1f3c09d8a7ef

That identifier already exists in Nightscout and points to an older, unrelated treatment:

{
  "status": 200,
  "result": [
    {
      "app": "AAPS",
      "date": 1767509200917,
      "eventType": "Correction Bolus",
      "insulin": 0.21,
      "isBasalInsulin": false,
      "isReadOnly": false,
      "isValid": true,
      "pumpId": 62,
      "pumpSerial": "123456",
      "pumpType": "ACCU_CHEK_INSIGHT",
      "type": "SMB",
      "utcOffset": 60,
      "created_at": "2026-01-04T06:46:40.917Z",
      "identifier": "8c7d4f12-4a6e-53bd-b912-1f3c09d8a7ef"
    }
  ]
}

So it looks as if Nightscout is receiving a new bolus with an identifier that is already attached to an older Correction Bolus, and therefore rejects the update when eventType changes to Meal Bolus.

Why this looks like an identifier collision

The reused identifier belongs to an older treatment with the same:

  • pumpType = ACCU_CHEK_INSIGHT
  • pumpSerial = 123456
  • pumpId = 62

This suggests that the local bolus identity used for Nightscout sync may be getting reused for a later bolus, rather than a fresh unique identifier being associated with the new treatment.

Similar issue

This looks similar in symptom to AndroidAPS issue #3404:

  • "Insulin or carbs not being sent to Nightscout using Bolus Calculator"

In my case, the problem seems to be that the delivered bolus upload collides with an older treatment identifier, which would explain why the insulin is not shown correctly in Nightscout.

Possible direction to investigate

One possible direction to investigate is the Insight bolus sync path and how the Nightscout-facing treatment identity is derived for delivered boluses.

A possible explanation is that a later bolus is being matched to an existing local record by pump-related IDs, and the previously stored Nightscout identifier is then reused for upload. If that is the case, it may be worth checking whether the Insight path should reconcile boluses using a temporary ID first, or otherwise use a bolus key that remains unique across time for that pump.

I am mentioning this only as a possible direction to investigate, not as a confirmed fix.

Additional note

I used ChatGPT 5.4 to help inspect the logs and compare the Nightscout treatment records. The factual parts above are based on the app logs and the Nightscout API responses shown here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions