Gateway, mapping and pipeline defect patterns¶
This page lists defects that recur on the path a request takes through ConnectSoft services: from the client through the API gateway and its view models, into the service and its mapping profiles, out to other services, and back. Each pattern names the symptom, the cause, what to look for in a review, and the test that catches it. The rules these patterns break are mostly on the API contracts standard, the object mapping standard and the configuration and options standard.
A request usually crosses several hops, and each hop can drop, default or reinterpret a value without an error. A unit test of one hop is green while the end-to-end result is wrong, so most patterns here need one test across the real path.
Fields across mapping hops¶
CS-DP-API-001: Null-means-keep collection is emptied at a second mapping hop¶
Severity: blocker · Applies to: service, template · Enforced by: manual · Status: active
Symptom¶
The gateway fix and its unit tests are green, but end to end a request that means "keep the collection" still clears it.
Cause¶
The mapper turns a null source collection into an empty one by default. The request crosses the gateway profile and the service profile, and only one of them keeps null.
Check¶
Every mapping profile on the request path for a collection whose null value means "keep".
Test¶
- A guard test per profile, over all type maps, for members with null semantics.
- One end-to-end test with a populated fixture that sends null and asserts the collection is unchanged.
Related rules¶
CS-DP-API-002: Refusal reason is computed but not copied to the response¶
Severity: major · Applies to: service, template · Enforced by: manual · Status: active
Symptom¶
The server blocks an action correctly, but the screen cannot say which prerequisite is missing.
Cause¶
The domain result carries the missing items, but the controller builds the response by hand and never copies that property.
Check¶
New properties on domain read models are present on the response contract, the gateway model and the client view model.
Test¶
A controller or contract test asserts that the property is on the wire for a blocked record.
Related rules¶
CS-DP-API-003: New output field dropped at the wire view model¶
Severity: major · Applies to: service, template · Enforced by: manual · Status: active
Symptom¶
A new field is correct in every layer, and the UI column stays empty with nothing logged.
Cause¶
Responses are serialized from a separate view model mapped by convention. A source member with no destination is dropped silently, and the unmapped-member test checks only destination members. The reverse case, a server-stamped input field, needs an explicit ignore, not a global "allow unmapped members" setting.
Check¶
- A field added to a use-case output or input without the matching view model or request model change.
- Any global switch that allows unmapped members.
Test¶
- Map the output to the view model and assert the new field survives.
- A contract test of the API response asserts the field.
Related rules¶
CS-API-008, CS-MAP-003, CS-MAP-005, CS-API-009
CS-DP-API-004: Edit through a lossy display model wipes fields on a full-replace update¶
Severity: blocker · Applies to: service, blazor, template · Enforced by: manual · Status: active
Symptom¶
Saving a small edit, such as ending an order line, clears other fields of the record.
Cause¶
The update assigns every column from the request, and the editor builds the request from a display model that rounds values, holds placeholders or does not map some fields. CS-DP-UI-003 describes the same loss from the edit form.
Check¶
- An edit path built on a view model with formatted or missing fields.
- A quick action that sends a partial payload to a full-replace endpoint.
Test¶
An unchanged save through the real API round-trips every field it did not touch.
Related rules¶
CS-API-007, CS-UI-009, CS-API-008
CS-DP-API-005: Service sends an enumeration's display name where the contract declares a code¶
Severity: minor · Applies to: service · Enforced by: manual · Status: active
Symptom¶
A coded column shows untranslated text, although the lookup wiring is correct.
Cause¶
The service fills the column with the enumeration's long display name instead of the code the declared vocabulary holds. The lookup miss falls back to the raw value, so nothing looks broken.
Check¶
Report or response fields declared as coded that are filled from a display-name property instead of the code.
Test¶
A probe test checks, for every column with a declared lookup, that each distinct returned value is a key of that vocabulary.
Related rules¶
Contracts and consumers¶
CS-DP-API-006: Consumer pinned to an old contract breaks on a new enum member¶
Severity: major · Applies to: service, api-client · Enforced by: manual · Status: active
Symptom¶
Days after the producer shipped, a downstream report answers 500 with "The JSON value could not be converted to" the enum type.
Cause¶
The consumer deserializes a response whose property has the enum type, so it depends on the enum without naming it. A search for consumers by the enum's name finds nothing, and empty test data hides the break until a row carries the new value.
Check¶
An enum member added to a contract package without a list of every project that deserializes a contract carrying it.
Test¶
A contract test in each consumer deserializes a response that contains every enum member.
Related rules¶
CS-DP-API-007: Command addresses the parent when it changes one of several children¶
Severity: major · Applies to: service · Enforced by: manual · Status: active
Symptom¶
On an order with several shipments, a follow-up step fails with 409 about the other shipment, or the action lands on an arbitrary one.
Cause¶
The command contract names only the parent id, so the service picks a child.
Check¶
Commands that change a child's state but carry only the parent id, where the parent can hold several children.
Test¶
Seed a parent with two children and assert that each command changes exactly the targeted child.
Related rules¶
CS-DP-API-008: Collection query parameter is sent joined¶
Severity: major · Applies to: service, api-client, blazor · Enforced by: manual · Status: active
Symptom¶
A multi-value filter returns nothing.
Cause¶
The caller sends codes=a,b as one value, and model binding produces one string that matches no row.
Check¶
Query strings built by hand for list parameters.
Test¶
- A client test asserts repeated parameters (
codes=a&codes=b). - An API test binds two values.
Related rules¶
CS-DP-API-009: Offered filter that the source ignores empties the result¶
Severity: major · Applies to: service, blazor · Enforced by: manual · Status: active
Symptom¶
Every option of a filter returns zero rows for a report that has data.
Cause¶
The report catalogue declares the filter and forwards the parameter, but the owning service has no selector for that field and compares it with null on every row.
Check¶
A filter declared on a report that declares no matching column. A report that cannot show a value cannot filter by it.
Test¶
- A catalogue invariant test asserts that each filter has its column.
- A probe asserts that each filter option narrows the total and that the complementary option returns the rest.
Related rules¶
CS-DP-API-010: Caller removes its compensating check before the downstream enforces it¶
Severity: blocker · Applies to: service · Enforced by: manual · Status: active
Symptom¶
After a contract change, a filter returns rows it used to exclude.
Cause¶
The gateway deleted its own filtering and forwarded a new query parameter, but the running downstream service predates the parameter and ignores it.
Check¶
A change that deletes a compensating filter in the same release that adds the downstream parameter.
Test¶
An end-to-end smoke test of the filter's partition against the deployed downstream service.
Related rules¶
CS-DP-API-011: A limit is duplicated across layers, and raising one leaves another refusing¶
Severity: minor · Applies to: service, blazor, api-client · Enforced by: manual · Status: active
Symptom¶
After a page size is raised, the read still fails with 400 from a downstream validator, or returns fewer rows than asked for.
Cause¶
The same bound lives in the client constant, a [Range] on the gateway view model, the gateway validator, the shared contract package and the service's own validator. An options clamp elsewhere returns fewer rows without an error.
Check¶
When a limit changes, every [Range], InclusiveBetween and options clamp on that field in the client, the gateway, the contract and the service.
Test¶
An acceptance test requests the new maximum through the gateway and asserts a full page.
Related rules¶
CS-DP-API-012: Parallel copies of one rule diverge when only one is fixed¶
Severity: major · Applies to: service, blazor · Enforced by: manual · Status: active
Symptom¶
A fix verified on one screen is missing on another screen that shows the same fact, or one page shows two numbers for one fact.
Cause¶
The same rule, such as a translation, a count, a scope or a date format, is computed in several places, and the fix and its verification touched one copy.
Check¶
When fixing a rule, search for its literals and shape across the solution. Collapse the copies into one function, or bind them with a shared test.
Test¶
One shared test fixture runs against every implementation.
Related rules¶
CS-DP-API-013: Helper that nothing calls is a feature wired to nothing¶
Severity: major · Applies to: service, library, blazor · Enforced by: manual · Status: active
Symptom¶
An enriched column is empty on every row, or a documented safety wait never happens, although a documented private method exists to do it.
Cause¶
The method was written, documented and given error handling, but never called. The unused-member warning is buried among hundreds of others.
Check¶
- Unused private member warnings (
S1144,IDE0051) in the change. - A private method whose name appears only at its declaration.
Test¶
A use-case test with a test double that can succeed asserts the enriched field or the waited-for state.
Related rules¶
Paged reads¶
CS-DP-API-014: Paged read is treated as complete¶
Severity: major · Applies to: service, api-client, blazor · Enforced by: manual · Status: active
Symptom¶
Totals or exclusion lists are silently partial.
Cause¶
A walk stops on a page shorter than requested, which a server that clamps the page size always returns. Or a call relies on a paged endpoint's default page size as if it returned the full set.
Check¶
- Loops over paged endpoints stop on the total count and have a no-progress guard.
- Calls used as a full set pass an explicit page size and walk all pages.
Test¶
Against a fake server that clamps the page size, assert that the walk collects every row.
Related rules¶
CS-DP-API-015: Join against one page of a paged search¶
Severity: major · Applies to: blazor, service, api-client · Enforced by: manual · Status: active
Symptom¶
Lookups work in demos and break as data grows: the signed-in user or an owner name is missing.
Cause¶
The client joins against a search that silently defaults to a page size of 20.
Check¶
Lookup or join code that calls a paged search without an explicit page size or a paging loop.
Test¶
With more rows than the default page size, assert that the join still resolves the last row.
Related rules¶
Calls to other services¶
CS-DP-API-016: GetFromJsonAsync discards the downstream refusal¶
Severity: major · Applies to: service · Enforced by: manual · Status: active
Symptom¶
A downstream 4xx with a clear reason reaches the client as a generic failure.
Cause¶
GetFromJsonAsync calls EnsureSuccessStatusCode() before it reads the body, so the refusal details are thrown away and the shared response guard is bypassed.
Check¶
GetFromJsonAsync or similar helpers on calls to internal services where a refusal must be passed through.
Test¶
With a stubbed downstream 4xx body, assert that the caller receives the downstream status and reason.
Related rules¶
CS-API-013, CS-API-005, CS-ERR-005
CS-DP-API-017: Delegating handler consumes the response body it inspects¶
Severity: major · Applies to: service, library · Enforced by: manual · Status: active
Symptom¶
A 403 from a downstream service reaches the user as "service unavailable".
Cause¶
A DelegatingHandler reads the body with a size cap to inspect it. The cap throws after the stream has been consumed, the handler swallows the exception, and the caller then fails because the stream is already consumed.
Check¶
A handler that reads response.Content without leaving it readable, or that catches its own read failure.
Test¶
A handler test with a forward-only StreamContent larger than any cap asserts that the caller can still read the body. Confirm that the test fails with the fix reverted.
Related rules¶
CS-DP-API-018: Refusal message leaks another user's identifier to the client¶
Severity: blocker · Applies to: service · Enforced by: manual · Status: active
Symptom¶
A refused write returns problem details whose detail names another user's id.
Cause¶
A fault message written as a server-side diagnostic is mapped word for word to the client-visible detail field.
Check¶
Fault or exception messages that include record owners or other people's ids on a path that the boundary maps to the response.
Test¶
An API test of the refused write asserts that the response body contains no id other than the caller's own input.
Related rules¶
CS-ERR-005, CS-LOG-005, CS-AUZ-004
CS-DP-API-019: Middleware calls another service before header propagation opens¶
Severity: major · Applies to: service, template · Enforced by: manual · Status: active
Symptom¶
Every request through a new middleware returns 500, often hidden by a fallback in the UI.
Cause¶
The header-propagation handler on the outgoing client throws when the propagation middleware has not run for the request, and the middleware that makes the call is registered before it.
Check¶
- Middleware that uses a named
HttpClientand is placed beforeUseHeaderPropagation(). - Propagation opened before a middleware that strips untrusted headers.
Test¶
A test-host request through the middleware asserts success and the propagated header downstream.
Related rules¶
Configuration and registration¶
CS-DP-API-020: Required options section missing from a standalone settings variant¶
Severity: major · Applies to: service, template · Enforced by: manual · Status: active
Symptom¶
After a new required option is added, every acceptance scenario fails at host construction with a configuration binding exception.
Cause¶
The application layers environment files over a base file, but the acceptance host clears the sources and loads one file alone. A section added only to the base file is missing there.
Check¶
A new options section validated on start that is added to fewer settings files than the hosts that load them.
Test¶
A parity test registers the options against each settings variant, loaded the way its own host loads it.
Related rules¶
CS-CFG-007, CS-CFG-001, CS-VAL-009, CS-MSG-004
CS-DP-API-021: Second registration call is dropped by TryAdd of an options instance¶
Severity: major · Applies to: service, library · Enforced by: manual · Status: active
Symptom¶
Mapping profiles from the extending assembly do not apply, and fields whose names differ arrive empty.
Cause¶
The registration helper adds its options as a singleton instance with TryAdd. The base project registers first, and the extending project's later call is ignored without an error.
Check¶
A second call to a library Add... registration method in an extending project.
Test¶
Resolve the options through the real registration path and assert that the extending assembly is in the scan list.
Related rules¶
CS-DP-API-022: Bound array option with a default initializer doubles its values¶
Severity: major · Applies to: service, library, template · Enforced by: manual · Status: active
Symptom¶
An option list holds each configured entry twice, which causes duplicate rows or duplicate registrations.
Cause¶
The configuration binder appends to an existing array, so a field initializer plus the same values in settings yields both. Marking the property required does not stop it.
Check¶
Options properties of array or list type with a non-empty initializer.
Test¶
A binding test with the shipped settings asserts the exact list.
Related rules¶
CS-DP-API-023: Overlay settings file cannot shorten a base array¶
Severity: major · Applies to: service, template · Enforced by: manual · Status: active
Symptom¶
In one environment, logs go to a sink twice, or a sink that was removed keeps running.
Cause¶
Array entries are indexed keys. An overlay with fewer entries overrides the first slots, and the base file's remaining entries survive.
Check¶
An overlay array shorter than the base array at the same key path, including entries nested inside wrapper sinks.
Test¶
A test builds the real layered configuration and asserts the effective array for each environment.