Skip to content

fix: resolve typescript errors by correcting imports, updating DTOs, … - #524

Open
akinboyewaSamson wants to merge 2 commits into
JSE-ORG:devfrom
akinboyewaSamson:fix/notification-retry-queue-catch
Open

fix: resolve typescript errors by correcting imports, updating DTOs, …#524
akinboyewaSamson wants to merge 2 commits into
JSE-ORG:devfrom
akinboyewaSamson:fix/notification-retry-queue-catch

Conversation

@akinboyewaSamson

Copy link
Copy Markdown

closes #488

Description This PR fixes a critical syntax error in src/notifications/notification-retry-queue.service.ts that was accidentally introduced during a previous merge (#483) where the catch block of processInProcess was overwritten by an inner retry loop. This broke the TypeScript compiler across the entire project (failing with TS1472: 'catch' or 'finally' expected) and caused the notification module tests to crash.

Additionally, this PR fixes several pre-existing typing and pathing errors across the dev branch to ensure npm run typecheck exits cleanly (0), unblocking all CI pipelines and future development.

Changes Made

Notifications:
Removed the duplicate inner loop in NotificationRetryQueueService.processInProcess.
Restored the missing catch block to correctly capture lastError, record the failure state in the database, compute exponential backoff delays, and sleep.
Testing:
Updated test/unit/notification-retry-queue.service.spec.ts with explicit cases verifying that the dispatcher is called exactly attempts times when every attempt throws, and exactly once when the first attempt succeeds.
Global Types & Config:
Fixed broken DTO import paths in analytics.service.ts and admin-disputes-paginated-response.dto.ts.
Refactored ReadinessResponseDto in the Swagger configuration to correctly nest DTO classes instead of invalid $ref schemas.
Corrected config tests in config.module.spec.ts to allow testing optional values safely.
Integrated the missing count handler into the in-memory Prisma client mock (prisma.service.ts) for testing reliability.
Fixed test paths to the bearer() auth helper.
Acceptance Criteria Verified

npm run typecheck exits 0 without any errors.
processInProcess contains exactly one retry loop.
The catch branch correctly captures lastError, evaluates attempts, and triggers backoff sleep logic.
test/unit/notification-retry-queue.service.spec.ts successfully runs and passes.
Dedicated test cases verify the exact dispatcher invocation counts on success and on repeated failure.

…refining types, and adding missing Prisma service methods.
@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@akinboyewaSamson 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! 🚀

Learn more about application limits

@Omoboi-dev

Copy link
Copy Markdown
Contributor

resolve you conflicts

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.

dev does not compile: a duplicated retry loop was merged into the notification retry queue

3 participants