pazaan / 600SeriesAndroidUploader

Your Medtronic 600-series pump data, direct to Nightscout
http://pazaan.github.io/600SeriesAndroidUploader/
MIT License
189 stars 312 forks source link

Replacement 600 series pumps can cause DB keys to be repeated #235

Closed Pogman closed 5 years ago

Pogman commented 6 years ago

Each record sent to nightscout contains a "key600" field which is generated from the RTC of the pump event. In general this is always unique and we have the same key even when multiple uploaders are used.

If a pump is replaced the RTC is started again from it's initial value (new pump) and the potential for repeated keys is increased.

While it's very unlikely to actually cause a key clash, if a pump is replaced multiple times and specially in short order the risk increases accordingly.

volkerrichert commented 6 years ago

you can add (prefix) the pump-MAC to the key600 to avoid key clashes with new pumps....

Pogman commented 6 years ago

Yeah something like that but it has handled with care due to the data already in NS using the original keys.

Pogman commented 6 years ago

Additional Info: There is one case from FB noted for this. The user has had 4 replacement pumps and noted odd random gaps in their cgm graph where data was available in the uploader and treatments were getting through to NS in the same period.

Workaround: delete mongoDB data or delete NS site and deploy a new one.

Pogman commented 5 years ago

Fixed for next version.

Added 'pumpMAC600' field in addition to the 'key600' field. Handles old and new versions of the uploader and allows NS searches based on pump. No additional transactional bandwidth for this too which is nice.

Pogman commented 5 years ago

Closed - completed and available in 0.7.0 release