Skip to content

Deduplicate Nightscout treatment entries#569

Open
bjorkert wants to merge 1 commit intomainfrom
fix/deduplicate-treatments
Open

Deduplicate Nightscout treatment entries#569
bjorkert wants to merge 1 commit intomainfrom
fix/deduplicate-treatments

Conversation

@bjorkert
Copy link
Contributor

@bjorkert bjorkert commented Mar 21, 2026

Summary

  • Nightscout can return duplicate treatment entries with the same id (Trio/Loop UUID) but different _id (MongoDB ObjectId), causing duplicate boluses, carbs, etc. to appear on the graph.
  • Deduplicates entries by id at the top of updateTreatments(entries:) before classification, so all treatment types benefit. Entries without an id field are kept as-is.

Nightscout can return duplicate treatment entries with the same "id"
(Trio/Loop UUID) but different "_id" (MongoDB ObjectId), causing
duplicate boluses, carbs, etc. on the graph. Filter duplicates at the
top of updateTreatments before classification.
@bjorkert bjorkert self-assigned this Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant