Repository navigation
fix: use async Netlify function handlers for Node.js 24 - #224
Merged
Merged
Conversation
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>
✅ Deploy Preview for gbfs-validator ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
🔵 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, andvalidator-summary.jsto async handlers that return response objects. - Replaced callback-based promise handling with
awaitandtry/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
davidgamez
approved these changes
Nov 24, 2026
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
Since the move to Node.js 24 (#222), every call to the validator functions fails with:
The Netlify functions in
functions/(feed.js,validator.js,validator-summary.js) used the(event, context, callback)signature. This PR converts each to anasync (event)handler that returns the response object, per the Lambda Node.js handler docs.Changes
asyncandreturntheir responses; status codes, headers and response bodies are unchanged.callback(err, ...)and then kept running with an undefinedbody; 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