JohanDegraeve / xdripswift

xdrip for iOS, written in Swift
GNU General Public License v3.0
316 stars 310 forks source link

Erroneous +0 BG deltas reported #544

Open aug0211 opened 2 weeks ago

aug0211 commented 2 weeks ago

See PR #545

xDrip occasionally reports a +0 BG delta when in fact BG delta is not +0. This most often occurs with +1 or -1 deltas (mgdl). Have discussed in the past but could not find an issue for it. I've implemented a very minor code change that resolves this issue for me. I'm opening the issue to accompany the PR.

I've reproduced this issue across 4 iOS devices and 2 WatchOS devices and both master and dev builds over the past ~6 weeks.

We first suspected multiple sources uploading to Nightscout as the cause. This was addressed and the issue did not resolve. This was not the cause.

Here are recent screen shots showing xDrip reporting a delta of +0, when in fact Nightscout reports a -1 (which is accurate because BG went from 87 to 86).

imageimageimage

I have implemented a trivial fix for this which I've tested and validated as working as desired across watch complication, watch app, phone widget, phone live activities, phone app. See PR #545.