Skip to content

fix: repair red CI (Express 5 validation, pagination, build config, frontend types)#1048

Closed
ogazboiz wants to merge 1 commit into
mainfrom
fix/express5-validation-and-ci-green
Closed

fix: repair red CI (Express 5 validation, pagination, build config, frontend types)#1048
ogazboiz wants to merge 1 commit into
mainfrom
fix/express5-validation-and-ci-green

Conversation

@ogazboiz
Copy link
Copy Markdown
Contributor

@ogazboiz ogazboiz commented Jun 1, 2026

Summary

CI on main was red. This restores it to green so contributors can build on a passing baseline. The fixes include real runtime bugs, not just test tweaks.

Backend

  • Express 5 validation (production bug): req.query and req.params are getter-only in Express 5, so req[source] = schema.parse(...) threw, and every route using validateQuery/validateParams returned 500. They are now shadowed with Object.defineProperty so coerced and validated values persist for handlers.
  • Pagination coercion: parsePositiveInteger only accepted strings, but the Zod query schema coerces limit to a number, so ?limit=N silently fell back to the default. It now accepts coerced numbers too.
  • Build script: build pointed at the noEmit: true, test-including tsconfig, so it failed and emitted no dist/. It now uses tsconfig.build.json (emits production code, excludes tests).
  • Test fixes: removed a shadowed mockQuery in remittanceService, keyed the digest mock by user id (a user has one digest frequency), completed the db/connection ESM mocks, and aligned the LoanRequested test event with the actual contract emission (Symbol, loan_id, borrower) plus its supported-types mock.

Frontend

  • CreditScoreGauge: removed a duplicated component body left by a bad merge, which caused variable redeclarations and a rules-of-hooks violation.
  • Charts: switched the custom tooltips to recharts 3 TooltipContentProps with a function content prop.

Verification (local)

  • Backend: lint, typecheck, build, tests (327 passed)
  • Frontend: prettier, typecheck, tests (49 passed), build
  • Contracts: fmt, clippy, tests, wasm size budget, tarpaulin

https://t.me/+DOylgFv1jyJlNzM0

… config, frontend types

Backend
- validation: req.query/req.params are getter-only in Express 5, so reassigning
  them threw and every validateQuery/validateParams route returned 500. Shadow
  them with Object.defineProperty so coerced/validated values persist.
- pagination: parsePositiveInteger now accepts Zod-coerced numbers, so ?limit=N
  is honored instead of silently falling back to the default.
- build script points at tsconfig.build.json so it emits dist/ and excludes
  tests (previously used the noEmit, test-including config and failed).
- tests: fix shadowed mockQuery in remittanceService, key digest mock by user,
  complete db/connection ESM mocks, and align LoanRequested event shape with the
  contract emission (Symbol, loan_id, borrower) plus its supported-types mock.

Frontend
- CreditScoreGauge: remove duplicated component body left by a bad merge
  (variable redeclarations and a rules-of-hooks violation).
- charts: use recharts 3 TooltipContentProps with a function content prop.
@ogazboiz
Copy link
Copy Markdown
Contributor Author

ogazboiz commented Jun 1, 2026

closing — main is now green (RemitLend CI success on e3adff0) so the CI repair this PR represented either landed through other PRs or is no longer applicable. starting fresh is cleaner than rebasing a multi-file diff with conflicts.

@ogazboiz ogazboiz closed this Jun 1, 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

Development

Successfully merging this pull request may close these issues.

1 participant