v2.5.6
Framework 2.5.6 Release
🆕 Feature: Automatic Serialization of Non-Serializable Data Types
Problem
Previously, if a Godspeed event handler or datasource returned a response containing non-JSON-serializable data types like BigInt, Date, Function, or Error, it could cause:
- TypeError: Do not know how to serialize a BigInt
Solution
Godspeed now includes built-in response sanitization and serialization logic at the framework level. All event handler responses (GSStatus) are automatically sanitized before being sent, ensuring they are JSON-safe and reliable across all transport layers.
Key Improvements
- Added a try-catch, right before returning the eventHandlerStatus in the processEvent method of godspeed class.
- Automatic conversion of: BigInt → string Date → ISO string Symbol → .toString()
- Covers all datasources (Prisma, Redis, custom integrations)
- Prevents serialization crashes in res.json() / res.send()
- Sanity check is performed on response before sending
- Implemented graceful error handling for serialization failures
- Added detailed error logging with response data context
Developer Impact
- No need to manually convert BigInt, Decimal and circular references
- Responses are now safer and more stable across environments