GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(admin): surface agency-assignment errors instead of silent success by kiodreambau · Pull Request #258 · OpenResilienceInitiative/ORISO-Admin

Conversation

@kiodreambau

@kiodreambau kiodreambau commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Problem

When creating/editing a consultant, a rejected agency assignment was invisible: the backend swallowed validation failures (returned 200) and the frontend used a generic catch-all toast at best. During the Caritas demo on 2026-07-08 the admin picked topic Eltern und Familie (id 10) and an agency that offered no such topic — the UI reported success while nothing was persisted.

Changes

  1. Client-side coverage check — mirrors the backend ADR-003 rule (ConsultantTopicAgencyCompatibilityValidator): every selected topic must be offered by at least one selected agency. On mismatch we set an antd field error on the topics field naming the offending topics and block submit, so the user fixes it before any request is sent. Logic is extracted into a pure, unit-tested util utils/topicAgencyCoverage.ts.
  2. putAgenciesForCounselor now rejects with the raw Response (BAD_REQUEST_WITH_RESPONSE + CATCH_ALL_SILENT) instead of firing a generic CATCH_ALL toast. The consultant mutation's existing onError → extractApiErrorMessage then surfaces the backend's specific message (e.g. topic ids [10] are not covered by ... agencies [272]) for anything that slips past the client-side check.
  3. New i18n key message.error.topicsNotCoveredByAgencies (de/en).

Scope note

Agency-admin assignment (putAgenciesForAgencyAdmin) is intentionally left non-blocking: CreateAdminAgencyRelationDTO carries no topics, so it never hits the topic validator, and the account is created before the (secondary) agency step. It already shows a warning toast on failure via the existing agencyAssignmentFailed flag.

Verification

  • tsc --noEmit, eslint, prettier --check — all clean.
  • vitest run src/utils/topicAgencyCoverage.test.ts — 6/6 green (covers the demo mismatch, full coverage, unselected-agency, no-agency, and mixed string/number id cases).
  • Driving the full form flow needs a logged-in dev session (DNS/CA + Keycloak), so it was not exercised in a browser; the coverage logic is pure and unit-tested instead.

Related

  • Backend counterpart: fix(userservice): propagate agency-assignment errors instead of swallowing them ORISO-UserService#343 (stops swallowing the error, returns 400).

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sentry[bot] reacted with hooray emoji
All reactions
  • 🎉 1 reaction
@kiodreambau @claude
fix(admin): surface agency-assignment errors instead of silent success
c048a17
When creating/editing a consultant, a rejected agency assignment used to be
invisible: the backend swallowed validation failures (returning 200) and the
frontend showed a generic toast at best. Two changes:

- Client-side coverage check (mirrors ADR-003
  ConsultantTopicAgencyCompatibilityValidator): every selected topic must be
  offered by at least one selected agency. On mismatch we set an antd field
  error on the topics field naming the offending topics and block submit, so
  the user fixes it before any request goes out. Logic extracted to a pure,
  unit-tested util (utils/topicAgencyCoverage.ts).
- putAgenciesForCounselor now rejects with the raw Response
  (BAD_REQUEST_WITH_RESPONSE + CATCH_ALL_SILENT) instead of showing a generic
  CATCH_ALL toast, so the mutation's onError surfaces the backend's specific
  message via extractApiErrorMessage (e.g. topic/agency mismatch that slipped
  past the client-side check).

New i18n key message.error.topicsNotCoveredByAgencies (de/en).

Verified: tsc, eslint, prettier, vitest (topicAgencyCoverage 6/6). Full form
flow needs a logged-in dev session and was not driven in a browser.

Co-Authored-By: Claude Fable 5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • coderabbit

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: ed3e15d4-04fc-4d94-a91e-091c735dd9be

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/surface-agency-assignment-errors

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

@coderabbitai review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Storypapst
Storypapst merged commit abd3998 into dev Jul 8, 2026
6 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@Storypapst
Storypapst deleted the fix/surface-agency-assignment-errors branch July 8, 2026 10:05
@kiodreambau kiodreambau mentioned this pull request Jul 8, 2026
[Epic] Harden consultant lifecycle & deploy safety (stop inconsistent-state bugs) OpenResilienceInitiative/ORISO-UserService#351
Closed
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@kiodreambau @Storypapst
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.