Skip to content

fix(schema-designer): save and delete by numeric id; un-quarantine the e2e suite - #44

Merged
rubenvdlinde merged 1 commit into
developmentfrom
wip/schema-write-by-id
Jul 27, 2026
Merged

fix(schema-designer): save and delete by numeric id; un-quarantine the e2e suite#44
rubenvdlinde merged 1 commit into
developmentfrom
wip/schema-write-by-id

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

OpenRegister's schema API is read-by-slug but write-by-id. Verified against the live API for one schema:

request result
GET /api/schemas/{slug} 200
PUT /api/schemas/{slug} 404 "Schema not found"
PUT /api/schemas/{uuid} 404
PUT /api/schemas/{numericId} 200

The designer sent the route slug as the write id, so every save 404'd and every delete silently no-op'd — the success toast fired while nothing persisted. Nothing done in the schema designer (fields, lifecycle, relations, access, title) ever reached OpenRegister. save() now writes with the persisted numeric id; deleteSchema() resolves the id from the list row it was handed. Both fall back to the slug so an unlisted schema still attempts the call.

openbuild#41 is now fully closed and schema-designer.spec is un-quarantined — green twice consecutively against the live instance: create app → add schema → add 2 fields → save → reload (fields persist) → edit title → save → delete. Confirmed in the DB after a run: properties {subject, body}, title Message v2, and the schema gone after delete (the suite is self-cleaning again).

Spec-side the delete step now drives the real UI: Delete lives in the row's collapsed NcActions menu, and REQ-OBSD-008 gates the confirm button until the exact slug is typed — neither of which the spec did. Row matching uses the full namespaced slug, since a bare message also matches …-hello-message.

🤖 Generated with Claude Code

…e e2e suite

OpenRegister's schema API is READ-BY-SLUG but WRITE-BY-ID. Verified against the
live API for the same schema:

  GET    /api/schemas/{slug}       200
  PUT    /api/schemas/{slug}       404 "Schema not found"
  PUT    /api/schemas/{uuid}       404 "Schema not found"
  PUT    /api/schemas/{numericId}  200

The designer sent the route slug as the write id, so EVERY save 404'd and every
delete silently no-op'd — the success toast fired while nothing was persisted.
Nothing you did in the schema designer (fields, lifecycle, relations, access,
title) ever reached OpenRegister. save() now writes with the persisted numeric
id, and deleteSchema() resolves the id from the list row it was handed, each
falling back to the slug so an unlisted schema still attempts the call.

With this, openbuild#41 is fully closed and schema-designer.spec is
UN-QUARANTINED: green twice consecutively against the live instance, covering
create app -> add schema -> add 2 fields -> save -> reload (fields persist) ->
edit title -> save -> delete. Verified in the DB after a run: properties
{subject, body} and title "Message v2" persisted, and the schema is gone after
the delete step (the suite is self-cleaning again).

Spec-side, the delete step now drives the real UI: Delete lives in the row's
collapsed NcActions menu, and REQ-OBSD-008 gates the confirm button until the
exact slug is typed — neither of which the spec did. Row matching also uses the
full namespaced slug, since a bare "message" also matches "...-hello-message".
@rubenvdlinde
rubenvdlinde merged commit 0335b59 into development Jul 27, 2026
@rubenvdlinde
rubenvdlinde deleted the wip/schema-write-by-id branch July 27, 2026 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants