fix(schema-designer): save and delete by numeric id; un-quarantine the e2e suite - #44
Merged
Merged
Conversation
…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".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OpenRegister's schema API is read-by-slug but write-by-id. Verified against the live API for one schema:
GET /api/schemas/{slug}PUT /api/schemas/{slug}PUT /api/schemas/{uuid}PUT /api/schemas/{numericId}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.specis 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}, titleMessage 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
NcActionsmenu, 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 baremessagealso matches…-hello-message.🤖 Generated with Claude Code