fix(tabs): keep the case-default GET read-only, forget a stale id outside the rollback

Merge-time fix for #676 (review nits 4 and 5). sessionCreated forgot a stale
case default inside the try whose catch rolls the registration back; it now
does so after the try, once the session is committed, so the cleanup can
never drop a committed session from the live map. caseDefaultGroup (behind
GET /api/cases/:name/default-group) no longer deletes a stale id as a side
effect: it reports Ungrouped and leaves the value for the next creation to
forget. The two tests that expected the read to clear it now expect it to
write nothing; the creation test still pins the cleanup.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer committed 2026-10-22 19:31:21 +02:00
1 parent 3ca1d4832e
commit a3efc9b963
5 files changed
+23 -18

No files matched your search

+2 -1
View File
@@ -783,7 +783,8 @@ non-string) is a `400 INVALID_INPUT`. Requests without the field are unchanged.
- `GET /api/v1/cases/:name/default-group` → `{ caseName, groupId, groups }`: `groupId` is a
group id from the caller's own tab layout or `null` (Ungrouped), `groups` the caller's
current named groups (`{ id, name }`, in layout order). A stored id whose group was
deleted reads back as `null` and is forgotten.
deleted reads back as `null` (the read changes nothing; the next session created for the
case forgets it).
- `PUT /api/v1/cases/:name/default-group` with `{ "groupId": string | null }` saves it. An
id not in the caller's layout is a `400 INVALID_INPUT` that leaves the old value in place.