Skip to content

fix(sdk): preserve undefined successful batch results - #982

Merged
zhongkechen merged 4 commits into
aws:mainfrom
shin4141:codex/aws-979-undefined-batch-results
Oct 15, 2026
Merged

zhongkechen merged 4 commits into
aws:mainfrom
shin4141:codex/aws-979-undefined-batch-results

Conversation

@shin4141

@shin4141 shin4141 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Issue Link, if available

Fixes #979

Description

BatchResult.succeeded() and failed() required both a matching status and a defined value. A successful branch returning undefined was therefore omitted: succeeded().length could disagree with successCount, and getResults() lost the branch's position.

Filter the real and mock batch views by status. getResults() and getErrors() continue to map those views. This changes no public type or unrelated handler logic.

For failure results, the existing live and replay builders attach a ChildContextError to each FAILED item. An artificially constructed FAILED item without an error is outside that observed construction path. This PR does not redefine throwIfError() or broaden the public error type for that input.

Demo/Screenshots

Not applicable to this SDK behavior change.

Checklist

  • I have filled out every section of the PR template.
  • I have thoroughly tested this change within the local scope described below.

Testing

Unit Tests

  • Focused batch-result.test.ts: 19/19 pass; these tests are included in the core suite.
  • Core Jest on Node 22.19.0: 107 suites and 1,308 tests pass. TypeScript tsc --noEmit, Biome on 200 core files, and git diff --check pass.
  • Separate local Contract Harness, not included in this PR: the final fixture had 5 failing and 8 passing Jest tests on the unchanged base, then 13/13 Jest tests passed with this patch. The patched contract report classified 8 valid cases as PASS, 3 intentionally invalid inputs as INVALID, and 2 unsupported or uncertain inputs as UNRESOLVED; the latter five are not counted as success evidence. The harness unit tests passed 12/12. With the temporary contract fixture added, the core suite passed 108 suites and 1,321 tests.

Integration Tests

  • Added a local composed map/parallel test and a mocked summarized replay test; both passed within the core suite.
  • No deployed Lambda, real suspend/resume invocation, full monorepo suite, or upstream CI was run. The repository's external PR policy skips integration tests on external PRs and calls for internal full testing of functional changes.

Examples

No example was added; this is a bug fix without a new feature or public API type change.

@shin4141
shin4141 deployed to ai-pr-review-runtime October 9, 2026 04:08 — with GitHub Actions Active
@zhongkechen
zhongkechen merged commit 6e62276 into aws:main Oct 15, 2026
19 checks passed
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.

[Bug]: BatchResult.succeeded() and getResults() drop succeeded items whose result is undefined

2 participants