mirror of
https://github.com/bckelley/cgm-remote-monitor.git
synced 2026-08-24 03:14:12 -05:00
Fixes #8450 - Loop Temporary Override sync breaks due to UUID _id handling Option G Implementation: - Extract client sync identity (identifier) from any source: - Loop overrides: UUID in _id field → moved to identifier - Loop carbs/doses: syncIdentifier → copied to identifier - AAPS: identifier already present - xDrip+: uuid → copied to identifier - Server generates proper ObjectId for _id field - Deduplication uses identifier (not _id) as primary key - No database migration needed - gradual adoption Changes: - normalizeTreatmentId(): extracts client identity to identifier field - upsertQueryFor(): identifier-first lookup, strips UUID _id for upsert - create()/upsert()/save(): fetch _id from DB after update by identifier - Added 'identifier' to indexedFields for efficient querying - Updated UUID treatment test with full workflow coverage Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>