Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.
This repository was archived by the owner on May 29, 2026. It is now read-only.

Architectural: OR register slugs are org-wide unique, breaking cross-user template clones #77

Description

@rubenvdlinde

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

  1. Namespace register slugs by owner — `openbuilt-{owner}-{slug}`. Simplest, but uglier register names and surfaces UID in OR.
  2. Use UUIDs for register names — `openbuilt-{uuid}`. Opaque but stable; deep-links to OpenRegister still work via API.
  3. 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.

Filed as follow-up to #51 fix (PR #76).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions