fix: replace as any casts with proper TypeScript types, fix webhook retry query, replace console with logger, add webhook stats return type - #507
Merged
DeFiVC merged 5 commits intoSep 30, 2026
Conversation
… retry query, replace console with logger, add webhook stats return type This commit addresses issues ChainLearnOfficial#469, ChainLearnOfficial#470, ChainLearnOfficial#471, and ChainLearnOfficial#472: - ChainLearnOfficial#469: Replace all `as any` casts with proper TypeScript types for improved type safety - Define AuthenticatedRequest and VersionedRequest interfaces for request augmentation - Use proper types from database schema (Webhook, WebhookAttempt) - Replace error handling with `unknown` and type guards - Use `unknown` for payload casting in webhook dispatcher - ChainLearnOfficial#470: Fix incorrect Drizzle ORM query syntax in processWebhookRetries - Replace callback-based where clause with proper Drizzle operators - Use and(), lte(), isNull() for correct query construction - ChainLearnOfficial#471: Replace console.warn/error with structured logger in config/index.ts - Import logger from utils/logger.js - Replace console.warn with logger.warn - Replace console.error with logger.error - ChainLearnOfficial#472: Add proper return type to getWebhookStats method - Define WebhookStats interface in webhook.types.ts - Update method signature to return Promise<WebhookStats> - Export WebhookStats interface for use by consumers
|
@Cyber-Mitch 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! 🚀 |
Fixed ESLint errors in e2e test files by removing duplicate vitest type references and duplicate FastifyInstance imports. This allows the CI lint workflow to pass.
Cyber-Mitch
force-pushed
the
chore/273-274-275-272-batch-fixes-v2
branch
from
September 30, 2026 02:47
218102a to
d777ca3
Compare
Added NODE_ENV=test to CI workflow environment variables to prevent config loading errors in tests. Replaced invalid Stellar secret key fallback values ("test") with valid Stellar secret key format that matches the Zod schema regex requirement. This ensures tests can load config properly without validation errors.
Cyber-Mitch
force-pushed
the
chore/273-274-275-272-batch-fixes-v2
branch
from
September 30, 2026 02:57
dffecd3 to
d6f7dc2
Compare
4 tasks
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.
This PR addresses issues #469, #470, #471, and #472:
#469: Replace
as anycasts with proper TypeScript typessrc/middleware/rate-limit.ts,src/modules/admin/webhook.service.ts,src/services/webhook-dispatcher.ts,src/routes/versioning.ts,src/stellar/transactions.ts,src/stellar/client.ts,src/middleware/response-envelope.ts,src/middleware/validation.ts,src/database/schema.tsAuthenticatedRequestandVersionedRequestinterfaces for request augmentationWebhookandWebhookAttemptfrom database schemaunknownand proper type guardsunknownfor payload casting in webhook dispatcheras anywith proper typed interfaces throughout the codebaseas anycasts remain in the codebaseunknown#470: Fix webhook retry query in processWebhookRetries
src/services/webhook-dispatcher.tsprocessWebhookRetriesfunctionand(),lte(),isNull()for correct query construction#471: Replace console.log/warn/error with logger in config/index.ts
src/config/index.tsloggerfrom../utils/logger.jsconsole.warnwithlogger.warn(line 99)console.errorwithlogger.error(line 122)console.warnorconsole.errorcalls remain in config/index.ts#472: Add return type to webhook getWebhookStats method
src/modules/admin/webhook.service.ts,src/modules/admin/webhook.types.tsWebhookStatsinterface inwebhook.types.tsgetWebhookStatsmethod signature to returnPromise<WebhookStats>WebhookStatsinterface is defined in webhook.types.tsanyTesting
This closes #469
This closes #470
This closes #471
This closes #472