mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-24 16:06:34 +00:00
fix(aws-lambda): route an omitted PlanProtocol before comparing it (#6985)
Step Functions raises States.Runtime for a StringEquals on a missing path instead of treating it as a non-match, so a state machine input without PlanProtocol failed at SelectPlanProtocol and never reached the Default branch. Check presence first in both the SAM template and the CDK stack. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
f1391156e0
commit
758759673b
@@ -443,7 +443,10 @@ export class HyperframesRenderStack extends Construct {
|
||||
error: "PLAN_PROTOCOL_UNSUPPORTED",
|
||||
cause: 'PlanProtocol must be "v2" or absent (defaults to v2).',
|
||||
});
|
||||
// A comparison on a missing path is a States.Runtime error, not a non-match, so an omitted
|
||||
// PlanProtocol has to be caught before the stringEquals rule.
|
||||
return new sfn.Choice(this, "SelectPlanProtocol")
|
||||
.when(sfn.Condition.isNotPresent("$.PlanProtocol"), planV2)
|
||||
.when(sfn.Condition.stringEquals("$.PlanProtocol", "v2"), planV2)
|
||||
.when(sfn.Condition.isPresent("$.PlanProtocol"), unsupportedPlanProtocol)
|
||||
.otherwise(planV2);
|
||||
|
||||
Reference in New Issue
Block a user