Skip to content

Guards fix#12

Merged
DirtyNative merged 1 commit intodevelopfrom
feature/guards-fix
Apr 1, 2026
Merged

Guards fix#12
DirtyNative merged 1 commit intodevelopfrom
feature/guards-fix

Conversation

@DirtyNative
Copy link
Copy Markdown
Member

Added

  • Railway.Create() — two-phase builder factory that enforces a clear separation between the guard/validation phase and the step execution phase at the type-system level
    • Railway.Create(factory, selector, guards, steps) — with guards
    • Railway.Create(factory, selector, steps) — without guards (convenience overload)
    • Parameterless variants (Func<TPayload> factory) for railways with no request input
    • New RailwayGuardBuilder<...> — only exposes Guard() and Validate()
    • New RailwayStepsBuilder<...> — only exposes Do(), DoIf(), DoAll(), Group(), WithContext(), Detach(), Parallel(), ParallelDetached(), Finally(), and Build()

Fixed

  • Registration-order bug: Group(), WithContext(), Detach(), Parallel(), and ParallelDetached() steps now execute in the exact order they were registered, interleaved correctly with Do() steps. Previously all Do() steps ran before all feature steps regardless of registration order.

Deprecated

  • RailwayBuilder<TRequest, TPayload, TSuccess, TError> — use Railway.Create() instead
  • RailwayBuilderFactory — use Railway.Create() instead

### Added

- **`Railway.Create()` — two-phase builder factory** that enforces a clear separation between the
  guard/validation phase and the step execution phase at the type-system level
  - `Railway.Create(factory, selector, guards, steps)` — with guards
  - `Railway.Create(factory, selector, steps)` — without guards (convenience overload)
  - Parameterless variants (`Func<TPayload>` factory) for railways with no request input
  - New `RailwayGuardBuilder<...>` — only exposes `Guard()` and `Validate()`
  - New `RailwayStepsBuilder<...>` — only exposes `Do()`, `DoIf()`, `DoAll()`, `Group()`,
    `WithContext()`, `Detach()`, `Parallel()`, `ParallelDetached()`, `Finally()`, and `Build()`

### Fixed

- **Registration-order bug**: `Group()`, `WithContext()`, `Detach()`, `Parallel()`, and
  `ParallelDetached()` steps now execute in the exact order they were registered, interleaved
  correctly with `Do()` steps. Previously all `Do()` steps ran before all feature steps
  regardless of registration order.

### Deprecated

- `RailwayBuilder<TRequest, TPayload, TSuccess, TError>` — use `Railway.Create()` instead
- `RailwayBuilderFactory` — use `Railway.Create()` instead
@DirtyNative DirtyNative merged commit b3355df into develop Apr 1, 2026
2 checks passed
@DirtyNative DirtyNative deleted the feature/guards-fix branch April 1, 2026 06:08
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