nightscout / AndroidAPS

Opensource automated insulin delivery system (closed loop)
https://wiki.aaps.app
GNU Affero General Public License v3.0
725 stars 1.76k forks source link

bug: Notes field not delivered to nightscout (at leats for carb correnctions) #1835

Closed justmara closed 2 years ago

justmara commented 2 years ago

Steps to reproduce:

Expected behavior test note text in Notes field

versions used Checked in nsclient 3.0.0.2 (downloaded from releases in github) and aaps 3.0.0.2 (built myself). Nightscout 14.2.5

additional screenshots: (this is add carbs screen from aaps, but in russian, sorry :))

image

note correctly shown in treatments (but still missing in nightscout)

image

this is 2.8.2 nsclient behavior:

image image
justmara commented 2 years ago

this is how it seems from nightscout logs

 [32mWS: dbAdd client ID:  P0NQlXvnhQyg6nOqAAAC  data:  {
  collection: 'treatments',
  data: {
    eventType: 'Carb Correction',
    carbs: 1,
    created_at: '2022-06-17T09:20:52.000Z',
    isValid: true,
    date: 1655457652000
  }
}
DEDUPE: Adding new record
got data-received event, requesting reload
WS: dbUpdate client ID:  nzi8xvBB9O9gGzpuAAAA  data:  {
  collection: 'treatments',
  _id: '62ac4794324e1700041bf697',
  data: {
    eventType: 'Carb Correction',
    carbs: 1,
    created_at: '2022-06-17T09:20:52.000Z',
    isValid: true,
    date: 1655457652000
  }
}
got data-received event, requesting reload
Got results {
  _id: 62ac4794324e1700041bf697,
  eventType: 'Carb Correction',
  carbs: 1,
  created_at: '2022-06-17T09:20:52.000Z',
  isValid: true,
  date: 1655457652000
}

this is same action sent from 2.8.2

WS: dbAdd client ID:  TaiSKeiBC1Z2lck7AAAD  data:  {
  collection: 'treatments',
  data: {
    eventType: 'Carb Correction',
    carbs: 1,
    created_at: '2022-06-17T09:38:54Z',
    date: 1655458734000,
    isSMB: false,
    notes: 'test note',
    NSCLIENT_ID: '1655458748903'
  }
}
got data-received event, requesting reload
DEDUPE: Adding new record
got data-received event, requesting reload
Load Complete:
     sgvs:557, treatments:78, mbgs:2, profiles:1, devicestatus:845, sitechangeTreatments:1, insulinchangeTreatments:1, batteryTreatments:1, sensorTreatments:1, profileTreatments:2, tempbasalTreatments:4
data loaded: reloading sandbox data and updating plugins
WS: emitted notification to all clients
2022-06-17T09:39:16.492Z    EMITTING NOTIFICATION:
  {"level":"Info","title":"Carb Correction","message":"\nCarbs: 1g\nNotes: test note","group":"default","plugin":"treatmentnotify"}
MilosKozak commented 2 years ago

Note: db schema must be extended

justmara commented 2 years ago

@MilosKozak Why enhancement label? This feature were working on 2.0 and was lost during update to 3.x. And there is also UI input that is not processed/stored/sent as intended. So it's a real bug introduced in 3.0 version of app, not a new feature/enhancement.

MilosKozak commented 2 years ago

https://github.com/nightscout/AndroidAPS/pull/1842#issuecomment-1160627114