Skip to content

feat: query metrics extension, retry utility, and DTO input sanitization - #380

Merged
Cjay-Cyber-2 merged 1 commit into
mainfrom
fix/pr-368-metrics-retry-sanitization
Sep 29, 2026
Merged

Cjay-Cyber-2 merged 1 commit into
mainfrom
fix/pr-368-metrics-retry-sanitization

Conversation

@Cjay-Cyber-2

Copy link
Copy Markdown
Contributor

Conflict-free resolution of PR #368 changes onto current main.

Changes

New files:

  • src/database/query-metrics.extension.ts — Prisma extension that logs slow queries above slowQueryThresholdMs
  • src/database/query-metrics.extension.spec.ts — tests for the metrics extension
  • src/utils/retry.util.ts — retryWithBackoff using exponentialBackoffWithJitter
  • src/utils/retry.util.spec.ts — comprehensive retry utility tests
  • src/common/validators/text-field.sanitizer.ts — sanitizeTextField (collapse/trim whitespace)
  • src/common/validators/text-field.sanitizer.spec.ts — tests for text field sanitizer
  • src/modules/organizations/organization.dto.spec.ts — tests for organization Zod schemas

Modified files:

  • src/config/database.config.ts — add slowQueryThresholdMs to DatabaseConfig
  • src/config/env.validation.ts — add DATABASE_SLOW_QUERY_THRESHOLD_MS env var (default 1000ms)
  • src/database/prisma.service.ts — chain createQueryMetricsExtension before createQueryTimeoutExtension
  • src/database/prisma.service.spec.ts — chainable $extends mock + slowQueryThresholdMs: 1000
  • src/queues/dlq.processor.ts — wrap domainEvents.create with retryWithBackoff
  • src/queues/dlq.processor.spec.ts — add two retry test cases
  • src/integrations/stellar/horizon-stellar.client.ts — wrap loadAccount/getTransaction calls with retryWithBackoff
  • src/modules/organizations/organization.dto.ts — add .strict() and sanitizeTextField transforms to all schemas

🤖 Generated with Claude Code

https://claude.ai/code/session_012xRrTYwEy2y8yow4o8iUQ8


Generated by Claude Code

@Cjay-Cyber-2
Cjay-Cyber-2 merged commit 95a4b1b into main Sep 29, 2026
1 check failed
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.

1 participant