Skip to content

Commit

Permalink
Prevent Nightscout collisions from occurring when a transmitter ID is…
Browse files Browse the repository at this point in the history
… recycled (#285)

* Update DexcomSourceG5.swift

Generate unique _id value to prevent Mongo collisions in Nightscout

* Update DexcomSourceG6.swift

Generate unique _id value to prevent Mongo collisions in Nightscout
  • Loading branch information
LiroyvH authored and Jon-b-m committed Nov 22, 2023
1 parent 54cd74e commit e80718e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion FreeAPS/Sources/APS/CGM/DexcomSourceG5.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ extension DexcomSourceG5: CGMManagerDelegate {
let quantity = newGlucoseSample.quantity
let value = Int(quantity.doubleValue(for: .milligramsPerDeciliter))
return BloodGlucose(
_id: newGlucoseSample.syncIdentifier,
_id: UUID().uuidString,
sgv: value,
direction: .init(trendType: newGlucoseSample.trend),
date: Decimal(Int(newGlucoseSample.date.timeIntervalSince1970 * 1000)),
Expand Down
2 changes: 1 addition & 1 deletion FreeAPS/Sources/APS/CGM/DexcomSourceG6.swift
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ extension DexcomSourceG6: CGMManagerDelegate {
let quantity = newGlucoseSample.quantity
let value = Int(quantity.doubleValue(for: .milligramsPerDeciliter))
return BloodGlucose(
_id: newGlucoseSample.syncIdentifier,
_id: UUID().uuidString,
sgv: value,
direction: .init(trendType: newGlucoseSample.trend),
date: Decimal(Int(newGlucoseSample.date.timeIntervalSince1970 * 1000)),
Expand Down

0 comments on commit e80718e

Please sign in to comment.