Enfyra Server v2.0.3
v2.0.3
Breaking Changes
The DEV_WATCH port-busy retry loop in main.ts has been removed. Previously the server retried server.listen() up to 25 times × 200ms before failing; now it exits immediately on EADDRINUSE with a clear log line, matching Nest-style behavior. If your dev workflow relied on the retry to recover from stale tsx watch processes, kill the old process explicitly before starting a new one (or rely on the process manager to handle restarts).
Features
- Added bootstrap self-heal for orphaned route handlers.
RouteDefinitionProcessor.ensureMissingHandlersnow deletesroute_handler_definitionrows with NULLrouteIdor NULLmethodIdbefore re-seeding per-route CRUD defaults, surviving silent FK cascades frommethod_definitionresets. - Tightened
route_handler_definitionschema indata/snapshot.json:routeandmethodrelations are nowisNullable: falsewithonDelete: CASCADE. Fresh installs enforce handler integrity at the DB level; orphan handlers cannot exist. - Added
file_definition.validateBody=falseentry indata/data-migration.json.POST /file_definitionmultipart uploads are no longer rejected by zod body-validation — the custom handler derivesfilename,mimetype,filesizefromreq.file. - Converted remaining CommonJS
require()calls to ESimportacross auth services, routes, middleware, and provision layers for a uniform module graph. - Refactored
provision-schema-migration.tswith typed migration definitions (SchemaMigrationDef,TableMigrationDef,ColumnModifyDef,RelationModifyDef) and batched table migration application. - Hardened junction-table provisioning in
src/infrastructure/knex/utils/provision/junction-tables.tswith typedJunctionTableDefand cluster-safe create-if-missing semantics (detectsalready existsraces from concurrent instances).
Bug Fixes
- Fixed GET (and other method) handlers silently losing their
methodIdaftermethod_definitiontable resets. FK cascadeSET NULLorphaned handlers and the previousensureMissingHandlersgated re-seed on total handler count, hiding the issue. Self-heal now cleans orphans and re-seeds per-method. - Fixed
POST /file_definitionreturning400 "filename is required". Root cause was canonical-path body-validation firing for routes with custom Express handlers;validateBody=falsedisables auto-validation forfile_definitionwhich has a registered custom handler deriving file metadata server-side. - Fixed server blocking up to 5 seconds before surfacing a port conflict during
yarn devrestarts. Port-bind failure now fails fast. - Fixed test suite formatting inconsistencies in
logger.spec.ts,zod-from-metadata.spec.ts,zod-parse.spec.ts,body-validation-middleware.spec.ts,room-size.spec.ts, andvitest.setup.ts.