You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Surfaced while investigating #51. OpenBuilt's `ApplicationsController::provisionPerAppRegister` provisions the per-app register as `openbuilt-{slug}` regardless of caller. OR's register-slug uniqueness is organisation-wide. Net effect: when user B tries to clone a template that user A already cloned (same slug), the register-creation step hits the unique constraint and the API returns 500.
Per REQ-OBT-005 / templates-marketplace spec, different users SHOULD be able to clone the same template under their own ownership.
Options
Namespace register slugs by owner — `openbuilt-{owner}-{slug}`. Simplest, but uglier register names and surfaces UID in OR.
Use UUIDs for register names — `openbuilt-{uuid}`. Opaque but stable; deep-links to OpenRegister still work via API.
Auto-suffix on collision — `openbuilt-{slug}`, `openbuilt-{slug}-2`, ... Sluggable but loses determinism.
The versioned-app model (ADR-002) already uses `openbuilt-{slug}-{tier}` for per-version registers, which would inherit the same problem if two users cloned the same template.
Scope
Update `provisionPerAppRegister` + `provisionPerVersionRegister` (wizard path) to use the chosen naming scheme.
Catch + reformat the unique-constraint failure as a clean 409 with a meaningful error code, regardless of which option is chosen — never bubble a raw DB exception.
Update `MigrateToVersionedModel` to handle the new naming convention.
Update Newman + Postman collections to assert the new behaviour.
Problem
Surfaced while investigating #51. OpenBuilt's `ApplicationsController::provisionPerAppRegister` provisions the per-app register as `openbuilt-{slug}` regardless of caller. OR's register-slug uniqueness is organisation-wide. Net effect: when user B tries to clone a template that user A already cloned (same slug), the register-creation step hits the unique constraint and the API returns 500.
Per REQ-OBT-005 / templates-marketplace spec, different users SHOULD be able to clone the same template under their own ownership.
Options
The versioned-app model (ADR-002) already uses `openbuilt-{slug}-{tier}` for per-version registers, which would inherit the same problem if two users cloned the same template.
Scope
Filed as follow-up to #51 fix (PR #76).