Skip to content

Preserve single errors through Combine; mint validation failures as validation errors#324

Merged
Vulthil merged 1 commit into
mainfrom
fix/results-error-semantics
Jul 19, 2026
Merged

Preserve single errors through Combine; mint validation failures as validation errors#324
Vulthil merged 1 commit into
mainfrom
fix/results-error-semantics

Conversation

@Vulthil

@Vulthil Vulthil commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Combine now matches Zip: a single failed result's original error propagates unwrapped; only 2+ failures aggregate into a ValidationError. Previously even one failure was wrapped, turning e.g. a NotFound into a 400-mapped validation error downstream.
  • ValidationPipelineBehavior now mints inner validation errors via Error.Validation instead of the unrelated Error.Problem factory (which had zero other src usage and a copy-pasted XML summary, now fixed).
  • Documented the Combine/Zip aggregation rule once in docs/articles/result-pattern.md, gave the ErrorType enum real member docs (with HTTP-mapping intent, coordinated with the parallel Vulthil.SharedKernel.Api mapping work), and documented three sharp edges prominently (implicit null → Result<T> failure, reference-only equality, and the Error.None invariant).
  • Widened the Result constructor's Error.None invariant check from value- to reference-equality, so a custom error that merely looks like Error.None (same empty code/description) can be used as a real failure error.

Verification

  • Re-verified all findings against current main before changing anything.
  • New/changed Combine tests confirmed to fail on unfixed main, then pass after the fix.
  • Full solution build clean; Vulthil.Results.Tests 197/197, Vulthil.SharedKernel.Application.Tests 26/26.
  • PublicAPI.Shipped/Unshipped.txt untouched — no public signature changes.

Test plan

  • dotnet build Vulthil.SharedKernel.slnx — 0 warnings, 0 errors
  • Vulthil.Results.Tests (net10.0) — 197/197 passed
  • Vulthil.SharedKernel.Application.Tests (net10.0) — 26/26 passed
  • Confirmed new Combine expectations fail on unfixed main (reverted src/, reran, restored)

Backport to v1.0: no — behavioral semantics changes are minor-appropriate; ships in 1.1.0.

@claude

claude Bot commented Jul 19, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@Vulthil
Vulthil merged commit 5b45c07 into main Jul 19, 2026
6 checks passed
@Vulthil
Vulthil deleted the fix/results-error-semantics branch July 19, 2026 11:46
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