github nightscout/cgm-remote-monitor v15.0.7
Release 15.0.7 Blueberry Muffin

7 hours ago

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 _id values are now stored without duplication, and remain reachable by their original UUID via the identifier field. New UUID_HANDLING env var (default true) 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 _id values, profile saves use replaceOne upsert to avoid duplicate-key races, websocket profile dbAdd dedups by startDate, 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 return 400 on malformed IDs. Activity and food gain bulkWrite for throughput. NightscoutKit-derived fixtures back the new test matrix.
  • Legacy compatibility — Treatments uploaded with legacy UUID _id (Issue #6923) are again findable via an $or fallback. 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_HANDLING env var (default true):
    • When true: a UUID supplied in _id is moved to identifier; the server assigns an ObjectId. GET/DELETE by UUID resolve through identifier.
    • When false: UUID _id values are stripped (legacy behavior).
    • Scope is intentionally narrow: only the _id field. syncIdentifier, uuid, and identifier payload fields are preserved as-is.
  • Treatments v1/v3 — Server-controlled ID with transparent promotion of UUID _id to identifier (commit e78a5bc6). Loop override duplicate-record bug (#8450) resolved.
  • Entries — CGM entries with UUID _id (notably Trio) now ingest correctly (b8815505).
  • Legacy $or fallback — Pre-existing UUID-_id treatment records remain findable for GET/DELETE (#6923, 246e46ad).

Production-Safety Checks

  • GAP-SYNC-046NODE_ENV=test is 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.
  • _id validationactivity, food, profile, devicestatus return 400 Bad Request on invalid ObjectId / UUID format.
  • Performanceactivity and food use bulkWrite.
  • Test fixtures — NightscoutKit fixtures cover the API array matrix end-to-end.

Other Features

  • UUID_HANDLING and MongoDB pool settings (MONGO_POOL_SIZE, etc.) added to example-template.env.
  • Configurable truncation of large predBGs prediction arrays in devicestatus (set max to 0 to disable).
  • Configurable insulin rounding precision (epsilon).
  • Traditional Chinese (zh_TW) localization enabled.

Fixed

MongoDB Compatibility (driver 5.x / MongoDB 8)

  • Cache regressioncache.filterForAge no longer rejects entries with ObjectId _id (root cause: _.isEmpty(ObjectId) returned true on driver 5.x). Commits f4e686c1, 95b4c5e2.
  • Profile savereplaceOne upsert prevents duplicate-key errors under concurrent saves (#8455).
  • Websocket AAPS profile dedupdbAdd for profiles dedups by startDate; insert errors now warn rather than crash (85f7e6ac).
  • Mongo save hardening — Driver compatibility fixes across save paths (69b620dd, PR #8474).
  • MongoDB 8 follow-upsfaf578c0 and 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).
  • /test endpoint — Restored for both development and test environments (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 dependenciesshare2nightscout-bridge0.2.12, minimed-connect-to-nightscout1.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=test hard-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=true is the new default. Operators who relied on the prior strip-UUID behavior must explicitly set UUID_HANDLING=false.
  • Tests: any custom CI/scripts invoking the test suite must set NODE_ENV=test. Running tests against a database whose entries count 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.

References

Don't miss a new cgm-remote-monitor release

NewReleases is sending notifications on new releases.