Files
Ben WestandCopilot c927be7a0d Revert "fix(api3): dedup AAPS profile-store edits via REST POST /v3/profile"
This reverts commit 3b786ab3.

On review the V3 (app, defaultProfile) collapse was too aggressive and
broke parity with how the rest of the ecosystem treats the profile
collection:

- Loop (NightscoutKit) and Trio (NightscoutAPI.swift:411) both POST
  /api/v1/profile without _id on every settings edit, accumulating one
  doc per upload via lib/server/profile.js:create(). They have done so
  for years.
- The Nightscout profile collection is historical/append-only by
  design; the NS UI profile editor lets users navigate prior
  snapshots, and lib/server/profile.js:last() picks the most recent
  for display.
- Collapsing AAPS V3 edits onto a single (app, defaultProfile) row
  diverged from Loop/Trio/AAPS-V1 behavior and erased the upload
  history that NS UI exposes.

The original 'AAPS edits not appearing' user complaint is sufficiently
addressed by:
  - the V1 websocket retry dedup (commit 85f7e6ac), which kills the
    60s ack-window race; and
  - the {startDate: -1, _id: -1} secondary sort in profile.last()
    (also 85f7e6ac), which deterministically picks the newest row
    when startDate ties.

Both of those help every uploader (Loop, Trio, AAPS V1, AAPS V3)
without changing the ecosystem-wide profile-as-history semantic. The
characterization tests added in ddabdc6c are restored by this revert
and continue to document V3's request-level (date-based) dedup.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-20 17:49:43 -07:00
..
2026-04-19 23:24:22 +01:00
2023-06-28 14:32:55 +03:00
2026-04-19 23:24:22 +01:00
2023-01-27 08:07:29 -08:00
2021-02-18 18:10:50 +02:00
2020-01-06 11:08:05 +02:00