Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.0-beta9] NSClient - Incorrect vertical position of BG check on graph #1085

Closed
vmichalec opened this issue Dec 17, 2021 · 11 comments
Closed
Labels
bug Something isn't working

Comments

@vmichalec
Copy link

Hi, this is probably only displaying issue on NS client side, details in screenshots.

Here is bg check of 5.8 correctly displayed on aaps graph, also entry in treatments shows value corrrectly. (Sorry for non-english screenshots)
AndroidAPS_01

AndroidAPS_02

But on NS Client side the value is positioned on the bottom of the graph, not on correct y-axis (vertical) position.

NSClient_01

And also in entries screen the value is not shown in the BG check entry.

NSClient_02

@vmichalec
Copy link
Author

[3.0-beta11] I have checked it also on latest beta. NSClient side treatments entry now shows also the value - perfect. Now I can see also the real problem behind - in AAPS I entered blood glucose on action tab as value of 30.0 mmol/L but on NSClient side there is shown as 1.7 mmol/L so now it is obvious. Graph position of the entry on NSClient side is now lite bit higher so it looks like the graph is correct and shows the label on 1.7 y-axis position.

Moreover I'm using also 1.9.0.5 BYODA. Calibrations made here are shown correctly in AAPS and also NSClient.

@Philoul
Copy link
Contributor

Philoul commented Dec 20, 2021

30mmol for a BG value! Very high, but 1.7 is a wrong convertion mg/dl to mmol/l.
Did you see 1.7mmol in user entry or in another place?
@vmichalec Can you check (if both AAPS AND NSClient are in latest version) if you still have this issue (I added recently BG value in User Entry received from ns client and fixed several bugs in unit convertion...)

@vmichalec
Copy link
Author

3.0-beta11 for aaps and nsclient, 14.2.5 nightscout version.

Doing again now: I entered BG Check in action tab of 30 mmol/L on aaps side, it becomes 1.7 mmol/L on nsclient side. Graph position of the entry on nsclient is slightly bellow 2 so I think it is only unit conversion problem.

@Philoul
Copy link
Contributor

Philoul commented Dec 21, 2021

Can you please send me a screenshot of "user entry" icon (treatments) in both phones to help me understand where is the bug

@vmichalec
Copy link
Author

AAPS:
AndroidAPS_01
AndroidAPS_02
AndroidAPS_03
AndroidAPS_04
AndroidAPS_05

NSClient:
NSClient_01
NSClient_02
NSClient_03

@Philoul
Copy link
Contributor

Philoul commented Dec 21, 2021

@MilosKozak I confirm the bug, there is a wrong unit change somewhere between source phone and destination phone (see below send and received values in log)

Value sent by source phone is OK (Unit is MMOL recorded in database and sent in NSCLIENT)

10:53:43.752 [RxCachedThreadScheduler-95] D/DATABASE: [NSClientAddAckWorker.doWork$lambda-7():114]: Updated ns id of TherapyEvent TherapyEvent(id=4438, version=0, dateCreated=1640080403090, isValid=true, referenceId=null, interfaceIDs_backing=InterfaceIDs(nightscoutSystemId=null, nightscoutId=61c1a427cfbcaf0004001c7d, pumpType=null, pumpSerial=null, temporaryId=null, pumpId=null, startId=null, endId=null), timestamp=1640080392000, utcOffset=3600000, duration=0, type=ANNOUNCEMENT, note=test notif, enteredBy=AndroidAPS, glucose=6.0, glucoseType=SENSOR, glucoseUnit=MMOL)
10:53:43.763 [pool-19-thread-2] I/NSCLIENT: [DataSyncSelectorImplementation.processChangedTherapyEventsCompat():536]: Loading TherapyEvents data Start: 4438 ID: 4438 HistoryID: TherapyEvent(id=4439, version=0, dateCreated=1640080403090, isValid=true, referenceId=4438, interfaceIDs_backing=null, timestamp=1640080392000, utcOffset=3600000, duration=0, type=ANNOUNCEMENT, note=test notif, enteredBy=AndroidAPS, glucose=6.0, glucoseType=SENSOR, glucoseUnit=MMOL) 

But value received on the other phone, unit is wrong (MMOL is replaced by MGDL)

10:53:48.987 [pool-18-thread-2] D/DATABASE: [NSClientAddUpdateWorker.doWork():291]: Inserted TherapyEvent TherapyEvent(id=1152, version=0, dateCreated=1640080428971, isValid=true, referenceId=null, interfaceIDs_backing=InterfaceIDs(nightscoutSystemId=null, nightscoutId=61c1a427cfbcaf0004001c7d, pumpType=null, pumpSerial=null, temporaryId=null, pumpId=null, startId=null, endId=null), timestamp=1640080392000, utcOffset=3600000, duration=0, type=ANNOUNCEMENT, note=test notif, enteredBy=AndroidAPS, glucose=6.0, glucoseType=SENSOR, glucoseUnit=MGDL)

@Philoul
Copy link
Contributor

Philoul commented Dec 21, 2021

Additionnally record is correct in NS (units = mmol) (with API V3 query)

    {
      "eventType": "Announcement",
      "isValid": true,
      "created_at": "2021-12-21T09:53:12.000Z",
      "enteredBy": "AndroidAPS",
      "units": "mmol",
      "notes": "test notif",
      "glucose": 6,
      "glucoseType": "Sensor",
      "isAnnouncement": true,
      "identifier": "61c1a427cfbcaf0004001c7d",
      "srvModified": 1640080392000,
      "srvCreated": 1640080392000
    },

@Philoul
Copy link
Contributor

Philoul commented Dec 21, 2021

Very strange Breakpoint in TherapyEventExtension.ktline 72 (therapyEventFromJson function), and the json string looks like that:
"unit" = "md/dl" and I have a "mmol" key with value ???

{
    "_id":"61c2407fcfbcaf0004001dc4",
    "eventType":"Question",
    "isValid":true,
    "created_at":"2021-12-21T21:00:28.000Z",
    "enteredBy":"AndroidAPS",
    "units":"mg\/dl",
    "notes":"test",
    "glucose":6.5,
    "glucoseType":"Finger",
    "mills":1640120428000,
    "mmol":6.5,
    "targetTop":null,
    "targetBottom":null
}

It's not the json string got from NS (see below json strings with API V1 queries)

{
    "_id":"61c2407fcfbcaf0004001dc4",
    "eventType":"Question",
    "isValid":true,
    "created_at":"2021-12-21T21:00:28.000Z",
    "enteredBy":"AndroidAPS",
    "units":"mmol",
    "notes":"test",
    "glucose":6.5,
    "glucoseType":"Finger",
    "mills":1640120428000,
    "carbs":null,
    "insulin":null
},

Unfortunatly I can't find where json string is modified to make a clean fix...

@kristinsmotz
Copy link

Have the same issue in beta11.
Screenshot_20211224-030454_NSClient
5.3 mmol/l in AAPS phone, 0.3 mmol in NSClient phone...

@MilosKozak MilosKozak added the bug Something isn't working label Dec 30, 2021
@MilosKozak
Copy link
Contributor

it's NS bug. reported to NS team

@MilosKozak
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants