fix(demo): the demo import reported the ask, never the landing - #1784
Merged
Conversation
`DemoDataService::install()` counted `components.objects` in the shipped file and returned that number as the import's result. The comment said so outright: "the number reported is the number ASKED FOR". An ask is not an outcome. A descriptor carrying 456 objects reported "456 objects" whether OpenRegister stored 456, three, or none, so the ten demo keys no schema declared (#1782) were stripped on the way in under a green message that could not have said otherwise. Same hollow-green shape as the seed steps of #1767 and #1769, where a step that touched nothing reported success with every counter at zero and recorded itself as done. `ImportHandler::importFromJson()` already answers with both halves: `objects` is the entities it created or updated, `skipped.objects` is the ones it refused. Both are now read from the reply and both are returned, so a caller prints the landing next to the ask, and an import that stored none of what it was given throws instead of returning zeroes. A descriptor that ships no objects at all stays a success: registers and schemas are a legitimate thing to ship on their own. The test fake is part of the fix. It returned `registers` and `schemas` and no `objects` key at all, while the assertion expected five objects — the two only agreed because the service was reading the file. It now answers in the importer's real shape, and the new case that stores three of nine fails red against the old code with "9 is identical to 3".
rubenvdlinde
requested review from
WilcoLouwerse,
bbrands02 and
rjzondervan
as code owners
September 3, 2026 19:06
Contributor
Quality Report — ConductionNL/dossiq @
|
| 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 | ✅ | ✅ 540/540 | |||
| 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-03 19:12 UTC
Download the full PDF report from the workflow artifacts.
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.
The defect
DemoDataService::install()countedcomponents.objectsin the shipped file and returned that number as the import's result. Its own comment said so outright:An ask is not an outcome.
dossiq_mock_register.jsoncarries 456 objects, so the wizard reported "456 objects" whether OpenRegister stored 456, three, or none. The ten demo keys no schema declares (#1782) were stripped on the way in under exactly that green message, and the message could not have said otherwise.This is the same hollow-green shape as the seed steps of #1767 and #1769, where a step that touched nothing reported
success: truewith every counter at zero and recorded itself as done.The fix
ImportHandler::importFromJson()already answers with both halves, and neither was being read:objects— theObjectEntityinstances it created or updatedskipped.objects— the ones it refused, incremented in the per-entitycatch (\Throwable)Both now come from the reply.
install()returnsobjects(landed),requested(the ask),refused,registersandschemas, and the wizard prints "Demo data installed: 456 of 456 objects stored across 143 schemas (0 refused)."An import that stored none of what it was given throws instead of returning zeroes, so it cannot reach the caller in a success shape. A descriptor that ships no objects at all stays a success: registers and schemas are a legitimate thing to ship on their own. A partial import logs a warning naming what was lost, because the counts are the only place the difference is visible.
The test fake was part of the defect
The importer spy returned
registersandschemasand noobjectskey at all, whiletestItImportsTheDescriptorAndReportsTheCountsasserted five objects. The two only agreed because the service was reading the file — a fake written from the call site encodes the caller's bug. It now answers in the importer's real shape.Red first, on the unmodified service:
Six of twelve failed before the change; the new cases cover the count, the refusal count, the zero-landed refusal, an importer reply with no
objectskey, and a descriptor that legitimately ships none.Verified locally
phpunit3018 tests / 19999 assertions green ·phpcsclean on both changedlib/files ·phpmdclean onlib/Serviceandlib/Controller·psalmno errors ·phpstanno errors.🤖 Generated with Claude Code