Conversation
…x+ compatibility Newer AWS Lambda Node.js runtimes no longer support the callback-style handler pattern. This wraps each handler export with wrapAsAsync() which converts the callback-style function to an async function returning a Promise, while preserving 100% of the internal callback logic unchanged. Task: ES-2929 Made-with: Cursor
jgrantr
approved these changes
Mar 11, 2026
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wrappers/wrapAsAsync.js— a shared utility that converts callback-style(event, context, callback)Lambda handlers into async handlers that return a Promisecron.js,fanout.js,resource.js,test.js) withwrapAsAsync()so they are compatible with newer Node.js Lambda runtimes (nodejs20.x, nodejs22.x) which no longer support the callback patternJira
https://chb.atlassian.net/browse/ES-2929
Changes Made
wrappers/wrapAsAsync.jswrappers/cron.jswrapAsAsync()wrappers/fanout.jswrapAsAsync()wrappers/resource.jswrapAsAsync()wrappers/test.jswrapAsAsync()How It Works
Each wrapper factory now returns
wrapAsAsync(function(event, context, callback) { ... })instead offunction(event, context, callback) { ... }. The internal callback-based flow is unchanged — wrapAsAsync creates the Promise at the boundary and connects it to the callback.Testing
Checklist
Made with Cursor
Note
Medium Risk
Changes the exported Lambda handler interface for
cron,fanout,resource, andtestwrappers from callback-style to Promise-returning async handlers, which can affect error/return propagation at the Lambda boundary. Internal wrapper logic is preserved, but any edge cases around double-callbacks or rejected Promises could surface at runtime.Overview
Adds
wrappers/wrapAsAsync.js, a small utility that adapts callback-style(event, context, callback)Lambda handlers into async handlers that return a Promise.Updates the
cron,fanout,resource, andtestwrapper factories to returnwrapAsAsync(...)-wrapped handlers so the exported entrypoints are compatible with Node.js 20+ Lambda runtimes while keeping existing callback-based internals unchanged.Written by Cursor Bugbot for commit c9b4c5d. This will update automatically on new commits. Configure here.