Spaces:
Paused

CognxSafeTrack Claude Sonnet 4.6 commited on
Commit
2859b85
Β·
1 Parent(s): ec9b5da

fix: batch scheduler updates, typed JWT user, log catch blocks, move script

Browse files

- scheduler.ts: collect completed enrollment IDs in loop, single updateMany
after β€” eliminates N queries per day for completions
- ContentHandler.ts: log Redis cache failures instead of swallowing silently
- index.ts: remove (request as any).user cast β€” now safe via FastifyJWT
augmentation in types/fastify.d.ts
- types/fastify.d.ts: augment @fastify/jwt FastifyJWT interface so request.user
resolves to {id, role, organizationId} after jwtVerify(), not string|object|Buffer
- delete-user.ts: moved from apps/api root to apps/api/scripts/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

5 files changed +29 -18
Files changed (5)
apps/api/delete-user.ts β†’ apps/api/scripts/delete-user.tsRenamed
File without content changes
apps/api/src/index.ts+1-1
apps/api/src/types/fastify.d.ts+10-5
apps/whatsapp-worker/src/handlers/ContentHandler.ts+3-1
apps/whatsapp-worker/src/scheduler.ts+15-11