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

xDrip can show an overlap when switching hardware data source #3398

Open
Navid200 opened this issue Mar 22, 2024 · 9 comments · Fixed by #3557
Open

xDrip can show an overlap when switching hardware data source #3398

Navid200 opened this issue Mar 22, 2024 · 9 comments · Fixed by #3557

Comments

@Navid200
Copy link
Collaborator

I have been able to repeatedly cause this as explained here.

1- Set xDrip to collect from a G6 in a simulator.
2- Change the hardware data source to Nightscout follower from a different source.

Screenshot_20240322-152426

The overlap occurs when switching from a G6 collector to Nightscout follower. It does not when switching from Nightscout follower to G6 collector.


I think xDrip should only backfill for a time period that has no readings.
I'm not sure. But, I suspect that xDrip will avoid backfilling if there is existing data for the exact time stamps. But, I believe it should avoid it even if the timestamps are different as long as there are readings in the same time period.

@minsartp
Copy link

I have the same issues when switching from Dexcom One to One+:
In my case, it went as follows: I put on the new (and my first!) One+ Sensor yesterday around 21:54. I STOPPED my old (One) sensor this morning at around 7:51 (it still had +-24 hours left). I immediately changed the Transmitter ID to start the new sensor, which effectively happend at around 7:57. I immediately saw all backfilled data in xDrip and AAPS. The earliest value that was backfilled is from 22:22 yesterday, which is probably the very first value after the warmup period. The new and old values are not exactly in sync (old: every 5 minutes starting at xx:01 -> xx:06 -> xx:11 , ...) (new: every 5 minutes starting at xx:02 -> xx:07 -> xx:13 , ...)
Screenshot_20240629_075913_xDrip+

@Navid200
Copy link
Collaborator Author

I just did another test. This time, I switched from fake data source to Nightscout follower. And there is an overlap.
Screenshot_20240629-121550 Screenshot_20240629-122221

@Navid200
Copy link
Collaborator Author

Navid200 commented Jul 2, 2024

G6 > stop > G7 right away

This means after stopping sensor, you change the transmitter ID right away before there is a chance for xDrip to submit the stop command to the G6 transmitter.

Screenshot_20240702-082837 Screenshot_20240702-082704

@minsartp
Copy link

minsartp commented Jul 2, 2024

G6 > stop > G7 right away

This means after stopping sensor, you change the transmitter ID right away before there is a chance for xDrip to submit the stop command to the G6 transmitter.

Screenshot_20240702-082837 Screenshot_20240702-082704

In my case, I did wait that the G6 sensor was fully stopped (= the command processed by the transmitter) before I changed the Transmitter ID to the one of the G7.

@Navid200
Copy link
Collaborator Author

Navid200 commented Jul 2, 2024

G6 > G7
This means changing the transmitter ID from G6 to G7 without stopping the session. This does not cause an overlap.

Screenshot_20240702-095206 Screenshot_20240702-101026

@Navid200
Copy link
Collaborator Author

Starting with the xDrip Nightly release of July 17, 2024, xDrip will only backfill (G6 or G7) starting from the last existing reading.
This will avoid the possibility of an overlap.

As a result, if you have a gap followed by some readings, the backfill will not fill the gap.

It is best to avoid practices that could cause such gaps. For example, if you want to perform a test, use a test phone instead of using your main xDrip installation on your active main phone.

@Navid200
Copy link
Collaborator Author

@Der-Schubi I can still cause this to fail. That's why I reopened it.

I think I need to exclude backfills that precede the start time of the current internal session. That combined with the internal session start time being limited to last reading should be a solid fix.
I will be working on this and should have the PR ready in a few days and test G7 to G7 in 9 days.

In the meantime, to avoid an overlap, you can stop your sensors from expiring. To do that, let's say you know your sensor will expire at 2 pm. At 1:55 or before, stop collection in xDrip. Then, peel off the sensor and move it away. Then, switch to your new sensor. This will avoid a backfill overlap until we fix the issue.

@Der-Schubi
Copy link
Contributor

Der-Schubi commented Jan 22, 2025

@Der-Schubi I can still cause this to fail. That's why I reopened it.

I think I need to exclude backfills that precede the start time of the current internal session. That combined with the internal session start time being limited to last reading should be a solid fix.

Thats why I suggested to stop the internal session before starting a new one. I think this would take care of a few tripping points.
Not the one with the backfill in particular, though.

@Navid200
Copy link
Collaborator Author

And what do we do if you decide to switch temporarily from one sensor to another and then come back?
If we stop the internal session automatically every time you switch devices, there will not really be any value in maintaining such a value. What would be its benefit then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants