Skip to content

fix(event): remove all any casts — typed authenticate, user.id, and Prisma error narrowing #248

fix(event): remove all any casts — typed authenticate, user.id, and Prisma error narrowing

fix(event): remove all any casts — typed authenticate, user.id, and Prisma error narrowing #248

Triggered via pull request June 17, 2026 13:56
@SrejoyeSrejoye
opened #595
Status Failure
Total duration 1m 3s
Artifacts

ci.yml

on: pull_request_target
detect-changes
7s
detect-changes
comment-results
8s
comment-results
Fit to window
Zoom out
Zoom in

Annotations

25 errors and 3 warnings
backend-ci
Process completed with exit code 1.
backend-ci
Process completed with exit code 2.
backend-ci
Argument of type '(request: FastifyRequest<{ Params: { slug: string; }; }>, reply: FastifyReply) => Promise<never>' is not assignable to parameter of type 'RouteHandlerMethod<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, RouteGenericInterface, unknown, FastifySchema, FastifyTypeProviderDefault, FastifyBaseLogger>'.
backend-ci
Argument of type '(request: FastifyRequest<{ Params: { slug: string; }; }>, reply: FastifyReply) => Promise<never>' is not assignable to parameter of type 'RouteHandlerMethod<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, RouteGenericInterface, unknown, FastifySchema, FastifyTypeProviderDefault, FastifyBaseLogger>'.
backend-ci
Argument of type '(request: FastifyRequest<{ Body: { name: string; description?: string; startDate: string; location: string; endDate: string; isPublic?: boolean; }; }>, reply: FastifyReply) => Promise<...>' is not assignable to parameter of type 'RouteHandlerMethod<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, RouteGenericInterface, unknown, FastifySchema, FastifyTypeProviderDefault, FastifyBaseLogger>'.
src/__tests__/event.test.ts > Events API > POST /api/events — create event > 400 — rejects location shorter than 2 characters: apps/backend/src/__tests__/event.test.ts#L123
TypeError: Cannot read properties of undefined (reading 'close') ❯ src/__tests__/event.test.ts:123:15
src/__tests__/event.test.ts > Events API > POST /api/events — create event > 400 — rejects location shorter than 2 characters: apps/backend/src/routes/event.ts#L60
FastifyError: preHandler hook should be a function, instead got [object Undefined] ❯ Object.addNewRoute node_modules/fastify/lib/route.js:308:23 ❯ Object.route node_modules/fastify/lib/route.js:263:23 ❯ Object.prepareRoute node_modules/fastify/lib/route.js:172:18 ❯ Object._post [as post] node_modules/fastify/fastify.js:193:34 ❯ eventRoutes src/routes/event.ts:60:9 ❯ Plugin.exec node_modules/avvio/lib/plugin.js:125:28 ❯ Boot._loadPlugin node_modules/avvio/boot.js:446:10 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { code: 'FST_ERR_HOOK_INVALID_HANDLER', statusCode: 500 }
src/__tests__/event.test.ts > Events API > POST /api/events — create event > 400 — rejects missing location: apps/backend/src/__tests__/event.test.ts#L123
TypeError: Cannot read properties of undefined (reading 'close') ❯ src/__tests__/event.test.ts:123:15
src/__tests__/event.test.ts > Events API > POST /api/events — create event > 400 — rejects missing location: apps/backend/src/routes/event.ts#L60
FastifyError: preHandler hook should be a function, instead got [object Undefined] ❯ Object.addNewRoute node_modules/fastify/lib/route.js:308:23 ❯ Object.route node_modules/fastify/lib/route.js:263:23 ❯ Object.prepareRoute node_modules/fastify/lib/route.js:172:18 ❯ Object._post [as post] node_modules/fastify/fastify.js:193:34 ❯ eventRoutes src/routes/event.ts:60:9 ❯ Plugin.exec node_modules/avvio/lib/plugin.js:125:28 ❯ Boot._loadPlugin node_modules/avvio/boot.js:446:10 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { code: 'FST_ERR_HOOK_INVALID_HANDLER', statusCode: 500 }
src/__tests__/event.test.ts > Events API > POST /api/events — create event > 400 — rejects missing required fields (no dates, no location): apps/backend/src/routes/event.ts#L60
FastifyError: preHandler hook should be a function, instead got [object Undefined] ❯ Object.addNewRoute node_modules/fastify/lib/route.js:308:23 ❯ Object.route node_modules/fastify/lib/route.js:263:23 ❯ Object.prepareRoute node_modules/fastify/lib/route.js:172:18 ❯ Object._post [as post] node_modules/fastify/fastify.js:193:34 ❯ eventRoutes src/routes/event.ts:60:9 ❯ Plugin.exec node_modules/avvio/lib/plugin.js:125:28 ❯ Boot._loadPlugin node_modules/avvio/boot.js:446:10 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { code: 'FST_ERR_HOOK_INVALID_HANDLER', statusCode: 500 }
src/__tests__/event.test.ts > Events API > POST /api/events — create event > 401 — rejects unauthenticated request: apps/backend/src/__tests__/event.test.ts#L123
TypeError: Cannot read properties of undefined (reading 'close') ❯ src/__tests__/event.test.ts:123:15
src/__tests__/event.test.ts > Events API > POST /api/events — create event > 401 — rejects unauthenticated request: apps/backend/src/routes/event.ts#L60
FastifyError: preHandler hook should be a function, instead got [object Undefined] ❯ Object.addNewRoute node_modules/fastify/lib/route.js:308:23 ❯ Object.route node_modules/fastify/lib/route.js:263:23 ❯ Object.prepareRoute node_modules/fastify/lib/route.js:172:18 ❯ Object._post [as post] node_modules/fastify/fastify.js:193:34 ❯ eventRoutes src/routes/event.ts:60:9 ❯ Plugin.exec node_modules/avvio/lib/plugin.js:125:28 ❯ Boot._loadPlugin node_modules/avvio/boot.js:446:10 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { code: 'FST_ERR_HOOK_INVALID_HANDLER', statusCode: 500 }
src/__tests__/event.test.ts > Events API > POST /api/events — create event > 201 — creates event and returns it for authenticated organizer: apps/backend/src/routes/event.ts#L60
FastifyError: preHandler hook should be a function, instead got [object Undefined] ❯ Object.addNewRoute node_modules/fastify/lib/route.js:308:23 ❯ Object.route node_modules/fastify/lib/route.js:263:23 ❯ Object.prepareRoute node_modules/fastify/lib/route.js:172:18 ❯ Object._post [as post] node_modules/fastify/fastify.js:193:34 ❯ eventRoutes src/routes/event.ts:60:9 ❯ Plugin.exec node_modules/avvio/lib/plugin.js:125:28 ❯ Boot._loadPlugin node_modules/avvio/boot.js:446:10 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { code: 'FST_ERR_HOOK_INVALID_HANDLER', statusCode: 500 }
backend-ci: apps/backend/src/routes/event.ts#L3
`../validations/event.validation` import should occur after import of `../utils/error.util`
backend-ci: apps/backend/src/routes/event.ts#L2
There should be at least one empty line between import groups
backend-ci: apps/backend/src/routes/event.ts#L1
`fastify` type import should occur after import of `../utils/error.util`
backend-ci: apps/backend/src/routes/event.ts#L1
There should be at least one empty line between import groups
backend-ci: apps/backend/src/__tests__/event.test.ts#L68
'mockJwtVerify' is never reassigned. Use 'const' instead
backend-ci: apps/backend/src/__tests__/event.test.ts#L3
`@prisma/client` import should occur before import of `vitest`
backend-ci: apps/backend/src/__tests__/event.test.ts#L3
There should be at least one empty line between import groups
backend-ci: apps/backend/src/__tests__/event.test.ts#L3
Imports "PrismaClient" are only used as type
backend-ci: apps/backend/src/__tests__/event.test.ts#L2
`fastify` import should occur before import of `vitest`
backend-ci: apps/backend/src/__tests__/event.test.ts#L2
Imports "FastifyInstance" are only used as type
backend-ci: apps/backend/src/routes/event.ts#L59
Missing return type on function
backend-ci: apps/backend/src/__tests__/event.test.ts#L476
Missing return type on function
backend-ci: apps/backend/src/__tests__/event.test.ts#L97
Missing return type on function