Skip to content

fix(demo): give the demo dataset references that resolve - #1814

Merged
rubenvdlinde merged 1 commit into
developmentfrom
fix/demo-references-resolve
Sep 4, 2026
Merged

fix(demo): give the demo dataset references that resolve#1814
rubenvdlinde merged 1 commit into
developmentfrom
fix/demo-references-resolve

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

What was wrong

Every UUID-shaped value in dossiq_mock_register.json was the placeholder 00000000-0000-4000-8000-0000000000NN. All 360 of them. Not one resolved, so every demo case pointed its caseType, status, result and parentCase at nothing.

The dashboard fired a 404 per reference:

404 /apps/openregister/api/objects/dossiq/caseType/00000000-0000-4000-8000-000000000000
404 /apps/openregister/api/objects/dossiq/statusType/00000000-0000-4000-8000-000000000001
...

A demo dataset whose entire job is to show the app working showed it broken: a case with no type and no status.

It went unnoticed because the demo import itself never landed until #1806 and #1808. Nothing had ever read this data, so nothing had ever noticed that none of it points anywhere.

What this does

The objects carry only @self.slug; OpenRegister assigns uuids at import. So:

  1. Every object gets a deterministic @self.id, derived from its slug. ObjectService::extractUuidAndNormalizeObject() reads @self.id and uses it as the target uuid, so the imported object really carries this id. Deterministic, so a re-import updates rather than duplicating.
  2. Each placeholder becomes the id of a real object of the schema the property's own $ref names. The target is read from the schema, never guessed: 342 references, spread deterministically across the objects of the schema each one declares.

The eight properties that declare no $ref

Six are optional, so their placeholder is dropped rather than pointed somewhere invented. A field that is absent is honest; a uuid pointing at nothing is not.

Two are required and still declare no $ref: inspectionChecklistRun.case and .template. Those are resolved from the property name, which is inference rather than declaration, and only because a demo object of that schema exists. The script says so in as many words rather than burying it.

Verification

On a pristine rig with the demo data installed:

dashboard 4xx
before 10, nine of them reference lookups
after 1, a probe for hermiq, which is not installed on this rig
  • ui-pages.spec.ts: 4 passed, including "dashboard mounts without dossiq console errors", the test this defect was failing.
  • demo-data-setup-step.spec.ts: 3 passed.
  • phpunit, vitest, phpcs, phpstan, psalm, lint all exit 0.

Worth knowing

The generator that produced this file is not in the repo, so it will emit placeholders again next time it runs. The durable fix belongs there; this repairs the shipped output.

🤖 Generated with Claude Code

Every UUID-shaped value in the demo set was the placeholder
`00000000-0000-4000-8000-0000000000NN`. All 360 of them. Not one resolved,
so every demo case pointed its caseType, status, result and parentCase at
nothing.

The dashboard fired a 404 per reference:

    404 /apps/openregister/api/objects/dossiq/caseType/00000000-0000-4000-8000-000000000000
    404 /apps/openregister/api/objects/dossiq/statusType/00000000-0000-4000-8000-000000000001
    ...

A demo dataset whose whole job is to show the app working showed it broken:
a case with no type and no status. It went unnoticed because the demo import
itself never landed until #1806 and #1808 fixed it, so nothing had ever read
this data.

The objects carry only `@self.slug`; OpenRegister assigns uuids at import.
So this does two things:

1. Gives every object a DETERMINISTIC `@self.id`, derived from its slug.
   `ObjectService::extractUuidAndNormalizeObject()` reads `@self.id` and uses
   it as the target uuid, so the imported object really carries this id.
   Deterministic, so a re-import updates rather than duplicating.
2. Rewrites each placeholder to the id of a real object of the schema THE
   PROPERTY'S OWN `$ref` NAMES. The target is read from the schema, never
   guessed: 342 references, spread deterministically across the objects of
   the schema each one declares.

Six properties declare no `$ref` and are optional, so their placeholder is
dropped rather than pointed somewhere invented: a field that is absent is
honest, a uuid pointing at nothing is not. Two more are REQUIRED and declare
no `$ref` either, `inspectionChecklistRun.case` and `.template`; those are
resolved from the property name, which is inference rather than declaration,
and only because a demo object of that schema exists. That is called out in
the script rather than hidden.

Verified on a pristine rig, demo data installed:

    before   10 4xx on the dashboard, 9 of them reference lookups
    after     1, a probe for hermiq, which is not installed here

ui-pages.spec.ts 4 passed, including "dashboard mounts without dossiq console
errors", which is the test this defect was failing. demo-data-setup-step 3
passed. PHPUnit and vitest exit 0.
@rubenvdlinde
rubenvdlinde merged commit 2842db2 into development Sep 4, 2026
45 of 46 checks passed
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/dossiq @ af47cc0

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
build
check-manifest
check-vue3-compile
test-l10n
format
check-schema-l10n
check-l10n-js
composer ✅ 106/106
npm ✅ 541/541
app:check-code ⏭️
info.xml
REUSE
PHPUnit
Newman ⏭️
Playwright ⏭️ deferred — runs on the promotion into beta/main, not on a pull request into development
Hydra gates

Quality workflow — 2026-09-04 18:49 UTC

Download the full PDF report from the workflow artifacts.

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.

1 participant