Blocked on jfberry/PoracleNG#217.
ProfileNumbering.ResolveCreated exists because v1's POST /api/profiles/{id}/add answers {"status":"ok"} and withholds the number it just assigned. PoracleNG allocates the lowest free profile number, not max + 1 — with 0, 1, 3 taken the new profile lands at 2 — so the number can't be predicted and has to be discovered by snapshotting the list, creating, re-reading and diffing. Diffing rather than matching on name, because profile names aren't unique. See #407 for what predicting max + 1 did: alarms copied to a profile_no with no profile row, which later adopted whatever profile was eventually created there.
#217 makes the v2 create return the created profile.
Delete
Four call sites, each doing the same snapshot/create/re-read/diff:
ProfileController.Create — ProfileController.cs:170
ProfileController.Duplicate — ProfileController.cs:322
ProfileOverviewController.DuplicateProfile — ProfileOverviewController.cs:74
ProfileOverviewController.ImportProfile — ProfileOverviewController.cs:169
Then Core.Models/Helpers/ProfileNumbering.cs and its tests.
Watch for
The v1 path has to survive. ProfileNumbering goes only when the create actually ran through v2 — a server without the route still needs the diff. Either keep the helper behind the same capability check the rest of the v2 write path uses, or accept a hard 5.2.2 minimum and say so in the release notes.
Update the "Profile Numbering and Rename" section of CLAUDE.md in the same change — it documents this workaround as current.
Blocked on jfberry/PoracleNG#217.
ProfileNumbering.ResolveCreatedexists because v1'sPOST /api/profiles/{id}/addanswers{"status":"ok"}and withholds the number it just assigned. PoracleNG allocates the lowest free profile number, notmax + 1— with 0, 1, 3 taken the new profile lands at 2 — so the number can't be predicted and has to be discovered by snapshotting the list, creating, re-reading and diffing. Diffing rather than matching on name, because profile names aren't unique. See #407 for what predictingmax + 1did: alarms copied to aprofile_nowith no profile row, which later adopted whatever profile was eventually created there.#217 makes the v2 create return the created profile.
Delete
Four call sites, each doing the same snapshot/create/re-read/diff:
ProfileController.Create—ProfileController.cs:170ProfileController.Duplicate—ProfileController.cs:322ProfileOverviewController.DuplicateProfile—ProfileOverviewController.cs:74ProfileOverviewController.ImportProfile—ProfileOverviewController.cs:169Then
Core.Models/Helpers/ProfileNumbering.csand its tests.Watch for
The v1 path has to survive.
ProfileNumberinggoes only when the create actually ran through v2 — a server without the route still needs the diff. Either keep the helper behind the same capability check the rest of the v2 write path uses, or accept a hard 5.2.2 minimum and say so in the release notes.Update the "Profile Numbering and Rename" section of
CLAUDE.mdin the same change — it documents this workaround as current.