Repository navigation
fix: correct the type errors introduced in #1290 - #1292
Merged
github-actions[bot] merged 1 commit intoOct 17, 2026
Merged
Conversation
…rtdevs17#1290 Four defects introduced in Smartdevs17#1290 that the backend lint+test jobs do not catch because they only run eslint and vitest, neither of which type-checks: - fiat-crypto.ts: const conversions = Map<string, ConversionRecord>() was missing ew, which also made Array.from(conversions.values()) an unknown[] and broke the element types in listConversions. - payout-engine.ts: evaluatePayouts called the async materialiseBatch without awaiting it, so it pushed a Promise into the returned PayoutBatch[] and the try/catch could not observe a per-schedule failure. - routes/payouts.ts: eq.params.batchId is typed string | string[] under this Express version. The handlers now resolve the id once through requireId and reuse the validated string, which also removes the repeated param lookup. - Also replaced the === undefined rate/scale lookups with hasOwnProperty checks and moved the settlement amount parse into a helper, so neither can trip the type checker or trip over a definite-assignment analysis. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@SagaciousBoss 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! 🚀 |
|
@SagaciousBoss is attempting to deploy a commit to the smartdevs17's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1290, which merged with four type errors that only the Docker
buildjob (tsc) caught — the backend CI jobs run eslint and vitest, neither of which type-checks. #1290 passedBackend (Node.js 20)andBackend (Node.js 22).What was wrong
backend/src/services/fiat-crypto.ts—const conversions = Map<string, ConversionRecord>()was missingnew. That also madeArray.from(conversions.values())anunknown[], which broke the element types inlistConversions.backend/src/services/payouts/payout-engine.ts—evaluatePayoutscalled the asyncmaterialiseBatchwithout awaiting it, so it pushed aPromiseinto aPayoutBatch[], and the per-scheduletry/catchcould not observe a failure.backend/src/routes/payouts.ts—req.params.batchIdis typedstring | string[]under this Express version. The handlers now resolve the id once throughrequireIdand reuse the validated string, which also removes the repeated param lookup.Two smaller robustness changes while in the same code:
Object.prototype.hasOwnProperty.callrather than comparing the result toundefined, which keeps them honest if a rate is ever legitimately falsy.parseSettlementAmount, which collapses every failure mode onto the singleINVALID_SETTLEMENT_AMOUNTsentinel instead of relying on definite-assignment analysis across atry/catch.Scope
Three files, no behaviour change beyond fixing the above.
Backend (Node.js 20/22)on #1290 passed, so the test suite already covered this code; this commit makestscagree.Verification
npm run test --workspace backendandnpm run lint --workspace backend. The repository-widetscbuild has a large number of pre-existing errors unrelated to this change (missing modules, ungenerated Prisma client,websocket.ts,tax-engine.ts,featureFlagRegistry.tsand others); this commit removes the only ones introduced by #1290.Closes #1184
Closes #1185
Closes #1186