Commit Graph
6446 Commits
Author SHA1 Message Date
Ben WestandCopilot 02eec1b5a7 test: add identifier field tests for AAPS pattern (REQ-SYNC-072)
Add 3 new tests for explicit identifier field handling:
- supports identifier field for AAPS-style treatments
- deduplicates by identifier on re-upload
- supports batch upload with identifiers

These complement existing UUID _id tests (Loop pattern) to cover
both AID client sync patterns.

Refs: REQ-SYNC-072, GAP-TREAT-012

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-10 15:26:39 -07:00
Ben WestandCopilot 595219f9c4 Add Loop SGV entry and DeviceStatus upload tests
SGV Entry Tests (TEST-SGV-001 to 005):
- Single SGV with required fields
- All direction values
- Loop device identifier preserved
- Dexcom device with filtered/unfiltered/noise
- SGV deduplication by date+device
- Different devices create separate entries
- MBG (manual BG check) entries

DeviceStatus Tests (TEST-DS-001 to 005):
- Loop status with IOB/COB
- Loop predicted values array
- Loop enacted temp basal
- Pump reservoir and battery
- Omnipod specific fields
- Override in deviceStatus
- Override with insulinNeedsScaleFactor
- Complete Loop deviceStatus

17 new tests, all passing (716 total).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-10 15:03:48 -07:00
Ben WestandCopilot 16191f9c99 Add Loop carb and dose upload tests
Carb Tests (TEST-CARB-001 to 004):
- Create carb with syncIdentifier and absorptionTime
- Create carb with fat/protein (Warsaw FPU method)
- Create carb with cached _id
- Update carb via cached _id
- Delete carb via cached _id

Dose Tests (TEST-DOSE-001 to 005):
- Bolus with syncIdentifier
- Meal bolus with carbs and insulin
- Temp basal with rate and duration
- Suspend (zero rate) temp basal
- Update dose via cached _id
- Hex string syncIdentifier (pump events)
- Mixed dose batch maintains order

13 new tests, all passing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-10 15:00:16 -07:00
Ben WestandCopilot d12bebe303 Add identity field test matrix for AID clients
Client Pattern Tests:
- TEST-ID-001: Loop Override UUID _id → identifier
- TEST-ID-002: Loop Override identifier field
- TEST-ID-003: Loop Carb syncIdentifier
- TEST-ID-004: AAPS identifier: null
- TEST-ID-005: AAPS identifier: ObjectId
- TEST-ID-006: xDrip+ uuid + _id fields

v1 API Identity Tests:
- TEST-V1-ID-001: No id field
- TEST-V1-ID-002: Valid ObjectId
- TEST-V1-ID-003: UUID string (REQ-SYNC-072)
- TEST-V1-ID-004: syncIdentifier field

Deduplication Tests:
- Duplicate identifier handling
- Unique identifiers create separate docs

12 new tests, all passing.

Refs: REQ-SYNC-072, GAP-TREAT-012

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-10 14:58:05 -07:00
Ben WestandCopilot 8ba8bbb18e Add ObjectIdCache workflow tests for Loop sync patterns
TEST-CACHE-001: POST carb → cache syncIdentifier → PUT with id
TEST-CACHE-002: POST dose → cache syncIdentifier → DELETE with id
TEST-CACHE-003: Cache miss (24hr expiry) → POST same syncIdentifier
TEST-CACHE-004: App restart (cache empty) → POST existing syncIdentifier
TEST-CACHE-005: Batch POST → verify response order → cache mapping

7 new tests validating Loop's ObjectIdCache behavior:
- syncIdentifier → ObjectId mapping
- Response order for batch operations
- Deduplication by syncIdentifier
- Hex string syncIdentifier handling

All 7 tests passing.

Refs: Loop ObjectIdCache.swift analysis

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-10 14:56:01 -07:00
Ben WestandCopilot 4af34767c2 Add GAP-TREAT-012 test suite for Loop override UUID handling
TEST-GAP-001: Loop override POST with UUID _id
TEST-GAP-002: Loop override DELETE by UUID
TEST-GAP-003: Loop override UPDATE by UUID
TEST-GAP-004: Loop override re-POST (upsert)

