elsa-core/src/modules
Marko Lahma 2e9a3ad04f
Trim per-evaluation work in the JavaScript evaluator (#7892)
* perf(javascript): trim per-evaluation work in the JavaScript evaluator

A Jint engine is built for every expression evaluation, so anything done during
setup is paid for on every evaluation. Four pieces of that work are avoidable:

* The three `IObjectConverter` implementations are stateless but were allocated
  fresh for every engine. They are now shared static instances.

* Every prepared-script cache lookup — including hits — computed a SHA-256 hash
  of the expression text, base64-encoded it and concatenated a prefix, purely to
  build the cache key. Using a dedicated key type instead keeps the entries
  distinct from other users of the shared cache while letting the expression
  itself be the key, so a hit is a dictionary lookup. Looking the entry up
  directly rather than through `GetOrCreate` also keeps the factory closure off
  the hit path.

* `ObjectConverterHelper.ConvertToJsObject` built an explicit `PropertyDescriptor`
  per property and called `DefineOwnProperty`. `CreateDataProperty` is public,
  produces exactly the same writable/enumerable/configurable descriptor, and is
  the engine's fast path for it.

* The variable write-back resolved the workflow input names — walking the whole
  activity execution context ancestor chain — before checking whether there was
  anything to write back. Only variables the expression actually referenced are
  copied into the engine, so for the common case of an expression that never
  mentions `variables.` the container is empty and all of that work is wasted.
  The input names are also now looked up through a set rather than a list.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0179sA2T7HuRfRfSc2JirFik

* test(javascript): pin the parse-failure test to the same exception every time

Calling `ThrowsAnyAsync<Exception>` twice only proved that both evaluations threw
something, which is exactly the assertion a poisoned cache would still satisfy:
had the failed preparation left a null or half-built entry behind, the second
evaluation would have failed too, just with a different exception. The test now
captures both exceptions and asserts they are the same type with the same
message, so "keeps reporting the same parse failure" is what is actually checked.

The message is stable to compare: it is `Could not prepare script: Unexpected end
of input (1:9)`, and since both evaluations run the identical script literal the
position is identical as well. No file or path detail is involved.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0179sA2T7HuRfRfSc2JirFik

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-17 01:16:38 +02:00
..
Elsa Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.AI.Abstractions Add Weaver grounding tools 2026-06-08 15:40:10 +02:00
Elsa.AI.Copilot Update safe dependency patch versions 2026-06-22 00:03:50 +02:00
Elsa.AI.Host Add Weaver grounding tools 2026-06-08 15:40:10 +02:00
Elsa.AI.Persistence.EFCore Move AI EF Core migrations to provider projects 2026-06-08 15:22:59 +02:00
Elsa.AI.Persistence.EFCore.MySql Move AI EF Core migrations to provider projects 2026-06-08 15:22:59 +02:00
Elsa.AI.Persistence.EFCore.Oracle Move AI EF Core migrations to provider projects 2026-06-08 15:22:59 +02:00
Elsa.AI.Persistence.EFCore.PostgreSql Move AI EF Core migrations to provider projects 2026-06-08 15:22:59 +02:00
Elsa.AI.Persistence.EFCore.Sqlite Move AI EF Core migrations to provider projects 2026-06-08 15:22:59 +02:00
Elsa.AI.Persistence.EFCore.SqlServer Move AI EF Core migrations to provider projects 2026-06-08 15:22:59 +02:00
Elsa.Alterations Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Alterations.Core
Elsa.Bpmn feat(bpmn): the BpmnProcess container activity (#7945) 2026-08-14 12:37:35 +02:00
Elsa.Bpmn.Interchange feat(bpmn): the work binder and the elsa: binding format (#7946) 2026-08-14 17:38:03 +02:00
Elsa.Caching Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Common Fix tenant service mutation race (#7898) 2026-07-30 02:47:44 +02:00
Elsa.Dashboard.Abstractions Refactor dashboard API contributors (#7690) 2026-06-02 22:25:25 +02:00
Elsa.Dashboard.Api Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Diagnostics.ConsoleLogs Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Diagnostics.ConsoleLogs.Dashboard Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Diagnostics.OpenTelemetry Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Diagnostics.StructuredLogs Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Diagnostics.StructuredLogs.Dashboard Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Diagnostics.StructuredLogs.Persistence.Relational Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Diagnostics.StructuredLogs.Persistence.Sqlite chore: apply safe dependency upgrades (#7896) 2026-07-26 21:42:27 +02:00
Elsa.Dsl.ElsaScript Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Expressions Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Expressions.CSharp Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Expressions.JavaScript Trim per-evaluation work in the JavaScript evaluator (#7892) 2026-08-17 01:16:38 +02:00
Elsa.Expressions.JavaScript.Libraries Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Expressions.Liquid Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Expressions.Python Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.ExternalAuthentication Add architecture and practices documentation 2026-08-03 23:46:38 +02:00
Elsa.ExternalAuthentication.OpenIdConnect Add OpenID Connect authentication features 2026-07-26 23:38:20 +02:00
Elsa.ExternalAuthentication.Persistence.EFCore Add architecture and practices documentation 2026-08-03 23:46:38 +02:00
Elsa.ExternalAuthentication.Persistence.EFCore.MySql Fix external authentication review findings 2026-08-02 03:35:39 +02:00
Elsa.ExternalAuthentication.Persistence.EFCore.Oracle Fix external authentication review findings 2026-08-02 03:35:39 +02:00
Elsa.ExternalAuthentication.Persistence.EFCore.PostgreSql Fix external authentication review findings 2026-08-02 03:35:39 +02:00
Elsa.ExternalAuthentication.Persistence.EFCore.Sqlite Fix external authentication review findings 2026-08-02 03:35:39 +02:00
Elsa.ExternalAuthentication.Persistence.EFCore.SqlServer Fix external authentication review findings 2026-08-02 03:35:39 +02:00
Elsa.ExternalAuthentication.Secrets Merge compact external authentication secret IDs 2026-08-02 00:22:29 +02:00
Elsa.Hosting.Management feat: introduce HTTP webhooks module 2026-08-03 02:08:15 +02:00
Elsa.Http Guard HTTP fault handling when workflow reload returns null (#7714) 2026-06-14 22:23:38 +02:00
Elsa.Http.Webhooks feat: introduce HTTP webhooks module 2026-08-03 02:08:15 +02:00
Elsa.Identity Harden external identity race compensation 2026-08-02 23:19:49 +02:00
Elsa.KeyValues Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Labels Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Persistence.EFCore Remove migration for external authentication in EFCore.Sqlite module 2026-07-31 14:31:18 +02:00
Elsa.Persistence.EFCore.Common test: cover Oracle bulk upsert SQL generation 2026-07-11 14:35:36 +02:00
Elsa.Persistence.EFCore.MySql Remove migration for external authentication in EFCore.Sqlite module 2026-07-31 14:31:18 +02:00
Elsa.Persistence.EFCore.Oracle Remove migration for external authentication in EFCore.Sqlite module 2026-07-31 14:31:18 +02:00
Elsa.Persistence.EFCore.PostgreSql Remove migration for external authentication in EFCore.Sqlite module 2026-07-31 14:31:18 +02:00
Elsa.Persistence.EFCore.Sqlite Remove migration for external authentication in EFCore.Sqlite module 2026-07-31 14:31:18 +02:00
Elsa.Persistence.EFCore.SqlServer Remove migration for external authentication in EFCore.Sqlite module 2026-07-31 14:31:18 +02:00
Elsa.Persistence.VNext Add Persistence vNext provider-neutral POC 2026-06-02 21:05:21 +02:00
Elsa.Persistence.VNext.Extensions Add Persistence vNext provider-neutral POC 2026-06-02 21:05:21 +02:00
Elsa.Persistence.VNext.MongoDb Add Persistence vNext provider-neutral POC 2026-06-02 21:05:21 +02:00
Elsa.Persistence.VNext.PostgreSql Add Persistence vNext provider-neutral POC 2026-06-02 21:05:21 +02:00
Elsa.Persistence.VNext.Relational Add Persistence vNext provider-neutral POC 2026-06-02 21:05:21 +02:00
Elsa.Persistence.VNext.Runtime Add Persistence vNext provider-neutral POC 2026-06-02 21:05:21 +02:00
Elsa.Persistence.VNext.Sqlite chore: apply safe dependency upgrades (#7896) 2026-07-26 21:42:27 +02:00
Elsa.Persistence.VNext.SqlServer Add Persistence vNext provider-neutral POC 2026-06-02 21:05:21 +02:00
Elsa.Platform.Integration Add Platform integration 2026-06-18 18:27:27 +02:00
Elsa.Resilience Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Resilience.Core
Elsa.SasTokens Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Scheduling address greptile review feedback (greploop iteration 1) 2026-06-21 19:43:09 +02:00
Elsa.Secrets Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Secrets.JavaScript Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Secrets.Persistence.EFCore Use shared secret name normalization 2026-06-01 22:28:38 +02:00
Elsa.Secrets.Persistence.EFCore.MySql Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Secrets.Persistence.EFCore.Oracle Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Secrets.Persistence.EFCore.PostgreSql Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Secrets.Persistence.EFCore.Sqlite Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Secrets.Persistence.EFCore.SqlServer Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Secrets.Persistence.VNext Add Persistence vNext provider-neutral POC 2026-06-02 21:05:21 +02:00
Elsa.Shells.Api feat: introduce HTTP webhooks module 2026-08-03 02:08:15 +02:00
Elsa.Tenants Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Tenants.AspNetCore Merge release/3.8.0 into bugfix/7900-tenant-request-services 2026-08-03 00:48:56 +02:00
Elsa.WorkflowProviders.BlobStorage Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.WorkflowProviders.BlobStorage.ElsaScript Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Workflows.Api Merge release/3.8.0 into main 2026-08-14 11:59:35 +02:00
Elsa.Workflows.Core Merge release/3.8.0 into main 2026-08-14 11:59:35 +02:00
Elsa.Workflows.Management Merge release/3.8.0 into main 2026-08-14 11:59:35 +02:00
Elsa.Workflows.Runtime Merge branch 'codex/auth-refinements' into release/3.8.0 2026-08-02 22:39:54 +02:00
Elsa.Workflows.Runtime.Dashboard Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00
Elsa.Workflows.Runtime.Distributed Address workflow commit review feedback 2026-06-23 02:27:06 +02:00
Directory.Build.props Remove PackageManifestCategories and update feature categories to inline strings 2026-06-08 09:48:55 +02:00