elsa-core/test/unit
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
..
Elsa.Activities.UnitTests Add OpenTelemetry workflow instrumentation (#7514) 2026-05-22 01:17:05 +02:00
Elsa.AI.Abstractions.UnitTests Implement Weaver AI Copilot core (#7523) 2026-06-04 11:35:44 +02:00
Elsa.AI.Copilot.UnitTests Implement Weaver AI Copilot core (#7523) 2026-06-04 11:35:44 +02:00
Elsa.AI.Host.UnitTests Increase AI host test coverage 2026-06-27 04:04:39 +02:00
Elsa.AI.Persistence.EFCore.UnitTests chore: apply safe dependency upgrades (#7896) 2026-07-26 21:42:27 +02:00
Elsa.Common.UnitTests Fix tenant service mutation race (#7898) 2026-07-30 02:47:44 +02:00
Elsa.Dashboard.Api.UnitTests Add operational dashboard API 2026-06-02 02:33:11 +02:00
Elsa.Diagnostics.ConsoleLogs.UnitTests [codex] Fix diagnostics live feed regressions (#7548) 2026-05-31 09:40:02 +02:00
Elsa.Diagnostics.OpenTelemetry.UnitTests [codex] Fix console log metadata and type resolution (#7542) 2026-05-30 22:52:01 +02:00
Elsa.Diagnostics.StructuredLogs.Persistence.Relational.UnitTests Fix structured log diagnostics registration 2026-05-17 08:42:23 +02:00
Elsa.Diagnostics.StructuredLogs.UnitTests Add structured log provider tests (#7449) 2026-05-16 09:23:31 +02:00
Elsa.Expressions.UnitTests [codex] Harden C# expression host-code execution (#7519) 2026-05-21 00:50:25 +02:00
Elsa.Hosting.Management.UnitTests Shorten configured application instance names 2026-06-20 12:50:02 +02:00
Elsa.Http.UnitTests Guard HTTP fault handling when workflow reload returns null (#7714) 2026-06-14 22:23:38 +02:00
Elsa.Identity.UnitTests fix: use tenant-agnostic application lookup for api keys 2026-06-09 06:09:47 +02:00
Elsa.Mediator.UnitTests [codex] Fix diagnostics live feed regressions (#7548) 2026-05-31 09:40:02 +02:00
Elsa.Persistence.EFCore.UnitTests test: cover Oracle bulk upsert SQL generation 2026-07-11 14:35:36 +02:00
Elsa.Persistence.VNext.UnitTests chore: apply safe dependency upgrades (#7896) 2026-07-26 21:42:27 +02:00
Elsa.Resilience.Core.UnitTests Enhances distributed lock handling with resilience (#7161) 2025-12-29 19:53:48 +01:00
Elsa.SasTokens.UnitTests [codex] Harden initial security remediation slice (#7495) 2026-05-22 00:45:47 +02:00
Elsa.Scheduling.UnitTests [codex] Scope console logs to workflow instances (#7535) 2026-05-25 11:49:51 +02:00
Elsa.Secrets.UnitTests Implement secret update functionality, add related tests, and update project references. 2026-06-01 23:47:05 +02:00
Elsa.Shells.Api.Tests Graceful shutdown for the workflow runtime (drain, pause, recover) (#7424) 2026-05-02 19:27:08 +02:00
Elsa.Tenants.UnitTests Fix Multitenancy Support and Normalize Tenant ID Handling (#7217) 2026-01-30 19:54:13 +01:00
Elsa.Workflows.Api.UnitTests Add output converter support at binding boundaries 2026-07-31 04:10:48 +02:00
Elsa.Workflows.Core.UnitTests feat(core): let a container handle a child's fault via FaultSignal 2026-08-11 01:11:25 +02:00
Elsa.Workflows.Management.UnitTests Add output converter support at binding boundaries 2026-07-31 04:10:48 +02:00
Elsa.Workflows.Runtime.UnitTests Refactor: Overhauls workflow JSON type serialization (#7549) 2026-05-31 11:09:39 +02:00
Directory.Build.props Add coverage enforcement for test projects (#6950) 2025-10-07 19:59:53 +02:00