12 new tests validating REQ-SYNC-072 behavior:
- UUID _id promoted to identifier field
- Server generates valid ObjectId for _id
- Updates/deletes work via identifier lookup
- Duplicate detection via identifier
- Batch and edge case handling

New fixtures:
- loop-override.js: Real Loop override payload patterns

All 12 tests passing.

Refs: GAP-TREAT-012, REQ-SYNC-072

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-10 14:54:00 -07:00
Ben WestandCopilot e78a5bc6e7 fix(treatments): implement REQ-SYNC-072 server-controlled ID with transparent promotion
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>
2026-03-10 13:36:34 -07:00
Andy Low 1231ec6b65 Handle UUID treatment ids in v1 API 2026-03-08 01:01:57 +00:00
Andy Low 505e375efc Fix mmol BG display in OpenAPS tooltips 2026-03-06 23:42:58 +00:00
Andy Low eb105949d4 Enable Traditional Chinese localization 2026-03-06 23:24:50 +00:00
Andy Low 1cab4909ef Fix Spanish translation JSON 2026-03-06 22:29:36 +00:00
Andy Low c77097abd8 Merge remote-tracking branch 'origin/dev' into pr-8421
# Conflicts:
#	package-lock.json
2026-03-06 21:51:52 +00:00
Andy Low faf578c08e Add MongoDB 8 compatibility follow-up fixes 2026-03-06 21:35:16 +00:00
Ben West 13d314119d new dev area for 15.0.7
This initializes development after releasing 15.0.6.
2026-03-03 15:07:43 -08:00
Ben WestandGitHub 9cd304f78a Merge pull request #8442 from nightscout/dev
release for 15.0.6
2026-03-03 14:57:48 -08:00
Ben West 797df9bdda Update bridge deps to 0.2.12/1.5.8
These changes remove shrinkwrap from including dev dependencies for production
use.  This is intended to solve errors in production environments like heroku
incorrectly pulling in darwin based chokidar and related mocha dependencies.
2026-03-03 12:20:47 -08:00
Ben West 6852e550a8 cut new dev for 15.0.6
Post release 15.0.5, we will develop branch for 15.0.6.
2026-03-03 11:32:05 -08:00
Ben WestandGitHub f988ed9869 Merge pull request #8436 from nightscout/dev
Release 15.0.5
2026-03-01 13:17:22 -08:00
Ben WestandGitHub 743506a6a0 Merge pull request #8438 from nightscout/fix/docker-force
Dockerfile: Add --force to bypass platform check
2026-03-01 12:56:59 -08:00
Ben West aa13913093 Dockerfile: Add --force to bypass platform check
npm ci fails with EBADPLATFORM when lockfile contains darwin-only
packages (fsevents), even with --omit=optional. The --force flag
bypasses this check.
2026-03-01 12:53:32 -08:00
Ben WestandGitHub ee2bfa4fe7 Merge pull request #8437 from nightscout/fix/heroku-fsevents
Fix/heroku fsevents
2026-03-01 12:40:30 -08:00
Ben West b8aec4429c CI: Test only Node 20 and 22
Node 16 EOL was September 2023. Docker image uses Node 22.
Reduces CI matrix from 9 to 6 jobs.
2026-03-01 12:30:27 -08:00
Ben West 4130f325c5 Update bridge deps to 0.2.11/1.5.7 (fsevents fix)
Both bridge packages now have clean shrinkwraps without devDependencies,
eliminating the fsevents (darwin-only) entries that caused Heroku build failures.
2026-03-01 12:28:29 -08:00
Ben West ecafd4782c Fix Docker/Heroku builds with --omit=optional
Use npm ci with --omit=optional to skip optional dependencies like
fsevents (darwin-only) that were causing build failures on Linux
platforms including Heroku and local Docker builds on Mac.
2026-03-01 12:25:55 -08:00
Ben West a5ada47d32 first commit to cut new 15.0.5 dev branch 2026-03-01 12:02:54 -08:00
Ben WestandGitHub b03c604643 Merge pull request #8352 from nightscout/dev
release 15.0.4
2026-02-28 09:00:37 -08:00
Ben WestandGitHub 7ae17b13f5 Merge pull request #8433 from nightscout/test/node22-pr
Test/node22 pr
2026-02-27 15:07:57 -08:00
Ben WestandCopilot 0fb628e1c4 Update CI matrix to test Node 16, 20, 22
- Remove lts/* (redundant with explicit versions)
- Add Node 16 for backwards compatibility testing
- Skip Node 18 (flaky tests, will be fixed in MongoDB PR)
- Keep MongoDB 4.4, 5.0, 6.0 matrix

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-27 14:53:30 -08:00
Ben WestandCopilot e0cc9ff5df Relax Node version constraints to >=16.x
- Change engines.node from '^22.x || ^20.x' to '>=16.x'
- Change engines.npm from '>=10.x' to '>=8.x'
- Update runtime checkNodeVersion to allow Node 16+
- Creates overlap with previous release (^16.x || ^14.x)

This allows users on Node 16/18 to upgrade smoothly while
recommending Node 20 or 22 LTS for best support.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-27 14:52:56 -08:00
Ben West 019fa51cff Merge PR #8357 (Node 22 upgrade) 2026-02-27 14:06:32 -08:00
Ben WestandGitHub 535b50e9e0 Merge pull request #8432 from nightscout/wip/bewest/update-bridge-deps
Wip/bewest/update bridge deps
2026-02-27 14:03:03 -08:00
Ben WestandCopilot d81d6854c0 Update bridge dependencies to final deprecated versions
- share2nightscout-bridge: 0.2.9 → 0.2.10 (Node 22 support)
- minimed-connect-to-nightscout: 1.5.5 → 1.5.6 (Node 22 support)

Both packages now allow Node 18/20/22+ in their engines field.
This is a prerequisite for the Node 22 upgrade (PR #8357).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-27 13:36:08 -08:00
Ben WestandCopilot 6a48ea89cf Update bridge dependencies to final deprecated versions
- share2nightscout-bridge: 0.2.9 → 0.2.10 (Node 22 support)
- minimed-connect-to-nightscout: 1.5.5 → 1.5.6 (Node 22 support)

Both packages now allow Node 18/20/22+ in their engines field.
This is a prerequisite for the Node 22 upgrade (PR #8357).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-27 13:16:04 -08:00
Ben West f441d6a6fa ensure AUTH_FAIL_DELAY for ci 2026-01-19 19:07:19 -08:00
Ben West 93945b749e ensure auth tests have a proper delay set
It needs a small delay to test with.
2026-01-19 18:50:11 -08:00
Ben West 7a2d345491 move workflow out of way 2026-01-20 02:40:50 +00:00
bewest 58ad1d7b69 Update project documentation to reflect recent changes
Update replit.md to document new stress test scripts and reorganize test descriptions.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 605cec52-e52a-4520-8af0-466d9c971344
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: dfcb132d-cfe2-469f-8659-b15111592030
Replit-Helium-Checkpoint-Created: true
2026-01-20 02:14:59 +00:00
bewest 6e4ff939f8 Add optional concurrent write stress tests to CI workflow
Updates package.json to include `test:stress` scripts and adds an optional `stress-tests` job to the GitHub Actions CI workflow for concurrent write tests.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 605cec52-e52a-4520-8af0-466d9c971344
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: fde695de-720c-4bfb-b5f1-ea6710172a09
Replit-Helium-Checkpoint-Created: true
2026-01-20 02:14:20 +00:00
bewest ba95c1e054 Transitioned from Plan to Build mode
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 605cec52-e52a-4520-8af0-466d9c971344
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 052f1302-557b-4bfe-a808-973d737e88b1
Replit-Helium-Checkpoint-Created: true
2026-01-20 02:12:03 +00:00
bewest 17d3a74f91 Saved progress at the end of the loop
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 605cec52-e52a-4520-8af0-466d9c971344
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: b141af6b-dc36-41d1-9b8c-70b60b2798e6
Replit-Helium-Checkpoint-Created: true
2026-01-20 02:05:46 +00:00
bewest 82708a5025 Make report tests less brittle by checking for colors instead of exact coordinates
Update tests in `tests/reports.test.js` to assert the presence of specific fill colors for chart elements rather than exact positional coordinates, improving test robustness against minor rendering variations.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 605cec52-e52a-4520-8af0-466d9c971344
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: 293138b2-b045-4ead-a559-d330e00bdd95
Replit-Helium-Checkpoint-Created: true
2026-01-20 02:05:33 +00:00
bewest 6d34a11686 Transitioned from Plan to Build mode
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 605cec52-e52a-4520-8af0-466d9c971344
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 82b98339-21a6-4b84-abd0-071cc5861ef7
Replit-Helium-Checkpoint-Created: true
2026-01-20 02:02:16 +00:00
bewest 27b7f68ba6 Saved progress at the end of the loop
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 605cec52-e52a-4520-8af0-466d9c971344
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: f9cead8e-29fd-4580-8c21-fa2939d21355
Replit-Helium-Checkpoint-Created: true
2026-01-20 01:49:07 +00:00
bewest a55df96d80 Improve security test performance by fixing authorization delay calculation
Fix logic in delay list initialization to correctly handle zero-value settings for authorization failure delays, and update test configurations to leverage this fix.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 605cec52-e52a-4520-8af0-466d9c971344
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: ee25d747-8c3a-444e-8dbf-e0229eee7d31
Replit-Helium-Checkpoint-Created: true
2026-01-20 01:48:56 +00:00
bewest d878f2938f Transitioned from Plan to Build mode
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 605cec52-e52a-4520-8af0-466d9c971344
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 1d9cf633-408c-4a69-afac-a7479a7b88ef
Replit-Helium-Checkpoint-Created: true
2026-01-20 01:46:33 +00:00
bewest a12f7296ee Organize tests for efficient execution and update CI configurations
Adds new npm scripts for unit and integration tests with CI-specific environment configurations, updates the GitHub Actions workflow to use these scripts, and documents the new test organization and environment file usage in replit.md.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 21cb119b-47e0-4582-a80d-cddb4a3bfea7
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: b072dbe3-29e5-41cf-86a1-00bea798d0e3
Replit-Helium-Checkpoint-Created: true
2026-01-20 01:03:40 +00:00
bewest 71c89f40d3 Organize tests for better execution and resource management
Refactors test scripts in package.json to separate unit and integration tests, updates CI environment variables for MongoDB, and modifies GitHub Actions workflow to run unit and integration tests in parallel and serially, respectively, optimizing test execution and resource utilization.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 21cb119b-47e0-4582-a80d-cddb4a3bfea7
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: 8ffc8696-fdef-4ddf-960a-54d03ad00107
Replit-Helium-Checkpoint-Created: true
2026-01-20 01:01:01 +00:00
bewest e07ae6a1b3 Transitioned from Plan to Build mode
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 21cb119b-47e0-4582-a80d-cddb4a3bfea7
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: d840a812-e929-414f-855e-cdada4a576e7
Replit-Helium-Checkpoint-Created: true
2026-01-20 00:48:38 +00:00
bewest 875d8542c1 Improve test stability by increasing MongoDB connection pool size
Update `replit.md` to document the increase of `MONGO_POOL_SIZE` from 2 to 5 in the test environment configuration to enhance stability during parallel test execution.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 271f3cac-bab1-4e81-9982-f31b3b030aab
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 260ef33f-bb92-40d0-82ef-652c94ce7f29
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7ea4278b-5c6c-4065-9cb8-f1013771318d/271f3cac-bab1-4e81-9982-f31b3b030aab/69H2O1r
Replit-Helium-Checkpoint-Created: true
2026-01-19 23:02:42 +00:00
bewest 65170b6b48 Transitioned from Plan to Build mode
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 271f3cac-bab1-4e81-9982-f31b3b030aab
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: e9c0db36-08f4-4782-ab0d-e99bf0fb88ee
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7ea4278b-5c6c-4065-9cb8-f1013771318d/271f3cac-bab1-4e81-9982-f31b3b030aab/69H2O1r
Replit-Helium-Checkpoint-Created: true
2026-01-19 22:50:08 +00:00