Skip to content

feat: indexer feature flag startup check, readiness latency, route-safe error mapping#1

Closed
davedumto wants to merge 1 commit into
mainfrom
chore/indexer-flags-readiness-error-mapping
Closed

feat: indexer feature flag startup check, readiness latency, route-safe error mapping#1
davedumto wants to merge 1 commit into
mainfrom
chore/indexer-flags-readiness-error-mapping

Conversation

@davedumto
Copy link
Copy Markdown
Owner

Summary

Bundles three small, scoped server changes from the Stellar Wave queue:

Tests

  • 22 new Jest specs across route-error.utils.test.ts, health.controllers.test.ts and indexer-flags-startup-check.utils.test.ts — all green.
  • tsc --noEmit clean. ESLint clean on changed files.

Test plan

  • pnpm exec jest src/utils/route-error.utils.test.ts src/modules/health/health.controllers.test.ts src/utils/indexer-flags-startup-check.utils.test.ts passes
  • pnpm exec tsc --noEmit is clean
  • curl localhost:3000/api/v1/health/ready includes a numeric top-level latencyMs
  • Setting ENABLE_INDEXER_DLQ=true ENABLE_INDEXER_DEDUPE=false pnpm dev refuses to start with a logged issues list

Closes

closes accesslayerorg#245
closes accesslayerorg#242
closes accesslayerorg#213

…fe error mapping

- Add shared mapUnknownRouteError helper for the global error-middleware
  fallback path, embedding the request id for log correlation and hiding
  internals in production. Known-error branches (Zod, JWT, Prisma,
  ApiError, payload-too-large, malformed JSON) are unchanged.
- Surface a top-level latencyMs field on GET /api/v1/health/ready
  measuring the total readiness probe duration. Per-check latency is
  preserved.
- Introduce ENABLE_INDEXER_DEDUPE, ENABLE_INDEXER_DLQ and
  ENABLE_INDEXER_CURSOR_STALENESS_WARNING flags plus a centralized
  startup validator that aggregates every cross-field invariant breach
  into one actionable error and exits with code 1 on misconfiguration.
- Add Jest tests for each helper and short docs covering the new
  envelope, the readiness metadata field and the indexer flag matrix.
@davedumto
Copy link
Copy Markdown
Owner Author

Superseded by upstream PR accesslayerorg#259.

@davedumto davedumto closed this Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant