elsa-core/test/unit/Elsa.Workflows.Core.UnitTests
Sipke Schoorstra 6503c0cb92
fix(workflows): resolve GetInput serializer options per host (#8158)
* fix(workflows): resolve GetInput serializer options per host

Remove the process-wide JsonSerializerOptions cache from ExpressionExecutionContextExtensions so DI converters registered on a later host remain visible after the first GetInput. Share CloneForValueConversion with WorkflowInstanceStorageDriver reads.

Closes #8131

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* fix(workflows): match storage write/read JSON reference semantics

Use the same cloned payload-serializer options for WorkflowInstanceStorageDriver Write and Read. Forcing ReferenceHandler.Preserve on read only treated ordinary $ref properties as metadata and broke restore.

Closes the P1 on #8158.

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* fix(workflows): serialize storage values by runtime type

SerializeToNode(object, options) used the compile-time object converter, so PolymorphicObjectConverter wrapped arrays as _items metadata. Write now uses the runtime type with the same cloned host options as Read.

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* test(workflows): assert stored array conversion is non-null

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* fix(workflows): restore _type for object-typed storage values

Serialize object-typed variables through the polymorphic converter so aliased CLR types keep a _type discriminator. Typed arrays still serialize by runtime type so they stay JSON arrays.

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* fix(workflows): deserialize object variables through polymorphic options

ConvertTo(object) returns the stored JsonObject because it is assignable to object. Read object-typed variables with the payload serializer so _type restores the concrete CLR type.

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-09-14 19:07:24 +02:00
..
Extensions fix(workflows): resolve GetInput serializer options per host (#8158) 2026-09-14 19:07:24 +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(workflows): default CreateBookmarkArgs.IncludeActivityInstanceId to true (#8157) 2026-09-14 16:10:12 +02: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-08-21 22:22:47 +02:00
Serialization Add output converter support at binding boundaries 2026-08-21 22:22:46 +02:00
Services Merge remote-tracking branch 'origin/release/3.8.0' 2026-09-06 00:06:14 +02:00
Telemetry Add OpenTelemetry workflow instrumentation (#7514) 2026-05-22 01:17:05 +02:00
VariableStorageDrivers fix(workflows): resolve GetInput serializer options per host (#8158) 2026-09-14 19:07:24 +02:00
Elsa.Workflows.Core.UnitTests.csproj Add code coverage configuration and adjust test projects (#7049) 2025-11-12 13:59:36 +01:00