mirror of
https://github.com/bckelley/cgm-remote-monitor.git
synced 2026-08-24 03:14:12 -05:00
Trio/Loop upload CGM entries with UUID strings as _id field. This caused MongoDB errors when re-uploading with different UUID at same timestamp: "immutable field '_id'" error. Fix: - Add normalizeEntryId() to extract UUID from _id to identifier field - Add upsertQueryFor() to strip non-ObjectId _id before $set - Maintain sysTime+type as primary dedup key for CGM data integrity - Add identifier to indexed fields Tests: - 3 baseline tests document current sysTime+type dedup behavior - 6 UUID handling tests including the previously-failing scenario Refs: GAP-SYNC-045, REQ-SYNC-072 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>