Skip to content

Add async job queue and scheduler infrastructure - #141

Merged
buzz-code merged 2 commits into
mainfrom
claude/queue-async-worker-plan-2jmoef
Aug 19, 2026
Merged

buzz-code merged 2 commits into
mainfrom
claude/queue-async-worker-plan-2jmoef

Conversation

@buzz-code

@buzz-code buzz-code commented Aug 19, 2026 •

Copy link
Copy Markdown
Owner

What

Adopts the shared async job queue + scheduler infrastructure, already merged into nra-server (#29) and nra-client (#37), and already wired into event-management-nra and student-report-nra.

Changes

  • Bump server/shared and client/shared to the merged commits carrying the job queue, worker, scheduler, and shared client Job/Schedule screens.
  • Server deps: @nestjs/schedule, cron-parser.
  • Migration 1787100000000-addJobsAndSchedulesTables — creates jobs and schedules tables (idempotent CREATE TABLE IF NOT EXISTS, DDL validated against real MySQL).
  • Client: nothing to wire — the Job monitor and Schedule CRUD screens appear automatically via CommonAdminResources (admin-gated), which this app already uses. No App.jsx changes needed.
  • Roadmap entry.

How to use it

  1. Set WORKER_ENABLED=true on the server instance that should process jobs (nothing runs until this is set).
  2. Trigger a job either from a doAction handler (jobService.enqueue(userId, type, payload)) or a recurring Schedule row (data-driven, no redeploy).
  3. Watch it in the admin Jobs screen.

See nra-server's utils/jobs/ for the handler contract and the two shipped handlers (cleanup-old-jobs, user-data-export).

Testing

All verified on a fresh clone of this exact branch (fresh yarn install, real submodule checkout — no local shortcuts):

  • tsc --noEmit: 0 errors.
  • yarn test: 963/963 passing.
  • yarn test:e2e: 4/4 passing.
  • Migration DDL validated directly against a real MySQL instance (MariaDB 10.11): both tables + all indexes created successfully.

🤖 Generated with Claude Code

https://claude.ai/code/session_011dEYULADLgGNfZ4nv6gz8s

Adopts the shared job queue + scheduler from nra-server
(buzz-code/nra-server#29) and its client counterpart from nra-client
(buzz-code/nra-client#37).

- Bump server/shared and client/shared to the commits with the job
  queue, scheduler, and shared Job/Schedule client entities
- Server deps: @nestjs/schedule, cron-parser
- Migration creating jobs and schedules tables (idempotent
  CREATE TABLE IF NOT EXISTS, validated against real MySQL)
- Job monitor and Schedule CRUD screens appear automatically via
  CommonAdminResources (admin-gated) — no App.jsx changes needed
- Roadmap entry

Worker is opt-in via WORKER_ENABLED=true; nothing runs until set.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011dEYULADLgGNfZ4nv6gz8s
Copilot AI lite review requested due to automatic review settings August 19, 2026 10:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adopt shared async job queue + scheduler infra in app. Adds server deps + DB schema so shared Jobs/Schedules features can run, plus roadmap note.

Changes:

  • Add server deps: @nestjs/schedule, cron-parser
  • Add TypeORM migration creating jobs + schedules tables
  • Add roadmap entry for background tasks infra

Reviewed changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated 1 comment.

File Description
server/package.json Add Nest schedule + cron parsing deps required by shared worker/scheduler
server/yarn.lock Lock new deps (@nestjs/schedule, cron-parser, transitive luxon/uuid)
server/src/migrations/1787100000000-addJobsAndSchedulesTables.ts Create jobs + schedules tables used by shared infra
client/src/roadmapFeatures.js Mark background-jobs infra as done in roadmap
Files not reviewed (1)
  • client/src/roadmapFeatures.js: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +13 to +14
\`payload\` text NULL,
\`result\` text NULL,
jobs.result can hold a base64-encoded zip from the user-data-export
handler when S3 isn't configured, which routinely exceeds MySQL
text's 64KB limit. Widen to longtext (matches the entity-side fix in
buzz-code/nra-server#38, picked up by the server/shared bump).

Verified against real MySQL: a longtext column now accepts a 200KB
value that the previous text column would have rejected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011dEYULADLgGNfZ4nv6gz8s
@buzz-code
buzz-code merged commit cbb2703 into main Aug 19, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants