elsa-core/test/integration/Elsa.Workflows.IntegrationTests
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
..
Activities test: refactor with WorkflowTestFixture (#7394) 2026-04-15 14:04:49 +02:00
Api/Bookmarks [codex] Harden initial security remediation slice (#7495) 2026-05-22 00:45:47 +02:00
Core Merge remote-tracking branch 'origin/patch/3.5.4' into release/3.6.0 2025-12-29 20:00:03 +01:00
Evaluation Add Elsa Script DSL (#7076) 2025-11-25 19:57:50 +01:00
GracefulShutdown fix: do not resume interrupted workflows that are already finished (#7435) 2026-05-18 21:19:23 +02:00
Scenarios feat(core): let a container handle a child's fault via FaultSignal 2026-08-11 01:11:25 +02:00
Security [codex] Harden C# expression host-code execution (#7519) 2026-05-21 00:50:25 +02:00
Serialization Add named WithVariable overload (#7701) 2026-06-08 10:42:59 +02:00
SharedHelpers Refactor commit strategy resolution for improved clarity and efficiency; remove unused example files and add a new CommitTracker helper for testing. 2025-12-16 08:01:49 -05:00
Elsa.Workflows.IntegrationTests.csproj Harden Python expression execution (#7507) 2026-05-20 14:19:47 +02:00
Elsa.Workflows.IntegrationTests.csproj.DotSettings Fix WorkflowExecutionContext bug (#4919) 2024-02-09 19:37:37 +01:00
Usings.cs Refactor Workflow Runtimes (#5444) 2024-06-10 19:36:51 +02:00