Skip to content

fix(schemas): download code bindings with SDK v3 responses - #8886

Open
itsrayeedscodespace wants to merge 1 commit into
aws:masterfrom
itsrayeedscodespace:fix/schemas-sdk-v3-code-download
Open

itsrayeedscodespace wants to merge 1 commit into
aws:masterfrom
itsrayeedscodespace:fix/schemas-sdk-v3-code-download

Conversation

@itsrayeedscodespace

Copy link
Copy Markdown

Problem

Fixes #8885.

EventBridge Schemas code-binding downloads still check SDK v2's ResourceNotFound name, so SDK v3's NotFoundException never starts code generation. Existing bindings also fail because v3 returns Uint8Array, while the downloader only accepts Buffer. Returning a Buffer's entire backing ArrayBuffer can additionally include bytes outside the zip payload.

Solution

  • Handle NotFoundException when deciding to generate and poll for code bindings.
  • Accept Uint8Array (including Buffer) and copy only its view into the returned ArrayBuffer.
  • Replace the old backing-buffer comparison with exact length/content regressions for Uint8Array, Buffer and subarrays.
  • Use the SDK's real NotFoundException in the generation regression, and add a generation → polling → download → real zip extraction test with padded response bytes.
  • Add a Toolkit bug-fix changelog entry. No dependencies or lockfiles changed.

Validation

macOS arm64; Node 22.23.5 / npm 10.9.11; installed VS Code 1.146.0, using @vscode/test-electron.runTests with the repository's built Toolkit unit-test entrypoint and disposable user/config directories:

  • New/updated focused tests against unchanged upstream e05c9eb08: 20 passing, 6 failing. The six cases catch v3 response handling, exact byte bounds, and missing-binding generation.
  • Same focused suite with the fix: 26 passing.
  • Wider eventSchemas/**/*.test.ts selection: 77 passing.
  • npm run compileOnly -w packages/core: passed.
  • npm run testCompile -w packages/toolkit: passed.
  • Configured postinstall build, including core webpack bundles: passed (existing bundle-size warnings).
  • Changed-file ESLint and Prettier: passed.
  • Commit hooks (git-secrets, staged formatting), DCO sign-off and git diff --check: passed.

The extension-host tests use stubbed service responses, real SDK exception objects and real filesystem/zip extraction. No live AWS calls or credentialed integration tests were run; the full repository unit suite was not run. The installed VS Code binary was used to avoid downloading another editor. Its unrelated chat/agent features were disabled in the disposable test profile for repeatable startup.


  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

Signed-off-by: Rayeed Zaman <rayeedzaman@gmail.com>
@itsrayeedscodespace
itsrayeedscodespace requested a review from a team November 23, 2026 15:20
@amazon-inspector-ohio

Copy link
Copy Markdown

⏳ I'm reviewing this pull request for security vulnerabilities and code quality issues. I'll provide an update when I'm done

@amazon-inspector-ohio

Copy link
Copy Markdown

✅ I finished the code review, and didn't find any security or code quality issues.

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.

Schema "Download code bindings" always fails: SDK v3 migration broke NotFound check and Buffer check

1 participant