fix(transitions): every status transition 500s on an empty guard details - #1941
Merged
rubenvdlinde merged 4 commits intoSep 8, 2026
Conversation
Making a status transition from the UI has been answering 500 since 73c0570. The dialog never closes and the case does not move. This is a user-facing break, not only a test failure. POST /apps/dossiq/api/case/<id>/transition [dossiq] StatusTransitionController: execute failed Property 'evaluatedGuards.0.details' expects object but got empty ({}). For non-required object properties, set this to null to clear the field. GuardRegistry copies each GuardResult verbatim into the snapshot that is persisted as statusRecord.evaluatedGuards, whose details is declared type object. GuardResult::$details defaults to an empty array, and a guard with nothing to report leaves it that way, so the common case is the rejected one. It stayed invisible until the status checklist guard began being appended to every transition. Before that, a transition declaring no guards produced no snapshot entries at all, so there was nothing to reject. Afterwards every transition carried at least entry 0, and StatusTransitionController::execute catches Throwable, so the validation failure surfaced as a 500 rather than as a message anyone could read. Empty details is now written as null, which is what OpenRegister's own error message asks for. Details that a guard does populate are untouched: the unknown-guard branch and every failing guard keep what they reported, or the reason a transition was refused would stop being recorded. Three tests. Two fail without the change and pass with it. The third states the invariant the schema cares about, that no snapshot entry carries an empty details, so a new guard cannot reintroduce this by defaulting the field again. Verified locally: PHPCS clean on lib, and 125 tests in tests/Unit/Service/Transitions pass. One trap worth recording: this app's vendor autoloader resolves OCA\Dossiq to whatever checkout composer installed in, so a first run of these tests silently exercised a sibling checkout's code and reported the fix as ineffective. The run above loads this branch's lib.
rubenvdlinde
requested review from
WilcoLouwerse,
bbrands02 and
rjzondervan
as code owners
September 8, 2026 13:46
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 | ✅ | ✅ 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-08 13:51 UTC
Download the full PDF report from the workflow artifacts.
added 3 commits
September 8, 2026 15:59
…us-transition-500s-on-an-empty-guard-details
CI reported three PHPUnit warnings on this file:
"@uses set" is invalid
The class docblock opened a paragraph with the uses tag followed by the word
"set", to explain why the coverage-metadata list matches GuardDialectTest's.
PHPUnit read that as an annotation carrying the value "set" and rejected it,
on all three tests, and the parser does not care that the tag sat mid-sentence
rather than at the start of a line.
The paragraph now says the same thing without writing a tag name at all, and
records the trap for the next person, since the explanation is worth keeping
and was the thing that broke.
The only at-sign left in the file outside the annotation block is the SPDX
copyright email. Verified by listing every at-sign in the file, and by running
with warnings displayed rather than filtered: 3 tests, 10 assertions, OK, no
warnings.
…us-transition-500s-on-an-empty-guard-details
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 | ✅ | ✅ 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-08 14:21 UTC
Download the full PDF report from the workflow artifacts.
rubenvdlinde
deleted the
fix/every-status-transition-500s-on-an-empty-guard-details
branch
September 8, 2026 15:01
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.
Making a status transition from the UI has been answering 500 since
73c0570e2. The dialog never closes and the case does not move. This is auser-facing break, not only three red E2E tests.
From
nextcloud.logon the failing run, six times:Why
GuardRegistry::evaluateAll()copies eachGuardResultverbatim into thesnapshot that
CaseStatusStorepersists asstatusRecord.evaluatedGuards,whose
detailsis declaredtype: object.GuardResult::$detailsdefaults toan empty array, and a guard with nothing to report leaves it that way, so the
rejected shape is the common one, not an edge case.
It stayed invisible until the status checklist guard began being appended to
every transition. Before that, a transition declaring no guards produced no
snapshot entries at all, so there was nothing to reject. Afterwards every
transition carried at least entry 0.
StatusTransitionController::execute()catches
\Throwable, so a validation failure surfaced as a 500 rather than asa message anyone could read, which is why this reads as a hung dialog.
The fix
Empty
detailsis written asnull, which is what OpenRegister's own errormessage asks for. Details a guard does populate are untouched: the
unknown-guard branch and every failing guard keep what they reported, or the
reason a transition was refused would stop being recorded. There is a control
test for that.
The third test states the invariant the schema actually cares about, that no
snapshot entry carries an empty
details, so a new guard cannot reintroducethis by defaulting the field again.
Verification
One trap worth recording
This app's vendor autoloader maps
OCA\Dossiq\to$baseDir/lib, where$baseDiris whichever checkout composer installed in. A first run of thesetests silently exercised a sibling checkout's code and reported the fix as
ineffective. The numbers above come from a run that loads this branch's
lib/,confirmed by reflecting on the loaded class's file path before running.