elsa-core/test/unit/Elsa.Workflows.Core.UnitTests
Sipke Schoorstra 13eb48e002
feat(core): let a container handle a child's fault via FaultSignal
A container activity had no way to learn that one of its children faulted.
ExceptionHandlingMiddleware caught the exception, called context.Fault(e) and
handed off to the workflow-global IIncidentStrategy; the container's completion
callback never fired, because the child never completed.

Add a seam on the ancestor-bubbling signal channel that already exists:

- FaultSignal(Exception, ActivityExecutionContext), beside CancelSignal. Its XML
  doc carries the contract, including why a handler must not call
  RecoverFromFault and why the CompleteActivityAsync sweep is a backstop rather
  than the mechanism.
- An internal bool-returning TrySendSignalAsync, since SignalContext
  .StopPropagationRequested is internal and SendSignalAsync reported nothing.
  SendSignalAsync keeps its public signature and delegates to it.
- ExceptionHandlingMiddleware sends the signal after faulting and, when an
  ancestor stops propagation, calls RecoverFromFault once and returns instead of
  raising an incident.

RecoverFromFault now transitions to Running only when the activity is still
Faulted. It is called after the handler runs, so the unconditional transition
would otherwise undo a handler that cancelled or completed the faulted child.
The counts are still reset unconditionally, and the one pre-existing caller is
unaffected.

Behavior is unchanged when nobody handles the signal: verified by running the
new unhandled-fault theory against the pre-change middleware, and by
IncidentStrategyTests and Primitives/FaultTests passing unmodified.

Refs #7911

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 01:11:25 +02:00
..
Extensions feat(core): let a container handle a child's fault via FaultSignal 2026-08-11 01:11:25 +02:00
Flowchart Update flowchart activity scheduling, implicit join (and FlowJoin/WaitAll) now only waits for followed connections 2025-02-12 23:27:40 -05:00
Models Fix Multitenancy Support and Normalize Tenant ID Handling (#7217) 2026-01-30 19:54:13 +01:00
ObjectConversion fix: restore HashSet-backed Fork completion state on resumed workflows (#7431) 2026-05-02 11:23:17 +02:00
OutputConverters Harden output converter contracts 2026-07-31 13:29:01 +02:00
Serialization Add output converter support at binding boundaries 2026-07-31 04:10:48 +02:00
Services Protect sensitive workflow inputs 2026-06-01 09:15:34 +02:00
Telemetry Add OpenTelemetry workflow instrumentation (#7514) 2026-05-22 01:17:05 +02:00
Elsa.Workflows.Core.UnitTests.csproj Add code coverage configuration and adjust test projects (#7049) 2025-11-12 13:59:36 +01:00