From f707dfc16bee58098d87d9aecb354c379834ca54 Mon Sep 17 00:00:00 2001 From: Alex McKenzie Date: Sun, 19 Apr 2026 23:27:03 -0400 Subject: [PATCH 1/2] Fix NotificationHandler for Node 24 Lambda runtime The wrapped SNS handler declared a 3-argument `(event, context, callback)` signature. Node 24's Lambda runtime rejects callback-style handlers at init with `Runtime.CallbackHandlerDeprecated`, even when the callback is never invoked. Drop the callback parameter and let promise rejection propagate, which matches what the other handler wrappers in this package already do. Fixes #58. --- handlers/notification-handler.ts | 38 ++++++++++++++------------------ 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/handlers/notification-handler.ts b/handlers/notification-handler.ts index d59e00d..00f0926 100644 --- a/handlers/notification-handler.ts +++ b/handlers/notification-handler.ts @@ -43,34 +43,30 @@ export function NotificationHandler( ): NotificationHandlerWithDefinition { const { validator = defaultValidator, ...definition } = options; - const wrappedHandler: SNSHandler = async (event, context, callback) => { + const wrappedHandler: SNSHandler = async (event, context) => { const notificationEvent: NotificationEvent = { Records: event.Records, InvalidMessages: [], ValidMessages: [], }; - try { - for (const record of event.Records) { - try { - const validRecord = validator(JSON.parse(record.Sns.Message)); - notificationEvent.ValidMessages.push({ - attempts: 0, - body: validRecord, - messageId: record.Sns.MessageId, - }); - } catch (error) { - notificationEvent.InvalidMessages.push({ - attempts: 0, - body: record.Sns.Message, - error, - messageId: record.Sns.MessageId, - }); - } + for (const record of event.Records) { + try { + const validRecord = validator(JSON.parse(record.Sns.Message)); + notificationEvent.ValidMessages.push({ + attempts: 0, + body: validRecord, + messageId: record.Sns.MessageId, + }); + } catch (error) { + notificationEvent.InvalidMessages.push({ + attempts: 0, + body: record.Sns.Message, + error, + messageId: record.Sns.MessageId, + }); } - await handler(notificationEvent, context); - } catch (error) { - callback(error as any); } + await handler(notificationEvent, context); }; return Object.assign(wrappedHandler, { From caf82b56ed635f74a6b57d90784c8e19a7c56d62 Mon Sep 17 00:00:00 2001 From: Alex McKenzie Date: Sun, 19 Apr 2026 23:27:08 -0400 Subject: [PATCH 2/2] 8.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8ecbaf5..ad9bb8d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@faceteer/cdk", - "version": "8.0.1-alpha.1", + "version": "8.0.1", "description": "CDK 2.0 constructs and helpers that make composing a Lambda powered service easier.", "main": "index.js", "files": [