Skip to content

Fix #519, #576, #696 + regression guards for #590, #608, #581, #606#729

Merged
YogeshPraj merged 1 commit into
microsoft:mainfrom
YogeshPraj:fix/issues-batch-2
May 27, 2026
Merged

Fix #519, #576, #696 + regression guards for #590, #608, #581, #606#729
YogeshPraj merged 1 commit into
microsoft:mainfrom
YogeshPraj:fix/issues-batch-2

Conversation

@YogeshPraj
Copy link
Copy Markdown
Contributor

Summary

Tier 2 follow-up to #727 (perf) and our batch-1 PR. Three real fixes, four already-fixed-on-main verifications turned into regression tests. Each fix has a dedicated test file.

Fixes #576ActionContext ctor NRE when Context is null

ActionContext's constructor unconditionally iterates context and dereferences each kv.Value.GetType(). Custom actions that don't need configuration commonly leave OnSuccess.Context = null, which crashed before the action could even run.

Added a null guard on the dictionary itself and on each value. A null value now stores null in the internal map instead of throwing.

Fixes #519ExecuteActionWorkflowAsync skipped FormatErrorMessages

ExecuteAllRulesAsync interpolates Rule.ErrorMessage ($(input.foo)) into RuleResultTree.ExceptionMessage via FormatErrorMessages. ExecuteActionWorkflowAsync did not, so users got an unpopulated ExceptionMessage on the same workflow.

Added the call in ExecuteActionWorkflowAsync right before invoking the action. Result-tree shape and ordering are unchanged; only ExceptionMessage is now populated consistently.

Fixes #696 — Multi-level dotted ErrorMessage interpolation

UpdateErrorMessage split the dotted path but only used segments [0] (typeName) and [1] (propertyName). For $([input1.Inner.Name](https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Finput1.inner.name%2F&data=05%7C02%7CYogesh.Prajapati%40microsoft.com%7C8276de067a704d3c502608debc07dec3%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C639154939190866661%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=mjtWuqX8oJIvyRkxLPcQCYkCg8c2bh%2Ffv%2BzGl88fcNw%3D&reserved=0)) it set typeName=input1, propertyName=Inner — and then the replacement was the raw JSON of Inner ({"Name":"deep-value"}) instead of "deep-value".

Rewrote the helper to walk the full path via JsonNode, returning the leaf scalar unquoted (for JsonValue strings) or nested JSON otherwise. The single-level case is unchanged.

Regression guards (verified already fixed on master)

# Title Fixed by
#590 Exception message from prior run leaks into next successful run Commit 4ca3cc2 (PR #592)
#608 UseFastExpressionCompiler=true + chained scoped-param sums NRE'd FastExpressionCompiler / Dynamic.Core version bumps
#581 Custom parameter name not honored ("Enum type 'endpoint' not found") Likely the AutoRegisterInputType work in PR #501
#606 Lambda parameter l reported as unknown identifier Dynamic.Core 1.4.3 → 1.6.7 bumps

Each repro from the linked issue now passes on master. Added explicit tests so we'd notice if any of these regressed.

Not fixed in this PR

#390 (ActionContext receives literal string instead of evaluated value) is a design decision rather than a bug — ActionContext is documented as a static key/value config dict; users who want evaluation should use OutputExpression. Happy to revisit in a separate PR if the maintainers want to introduce a $(...)-evaluating mode.

Test plan

  • 7 new test files (Issue519/576/581/590/606/608/696), 11 new tests total.
  • All 142 unit tests pass on net6.0 / net8.0 / net9.0 / net10.0.
  • No changes to public API surface; behavior changes only on the documented-but-broken paths.

…uards for microsoft#590, microsoft#608, microsoft#581, microsoft#606

Code fixes:

(common in custom actions that don't need config). Added null guards for
both the context dict itself and each entry's value.

ErrorMessage template was never interpolated into ExceptionMessage on the
result tree (unlike ExecuteAllRulesAsync which formats correctly). Added
the call.

`$(input1.Inner.Name)` produced the raw JSON of `Inner` (`{"Name":"..."}`)
instead of walking to the leaf. Rewrote UpdateErrorMessage to traverse the
full path via JsonNode and emit the leaf scalar (unquoted) or nested JSON.

Verified-already-fixed (regression tests added):

run was fixed in commit 4ca3cc2 (microsoft#592). Test guards against regression.

no longer reproduces — likely fixed by FastExpressionCompiler / Dynamic.Core
version bumps. Test guards against regression.

no longer reproduces, likely resolved by the AutoRegisterInputType work.
Test guards against regression.

mis-resolved on master — likely fixed by Dynamic.Core 1.4.3 → 1.6.7 bump.
Test guards against regression.

Not fixed in this PR:

decision rather than a bug — ActionContext is documented as a static
key/value config dict. Users who want evaluation should use OutputExpression.

All 142 unit tests pass on net6 / net8 / net9 / net10.
@YogeshPraj YogeshPraj force-pushed the fix/issues-batch-2 branch from e946047 to 5d73983 Compare May 27, 2026 16:01
@YogeshPraj YogeshPraj merged commit 3c5350d into microsoft:main May 27, 2026
3 checks passed
@YogeshPraj YogeshPraj mentioned this pull request May 27, 2026
2 tasks
YogeshPraj added a commit that referenced this pull request May 27, 2026
Bump <Version> from 6.0.0 to 6.0.1-preview.1 and add a CHANGELOG entry
covering the three PRs landed since 6.0.0: #727 (perf cache restore),
#728 (action-exception propagation, list schema union, OutputExpression
hint, global-param dedup, object-return diagnostics), and #729
(ExecuteActionWorkflowAsync FormatErrorMessages, ActionContext null guard,
deep ErrorMessage interpolation, plus regression guards for #581, #590,
#606, #608).

Co-authored-by: Yogesh Prajapati <yogeshcprajapati@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants