cgm-remote-monitor v15.0.7 — Release Notes
(PR #8444)
Base: master (15.0.6) → dev
Range: 15.0.6..dev (≈223 non-merge commits across 180 files; +42,765 / −5,197)
Highlights
- UUID/Identifier handling for AID clients (REQ-SYNC-072) — Loop overrides and Trio entries that arrive with UUID
_idvalues are now stored without duplication, and remain reachable by their original UUID via theidentifierfield. NewUUID_HANDLINGenv var (defaulttrue) gates the write-path normalization. - Production-safety guardrails — Tests now refuse to run without
NODE_ENV=test(GAP-SYNC-046) and a database-level entry-count check (GAP-SYNC-047) prevents accidental writes against a populated production DB. - MongoDB driver 5.x / Mongo 8 hardening — Cache layer no longer rejects
ObjectId_idvalues, profile saves usereplaceOneupsert to avoid duplicate-key races, websocket profile dbAdd dedups bystartDate, and entries/profile/activity/food/devicestatus storage paths are migrated to the modern driver. - API array-input handling — Entries, treatments, devicestatus, profile, activity, and food POST endpoints accept arrays, validate
_id, and return400on malformed IDs. Activity and food gainbulkWritefor throughput. NightscoutKit-derived fixtures back the new test matrix. - Legacy compatibility — Treatments uploaded with legacy UUID
_id(Issue #6923) are again findable via an$orfallback. mmol BG values render correctly in OpenAPS tooltips. Traditional Chinese localization is enabled and Spanish translation JSON is fixed.
Added
UUID / Identifier Handling (REQ-SYNC-072, GAP-SYNC-045, GAP-TREAT-012)
UUID_HANDLINGenv var (defaulttrue):- When
true: a UUID supplied in_idis moved toidentifier; the server assigns an ObjectId. GET/DELETE by UUID resolve throughidentifier. - When
false: UUID_idvalues are stripped (legacy behavior). - Scope is intentionally narrow: only the
_idfield.syncIdentifier,uuid, andidentifierpayload fields are preserved as-is.
- When
- Treatments v1/v3 — Server-controlled ID with transparent promotion of UUID
_idtoidentifier(commite78a5bc6). Loop override duplicate-record bug (#8450) resolved. - Entries — CGM entries with UUID
_id(notably Trio) now ingest correctly (b8815505). - Legacy
$orfallback — Pre-existing UUID-_idtreatment records remain findable for GET/DELETE (#6923,246e46ad).
Production-Safety Checks
- GAP-SYNC-046 —
NODE_ENV=testis now a hard requirement for the test suite; missing/incorrect value aborts before any DB connection. - GAP-SYNC-047 — Database-level safety check inspects entry count against a configurable threshold; refuses to start tests against a populated production DB. Threshold check uses
ctx.store.db(#8464).
API Array & Validation Improvements
- Array POST support restored/added for:
entries,treatments,activity,food,profile,devicestatus. _idvalidation —activity,food,profile,devicestatusreturn400 Bad Requeston invalid ObjectId / UUID format.- Performance —
activityandfoodusebulkWrite. - Test fixtures — NightscoutKit fixtures cover the API array matrix end-to-end.
Other Features
UUID_HANDLINGand MongoDB pool settings (MONGO_POOL_SIZE, etc.) added toexample-template.env.- Configurable truncation of large
predBGsprediction arrays in devicestatus (set max to0to disable). - Configurable insulin rounding precision (epsilon).
- Traditional Chinese (
zh_TW) localization enabled.
Fixed
MongoDB Compatibility (driver 5.x / MongoDB 8)
- Cache regression —
cache.filterForAgeno longer rejects entries withObjectId_id(root cause:_.isEmpty(ObjectId)returnedtrueon driver 5.x). Commitsf4e686c1,95b4c5e2. - Profile save —
replaceOneupsert prevents duplicate-key errors under concurrent saves (#8455). - Websocket AAPS profile dedup —
dbAddfor profiles dedups bystartDate; insert errors now warn rather than crash (85f7e6ac). - Mongo save hardening — Driver compatibility fixes across save paths (
69b620dd, PR #8474). - MongoDB 8 follow-ups —
faf578c0and related commits.
Note: A v3 REST-path equivalent of the AAPS profile-store dedup (
3b786ab3) was reverted (c927be7a) pending further validation. The websocket-path dedup remains.
Other Fixes
- OpenAPS tooltip mmol display — BG values now formatted correctly in mmol/L (
505e375e). - Debounce / data-received — Restored debounce with a concurrency guard (
98ee2bcb); also a path that removes the delay for near-real-time updates (5a9ffb12). - Spanish translation JSON — Malformed entry fixed (
1cab4909). /testendpoint — Restored for bothdevelopmentandtestenvironments (e35e7104).- Production-safety thresholding — Tests are permitted when entry count is within the configured threshold (#8464).
- devicestatus — Each item in array input is purified (
2e81ce07).
Changed
- Bridge dependencies —
share2nightscout-bridge→0.2.12,minimed-connect-to-nightscout→1.5.8(797df9bd). - CI — Node 20 temporarily re-enabled for branch-protection compliance (
ee3e6af7); GitHub runners deprecation of Node 20 acknowledged (3758b6e3). - Profile API — Migrated to the modern MongoDB driver (
286fa070). - Activity / Food APIs — Migrated to the modern MongoDB driver with new tests (
3b4dfad2,49145895). - Websocket layer — Adjusted for the updated MongoDB driver (
269320e4).
Test Infrastructure
NODE_ENV=testhard-requirement (GAP-SYNC-046).- Flaky-test detection harness and documentation (
b68e538d,bcc194ba,4feeb015). - WebSocket warning timeouts to reduce flakiness.
- Smaller MongoDB pool size in test env; configurable connection management.
- Bulk-write throughput tests for activity/food.
- Array-handling test matrix using NightscoutKit fixtures.
- Loop sync workflow tests: ObjectIdCache (
8ba8bbb1), SGV/DeviceStatus uploads (595219f9), carb/dose uploads (16191f9c), override UUID handling (4af34767).
Upgrade Notes
- Default behavior change:
UUID_HANDLING=trueis the new default. Operators who relied on the prior strip-UUID behavior must explicitly setUUID_HANDLING=false. - Tests: any custom CI/scripts invoking the test suite must set
NODE_ENV=test. Running tests against a database whoseentriescount exceeds the safety threshold will now abort. - MongoDB: requires driver 5.x compatibility; storage paths assume the modern driver. Verify connection-pool env vars (
MONGO_POOL_SIZE, etc.) against documented defaults. - Node.js: continues 15.0.4 baseline (Node 20 / 22). Node 20 remains in CI matrix temporarily.
Known Issues / Deferred
- v3 REST AAPS profile-store dedup — Reverted in
c927be7a; only the websocket dbAdd dedup ships in 15.0.7. Re-introduction tracked for a follow-up. - GitHub runner Node 20 deprecation — CI matrix carries Node 20 under temporary allowance; plan to drop in a subsequent release.