Skip to content

fix: apply body limits, throttler, synchronize:false, idempotency config#670

Open
Userhorlie wants to merge 2 commits into
Nexacore-Org:mainfrom
Userhorlie:fix/issues-557-558-559-560
Open

fix: apply body limits, throttler, synchronize:false, idempotency config#670
Userhorlie wants to merge 2 commits into
Nexacore-Org:mainfrom
Userhorlie:fix/issues-557-558-559-560

Conversation

@Userhorlie
Copy link
Copy Markdown
Contributor

Summary

Fixes four open issues in a single commit.

Issue #557 — Body size limits never applied

  • Retrieve limits.json and limits.urlencoded from ConfigService in main.ts
  • Apply via express.json({ limit }) and express.urlencoded({ limit }) middleware

Issue #559 — Rate limiting config unused

  • Install @nestjs/throttler
  • Wire ThrottlerModule.forRootAsync() in AppModule using rateLimit.windowMs / rateLimit.maxRequests config values
  • Register ThrottlerGuard globally via APP_GUARD
  • Add @SkipThrottle() on AppController (health/root endpoint)

Issue #560 — synchronize:true risks data loss

  • Set synchronize: false unconditionally in TypeOrmModule config
  • Add .github/workflows/ci.yml with a migration:dryrun step to catch missing migrations on every PR
  • Document migration workflow in README.md

Issue #558 — Idempotency TTL and cron hardcoded

  • Add IDEMPOTENCY_TTL_HOURS and IDEMPOTENCY_CLEANUP_CRON to env.validation.ts and configuration.ts
  • Inject ConfigService into IdempotencyService; TTL now reads from config (default 24h)
  • IdempotencyCleanupJob cron driven by IDEMPOTENCY_CLEANUP_CRON env var (default 0 0 * * *)
  • Document defaults in .env.example

Testing

  • npm run build passes with no errors

Closes #557
Closes #558
Closes #559
Closes #560

- Issue Nexacore-Org#557: retrieve limits.json/urlencoded from ConfigService in main.ts
  and apply via express.json/urlencoded middleware
- Issue Nexacore-Org#559: install @nestjs/throttler, wire ThrottlerModule.forRootAsync()
  in AppModule using rateLimit config, register ThrottlerGuard as APP_GUARD,
  add @SkipThrottle() on AppController
- Issue Nexacore-Org#560: set synchronize:false unconditionally in TypeORM config,
  add CI workflow with migration:dryrun step, document migration workflow in README
- Issue Nexacore-Org#558: inject ConfigService into IdempotencyService (TTL from env),
  make cleanup cron configurable via IDEMPOTENCY_CLEANUP_CRON env var,
  add IDEMPOTENCY_TTL_HOURS and IDEMPOTENCY_CLEANUP_CRON to env validation
  and configuration, document defaults in .env.example

Closes Nexacore-Org#557, Closes Nexacore-Org#558, Closes Nexacore-Org#559, Closes Nexacore-Org#560
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@Userhorlie Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment