Admin deadline-rules list: 'upc.apl.cost · undefined' — proceeding name missing in API response or frontend render #113
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
m's report (2026-05-25 16:43)
Looking at admin deadline-rules list:
Diagnosis (head)
DB state is correct:
paliad.proceeding_types(id=19, code='upc.apl.cost', name='Berufungsverfahren Kosten', name_en='Cost-Decision Appeal'). So the proceeding-name is populated.The
undefinedcomes from the frontend rendering${rule.proceeding_code} · ${rule.proceeding_name ?? 'undefined'}— likely the admin list-rules endpoint doesn't include the joinedproceeding_namefield in its response.What to do
frontend/src/admin-*.tsxor whatever path admin lives at). Search forupc.apl.costin code OR for the column headerVerfahrenstyp.internal/handlers/admin_*.goorinternal/handlers/deadline_rules.go).paliad.proceeding_typesexists and returnsname/name_en. If missing, add:LEFT JOIN paliad.proceeding_types pt ON pt.id = dr.proceeding_type_id+ selectpt.name AS proceeding_name,pt.name_en AS proceeding_name_en.proceeding_namevsproceedingName).'undefined'fallback with empty-string OR a small placeholder dash. NEVER render the string "undefined" — that's a code smell that bites every time data is missing.Files most likely touched
internal/handlers/admin_deadline_rules.go(or wherever admin list endpoint is)frontend/src/admin-procedural-events.tsx(post-cronus #93 rename; oradmin-deadline-rules.tsx)frontend/src/client/admin-procedural-events.ts'undefined'fallbackHard rules
go build ./... && go test ./internal/... && cd frontend && bun run buildclean.mai/<worker>/admin-proceeding-name-join.Out of scope
Reporting
mai report completedwith branch + SHAs + diagnosed root cause (which side was missing the join / which fallback rendered 'undefined') + UX verification.Root cause — frontend TS interface mismatch, not a missing SQL JOIN
The
undefinedwas rendered client-side. The admin rules list does two parallel fetches —/admin/api/rulesfor rules and/api/proceeding-types-db?category=fristenrechnerfor proceeding types — and joins them in JS viaproceedingLabel(r.proceeding_type_id). The lookup did find the rightProceedingTyperow; it just read the wrong field name.Wire format (Go
models.ProceedingType,internal/models/models.go:728):TS interface (
frontend/src/client/admin-rules-list.ts:32,admin-rules-edit.ts:54):So
pt.name_dewasundefinedfor every row, and`${pt.code} · ${pt.name_de}`stringified toupc.apl.cost · undefined.Why m's hypothesis (missing JOIN) was close but not quite
The data flow is the other way: the rules endpoint deliberately does not join
proceeding_types.name— the frontend already loads the full proceeding list separately to power the filter<select>, so a join in the list endpoint would be redundant. The bug was in how the JS consumed that already-loaded list.Fix
frontend/src/client/admin-rules-list.ts+frontend/src/client/admin-rules-edit.ts:ProceedingType.name_de→nameto match the wire contract (with a comment pinning the JSON shape so nobody flips it back).proceedingLabel()/ the proceeding-select loops: if the active-language name is falsy, render just the code (upc.apl.cost) instead ofupc.apl.cost ·(or, in the old code,upc.apl.cost · undefined). The literal string"undefined"is exactly the smell that surfaced this bug, so the guard makes future field-name drift visible as a missing suffix rather than a poison-looking value.Audit of other admin lists /
/api/proceeding-types-dbconsumersAll other callers were already correct — they read
pt.name:frontend/src/client/deadlines-detail.tsfrontend/src/client/deadlines-new.tsfrontend/src/client/project-form.tsfrontend/src/client/fristenrechner.tsThe
TriggerEvent.name_defield is a separate model (internal/models/models.go:752) that genuinely serialisesname_de— those usages are untouched.No shared render helper exists for proceeding labels yet; the two admin files were fixed at site. Extracting a helper would be premature with only two callers, but the JSDoc comments now flag the wire contract on both interfaces.
Verification
go build ./...cleango test ./internal/...all greencd frontend && bun run buildcleanname_dereference inadmin-rules-list.js/admin-rules-edit.jsis the TriggerEvent select loop (legitimate — that field exists)UX verification on a running paliad server is gated behind
DATABASE_URL+ Supabase creds which aren't available in this worktree; the fix is a pure field-name change against a known-correct wire format, so the path is straightforward. Once deployed, the admin rules list will render e.g.upc.apl.cost · Berufungsverfahren Kosteninstead ofupc.apl.cost · undefined.Branch / commit
mai/hermes/gitster-admin-rules-list001542aNot opening a PR — head merges per project convention.
Sweep verdict (2026-07-29): ALREADY DONE.
proceeding_nameis joined server-side (internal/handlers/deadline_rules_db.go:109), andfrontend/src/client/admin-rules-list.ts:134-137carries the fix with a comment naming this exact symptom — "Show the code on its own rather than `code · undefined`". No'undefined'string literal remains anywhere underfrontend/src/.Full sweep:
docs/findings-issue-sweep-2026-07-29.md(commit4c39886).