Skip to content

Fix duplicate code blocks and merge artifacts causing compilation errors - #545

Merged
DeFiVC merged 1 commit into
ChainLearnOfficial:mainfrom
osasfaith:fix/schema-and-service-duplicates
Oct 1, 2026
Merged

DeFiVC merged 1 commit into
ChainLearnOfficial:mainfrom
osasfaith:fix/schema-and-service-duplicates

Conversation

@osasfaith

Copy link
Copy Markdown
Contributor

Closes #509, Closes #510, Closes #511, Closes #512

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring (no functional or behavioral changes)
  • Performance improvement
  • Documentation update
  • Build / CI configuration change
  • Dependency update
  • Other:

Summary

The codebase contains extensive merge artifacts where two versions of the same code were concatenated together, causing TypeScript compilation errors. This PR removes duplicate code blocks, duplicate imports, duplicate function definitions, and fixes syntax errors across11 source files.

Motivation / Context

Closes #509, Closes #510, Closes #511, Closes #512

The issues describe duplicate table definitions, duplicate function signatures, duplicate imports, and duplicate keys. While the specific files and line numbers mentioned in the issues don't match the current codebase (the code has been updated since the issues were created), the same type of merge artifact problems exist throughout the codebase. This PR fixes all the merge artifacts found in the source files.

Changes

Files fixed:

  • src/stellar/client.ts — Removed 3 duplicate catch blocks in submitTransaction, accountExists, getTransaction, and checkSorobanHealth methods
  • src/stellar/transactions.ts — Removed duplicate catch block in contract invocation
  • src/modules/admin/admin-users.service.ts — Removed duplicate error handling code block in deductCredits
  • src/modules/admin/webhook.service.ts — Removed duplicate drizzle-orm imports
  • src/modules/credentials/credential.service.ts — Fixed syntax error (fontSize(12.') → fontSize(12))
  • src/modules/quizes/quiz.service.ts — Removed duplicate class definition and fixed missing closing brace
  • src/modules/quizzes/quiz.controller.ts — Removed duplicate archiveModuleQuiz method and fixed JSDoc comment
  • src/modules/rewards/reward.service.ts — Removed duplicate error handling code and added missing closing braces
  • src/services/webhook-dispatcher.ts — Removed duplicate first version of file and orphaned code
  • src/middleware/auth.ts — Removed duplicate adminGuard function and duplicate imports
  • src/config/index.ts — Removed duplicate properties in test mode config object

Testing

Run npm run typecheck to verify the fixes. Note: There are still remaining compilation errors in the codebase that are unrelated to merge artifacts (missing methods on CourseService, NestJS decorators in Fastify project, etc.). These are pre-existing issues that need separate attention.

Tradeoffs

Focused on fixing merge artifacts only — did not address other compilation errors like missing methods or NestJS/Fastify mismatches.

Out of scope

  • Fixing all377 remaining TypeScript errors (many are in test files or require architectural changes)
  • Adding missing methods to CourseService
  • Resolving NestJS/Fastify framework mismatches

… files

- Remove duplicate catch blocks in stellar/client.ts and stellar/transactions.ts
- Remove duplicate code blocks in admin-users.service.ts and reward.service.ts
- Remove duplicate method in quiz.controller.ts
- Remove duplicate imports in webhook.service.ts and webhook-dispatcher.ts
- Remove duplicate adminGuard function in auth.ts
- Remove duplicate properties in config/index.ts
- Fix syntax errors in credential.service.ts and quiz.service.ts
- Fix missing closing braces in reward.service.ts and quiz.service.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants