Skip to content

fix(zgw): drop the case read that scoping made unreachable - #677

Merged
rubenvdlinde merged 1 commit into
developmentfrom
fix/drop-the-unreachable-case-branch
Sep 8, 2026
Merged

rubenvdlinde merged 1 commit into
developmentfrom
fix/drop-the-unreachable-case-branch

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Cleaning up after myself

#663 was mine and it was the shallower of two fixes for the same 500. #665 found the real defect: the ZGW listener subscribed on schema slug alone, so this app's whole cascade ran against another app's rows. Teaching the service to read the key dossiq writes only made the wrong thing succeed further, into a register that does not exist on that instance.

#665 left my branch in place with a comment and the decision to me, which was the right call and more courtesy than it owed me. It also named the question to answer first.

Answering that question

whether any producer of a zaakinformatieobject in one of THIS app's registers writes case

It does not. ZaakInformatieObjectenController is the only producer in this app, and validateZioUrls rejects a body without zaak with a 400. The case spelling only ever came from dossiq, whose objects ZGWObjectScopeService now skips before any rule runs.

Why removed rather than left commented

Because it was worse than dead code.

The scope check treats an absent application stamp as ours, deliberately, so hand-built ZGW registers keep working. That is the right call, and it means a foreign row can still arrive wherever a producer stops stamping.

In that situation the case read is actively harmful. It accepts the row and writes an OIO into a register that may not exist. Removing it means the cascade fails there naming the missing property, which reports the scoping bug instead of quietly acting on it. A guard that turns a loud symptom into a silent wrong write is not a guard.

The exception message now says so directly: if a record carries case, it belongs to another app and should not have reached this cascade.

Tests

testCreateObjectInformatieObjectZaakAcceptsTheCaseKey goes with the branch. #665 correctly identified it as the one thing holding it alive, and it called the method directly rather than through the listener, so it asserted nothing about live behaviour.

The neither-key test stays, with its message assertion narrowed to the one spelling. That test is not about dossiq: it stops null reaching a parameter typed string, and it stays true under scoping.

Verified

Check Result
full unit suite 299 tests, exit 0, peak 47 MB
phpcs --standard=phpcs.xml exit 0, 44 pre-existing warnings on untouched lines

🤖 Generated with Claude Code

Cleaning up after myself. #663 was mine and it was the shallower of two fixes
for the same 500. #665 found the real defect: the ZGW listener subscribed on
schema slug alone, so this app's whole cascade ran against another app's rows.
Reading the key dossiq writes only made the wrong thing succeed further, into a
register that does not exist on that instance.

#665 left the branch in place with a comment and the decision to me, and named
the question to answer first: does any producer in THIS app's registers write
`case`? It does not. ZaakInformatieObjectenController is the only producer and
validateZioUrls rejects a body without `zaak` with a 400. The `case` spelling
only ever came from dossiq, whose objects ZGWObjectScopeService now skips.

Removed rather than commented out, because it was worse than dead. The scope
check treats an ABSENT application stamp as ours, deliberately, so hand-built
ZGW registers keep working; a foreign row can therefore still arrive wherever a
producer stops stamping. Accepting `case` there would write an OIO into a
register that may not exist. Failing names the missing property and reports the
scoping bug instead, which is what that situation is.

testCreateObjectInformatieObjectZaakAcceptsTheCaseKey goes with it: #665
correctly identified it as the one thing holding the branch alive, and it called
the method directly rather than through the listener, so it said nothing about
live behaviour. The neither-key test stays, with its message assertion narrowed.

Verified: 299 tests exit 0 at 47 MB, phpcs exit 0.
@rubenvdlinde
rubenvdlinde merged commit 9f0b2fc into development Sep 8, 2026
33 checks passed
@rubenvdlinde
rubenvdlinde deleted the fix/drop-the-unreachable-case-branch branch September 8, 2026 14:57
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/zaakafhandelapp @ 1f53e8c

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ✅
psalm ✅
phpstan ✅
phpmetrics ✅
eslint ✅
stylelint ✅
build ✅
check-manifest ✅
test-l10n ✅
format ✅
composer ✅ ✅ 100/100
npm ✅ ✅ 546/546
app:check-code ⏭️
info.xml ✅
REUSE ❌
PHPUnit ✅
Newman ✅
Playwright ✅
Hydra gates ✅

Quality workflow — 2026-09-08 15:13 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