Skip to content

Refactoring fixes - #65

Merged
mvSapphire merged 2 commits into
masterfrom
rafactoring-fixes
Mar 26, 2026
Merged

Refactoring fixes#65
mvSapphire merged 2 commits into
masterfrom
rafactoring-fixes

Conversation

@mvSapphire

Copy link
Copy Markdown
Owner

Changes

Bug fixes

  • PipelineStepFactory: Create and CreateCompensation now throw InvalidOperationException with the unregistered type name instead of silently returning null (which caused a NullReferenceException downstream)
  • PipelineBuilder.Build(): Guard against duplicate FinishStep — calling Build() multiple times no longer corrupts the pipeline
  • PipelineBuilder: Removed incorrect volatile modifier from _context (field is only assigned in the constructor)

API improvements

  • IPipelineStepFactory: Removed IServiceProvider ServiceProvider property (Service Locator anti-pattern). Added ILoggerFactory GetLoggerFactory() instead. PipelineBuilder now uses this method to obtain the logger factory
  • PipelineContext / PipelineBuilder / Pipeline: Dropped where TResult : class constraint, allowing value types and record structs as pipeline results. RunAsync returns default(TResult) instead of null for nested pipelines
  • PipelineExecutionException / NestedPipelineExecutionException: Added standard .NET exception constructors (parameterless, (string), (string, Exception))

Documentation

  • PipelineBuilder.Parallel() and ParallelStep: Added XML doc warning that parallel steps share the same context instance and must synchronize writes (e.g. Interlocked, lock, concurrent collections)
  • IPipelineStep.NextStep: Documented that the setter is managed by pipeline infrastructure and should not be set by consumer code
  • PipelineDiagramsService.GetDiagrams(): Documented that diagrams are cached after the first call with no invalidation

Logging

  • PipelineDiagramsService.GetDiagrams(): Changed exception logging from LogDebug to LogError

Test cleanup

  • TestParallelStep: Removed unused NextStep property

@mvSapphire
mvSapphire merged commit c98e6e5 into master Mar 26, 2026
4 checks passed
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