Closed jbr7rr closed 1 year ago
Thinking about it there is one thing I can do from the driver:
val syncOk = pumpSync.syncBolusWithTempId(
timestamp = bolusStartTime,
amount = bolusNormalDelivered,
temporaryId = detailedBolusInfo.timestamp,
type = detailedBolusInfo.bolusType,
pumpId = bolusStartTime,
pumpType = medtrumPump.pumpType(),
pumpSerial = medtrumPump.pumpSN.toString(radix = 16)
)
Change timestamp = bolusStartTime,
to timestamp = detailedBolusInfo.timestamp
@MilosKozak would this be a desired and proper fix for this problem?
Edit: I checked the Medtronic implementation as they use the same pumpSync interface. There they also use the time from the pump, so they could possible have the same problem if it is due to too much time difference between the temporary timestamp and the pump timestamp
this is serious. conflict of syncWithTempId and NS back sync having receiving records from NS disabled by default has a good reason
i have to think about it
Note for me: NS back sync is using timestamp Idea: skip pumpId=null
i have to think about it
Note for me: NS back sync is using timestamp Idea: skip pumpId=null
If possible I would do this at upload, this also prevents doubled entries in NS itself.
Will mean that bolus is only uploaded once the bolus is completed and fully synced, for Medtrum it is not a problem afaik. For Medtronic pumps I dont know if this can cause for significant delays in upload.
the issue is valid for all tempId plugins It has to be resolved in NS plugin
Cought the error today on my own setup with NSClient V3 and the Setting "Receive Insulin" enabled Treatments in NS were also doubled
@14:53
AndroidAPS._2023-08-2908-18-05.30.zip
hopefully resolved by https://github.com/nightscout/AndroidAPS/commit/394883165d2f6603286d7bb56f6312d8b742c3b8 open new issue with new logs if not
Nice, SMB now only gets uploaded when bolus is fully synced, works as expected so far. Thx
Note: Got this report from another user via PM
Build: 3.2.0-RC1 Pump: Medtrum nano NSClient V1 Time: 13:36 and 13:46 Logs: AndroidAPS._2023-08-28_02-00-09.zip
Bolus was doubled in treatments, I checked the logs for errors in the pump sync, as far as I can see there werent any faults with the driver and the bolus was reported as expected:
First the bolus is temporary synced, After bolus is finished, the record is updated. (This is the usual happy flow for the Medtrum driver)
As the user has enabled receive Insulin from NS, I suspect this might have something to do with this? @MilosKozak Can you check this on NS / Database side? Also note I have seen a doubled bolus once with this option enabled on NSClient V3, but at that time I had only pump logs enabled, I haven't had this myself after that one instance.