Telegram: https://t.me/+DOylgFv1jyJlNzM0
Why this matters
backend/src/controllers/sse.controller.ts has three small correctness/consistency issues:
clientId uses Math.random().toString(36).substr(2, 9) — String.prototype.substr is deprecated; use slice/substring.
- The catch block returns
error.errors for ZodErrors, but Zod's error object exposes .issues (.errors is an alias that is being phased out and is empty under newer Zod), so validation 400s may return an empty errors array.
subscribeSchema only parses streams and all, but the /v1/events/subscribe OpenAPI docs advertise a users query param — it is silently dropped here.
Acceptance criteria
Files to touch
backend/src/controllers/sse.controller.ts
backend/src/routes/v1/events.routes.ts (if dropping the documented users param)
Out of scope
- SSE broadcast/heartbeat logic.
Telegram: https://t.me/+DOylgFv1jyJlNzM0
Why this matters
backend/src/controllers/sse.controller.tshas three small correctness/consistency issues:clientIdusesMath.random().toString(36).substr(2, 9)—String.prototype.substris deprecated; useslice/substring.error.errorsfor ZodErrors, but Zod's error object exposes.issues(.errorsis an alias that is being phased out and is empty under newer Zod), so validation 400s may return an emptyerrorsarray.subscribeSchemaonly parsesstreamsandall, but the/v1/events/subscribeOpenAPI docs advertise ausersquery param — it is silently dropped here.Acceptance criteria
substrwithsliceerror.issues(and/orinstanceof z.ZodError) when building the 400 bodyusersinsubscribeSchemaor remove it from the OpenAPI docs inroutes/v1/events.routes.tsFiles to touch
backend/src/controllers/sse.controller.tsbackend/src/routes/v1/events.routes.ts(if dropping the documentedusersparam)Out of scope