Skip to content

fix: use async Netlify function handlers for Node.js 24 - #224

Merged
Alessandro100 merged 1 commit into
masterfrom
fix/lambda-async-handlers
Nov 24, 2026
Merged

Alessandro100 merged 1 commit into
masterfrom
fix/lambda-async-handlers

Conversation

@Alessandro100

Copy link
Copy Markdown
Contributor

Summary

Since the move to Node.js 24 (#222), every call to the validator functions fails with:

Runtime.CallbackHandlerDeprecated: AWS Lambda has removed support for callback-based function handlers starting with Node.js 24.

The Netlify functions in functions/ (feed.js, validator.js, validator-summary.js) used the (event, context, callback) signature. This PR converts each to an async (event) handler that returns the response object, per the Lambda Node.js handler docs.

Changes

  • All three handlers are now async and return their responses; status codes, headers and response bodies are unchanged.
  • Invalid JSON request bodies now return the 500 response immediately. Previously the handler called callback(err, ...) and then kept running with an undefined body; the error body is now the parse error message instead of {}.

Testing

Invoked each handler locally on Node 24 with an OPTIONS request, an invalid JSON body, and a validation request; all returned the expected responses. Not yet verified on a Netlify deploy, so please check the deploy preview.

🤖 Generated with Claude Code

AWS Lambda removed support for callback-based handlers starting with the
Node.js 24 runtime, so every validator request failed with
Runtime.CallbackHandlerDeprecated. Convert feed, validator and
validator-summary handlers to async functions that return the response.

Invalid JSON bodies now return the 500 response immediately instead of
continuing with an undefined body.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@netlify

netlify Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for gbfs-validator ready!

Name Link
🔨 Latest commit e88fc66
🔍 Latest deploy log https://app.netlify.com/projects/gbfs-validator/deploys/6b058cf78870b38c492b1dc6
😎 Deploy Preview https://deploy-preview-224--gbfs-validator.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Deploy-preview verification is missing for Netlify’s Node.js 24 async-handler invocation and response serialization, leaving the behavior of all three functions unconfirmed despite local checks.

No open issues 🎉

What changed in this PR

Updates the three Netlify function handlers to use async response-returning execution compatible with Node.js 24 while preserving existing response behavior.

Changes:

  • Converted feed.js, validator.js, and validator-summary.js to async handlers that return response objects.
  • Replaced callback-based promise handling with await and try/catch.
  • Made invalid JSON requests return immediately with the parsing error message.
File Description
functions/​validator.js Uses an async handler to validate GBFS feeds and return validation results.
functions/​validator-summary.js Uses an async handler to generate and return validation summaries.
functions/​feed.js Uses an async handler to retrieve and return GBFS feed files.

Review effort: Lite

@Alessandro100
Alessandro100 merged commit a118a3f into master Nov 24, 2026
10 checks passed
@Alessandro100
Alessandro100 deleted the fix/lambda-async-handlers branch November 24, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants