Skip to content

fix(aws-lambda): attribute parallel history events to their states - #5250

Closed
user-github-me wants to merge 1 commit into
heygen-com:mainfrom
user-github-me:fix/lambda-progress-event-ancestry
Closed

user-github-me wants to merge 1 commit into
heygen-com:mainfrom
user-github-me:fix/lambda-progress-event-ancestry

Conversation

@user-github-me

Copy link
Copy Markdown
Contributor

When parallel Step Functions branches interleave, the Lambda progress reader assigns every completion/failure to the latest entered state. A chunk completed after a different branch is entered loses its frame count, and its failure is reported under that unrelated state.

Carry the enclosing state through each event's previousEventId chain. Use that state for chunk frame counts and Lambda failures, retain the fallback for histories without parent IDs, and report <unknown> when an explicit parent is missing.

Validation:

  • 151 AWS tests pass across 13 files; all eight new attribution regressions fail on main.
  • Coverage includes optimized and raw Lambda events, interleaved success/failure, pagination, unrelated-task frame counts, missing parents, and existing sequential histories.
  • Package build/typecheck, root lint, changed-file formatting, test reachability, and commit hooks pass.
  • Built SDK on Node 22 with the workspace tsx loader: four local HTTP paginated-history probes pass for success/failure in both integration formats.

No cloud deployment was used; verification uses the SDK's existing client-injection boundary.\n

@jrusso1020

Copy link
Copy Markdown
Collaborator

Thanks. In the shipped state machine, each chunk Map iteration contains a single RenderChunk task, and nothing else runs while the Map is in progress. Interleaved events therefore always come from the same state name, and the current attribution is already correct. The interleaving in these tests can't happen with this stack, so we'll pass on this one. — Rames

@jrusso1020 jrusso1020 closed this Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants