Commit History
-
feat(admin): add Direct Setup button for super admins on orgs without phone numberβ
CognxSafeTrack- Add "Direct Setup" button (super admin only) on /clients for orgs without a WhatsApp number - Previously the setup modal was only reachable via the Reconfigure button (orgs with a phone) - Add i18n keys: clients.actions.direct_setup (en/fr/pt) - Add scratch scripts for org configuration and DB queries - Add doc: configurer-token-nouvelle-org.md β how to configure a Meta token on a new orga3df350
-
refactor(worker): Sprint 2 β dead code removal and queue consolidationβ
CognxSafeTrack +1: Claude Sonnet 4.6H1: Delete credit-guard.ts (worker) and credit-cache.ts (api) β both fully superseded by wallet.ts/requireCredits.ts since the wallet migration. H6: Introduce lib/queues.ts with shared whatsappQueue and notificationQueue instances. Replace all 10 inline `new Queue(...)` calls across wallet.ts, usage-tracker.ts, whatsapp-logic.ts, scheduler.ts, and 4 handlers. Removes 10 redundant Redis connections; drops `q.close()` calls on ephemeral instances that were killing the shared connection. Shutdown handler now explicitly closes both shared queues. Scratch: Move apps/api/scratch/ one-shot DB scripts to scripts/db-ops/ so they don't ship in the production API bundle. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>37fb9ce
-
fix(onboarding): use user.activity guard instead of activeEnrollment for sector selectionβ
CognxSafeTrack +1: Claude Sonnet 4.6After INSCRIPTION hard reset, a stale enroll-user job in BullMQ can re-create an enrollment before the user's sector selection arrives. The old guard (!activeEnrollment) caused SEC_* messages to fall through to ExerciseHandler, which replied "Your answer is a bit short" instead of saving the sector. Using !user.activity is the correct signal: it is nulled out during INSCRIPTION reset and stays null until the sector is saved, regardless of enrollment state. Also adds apps/api/scratch/rotate_encryption_key.ts β a key-rotation script for the ERR_OSSL_BAD_DECRYPT issue: decrypts org secrets with OLD_ENCRYPTION_SECRET and re-encrypts with NEW_ENCRYPTION_SECRET, idempotently. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>3d23b2d