Skip to content
Back to snapcart-api report
Code QualityLow

Magic Number in Retry Window

src/services/retry.ts:8

What's going on

A bare 30000 appears in the retry scheduler with no explanation of what it represents.

Why it matters

Magic numbers make tuning impossible without archaeology.

src/services/retry.ts:8

Recommended Fix

Replace the inline query with a parameterized statement and validate the id before it ever reaches the database. A regression test is generated alongside the patch.

Before
1setInterval(flush, 30000);
After
1const RETRY_FLUSH_MS = 30_000;2setInterval(flush, RETRY_FLUSH_MS);
  1. Uploaddone
  2. Analyzedone
  3. Finddone
  4. Explainactive
  5. Fixupcoming
  6. Testupcoming
  7. Verifyupcoming