Skip to content

fix: backend type errors, re-enable excluded sources, drop build artifacts - #1021

Merged
ayomideadeniran merged 2 commits into
StellarDevHub:mainfrom
miss-yusrah:fix/backend-types
Aug 4, 2026
Merged

fix: backend type errors, re-enable excluded sources, drop build artifacts#1021
ayomideadeniran merged 2 commits into
StellarDevHub:mainfrom
miss-yusrah:fix/backend-types

Conversation

@miss-yusrah

Copy link
Copy Markdown
Contributor

closes #953
closes #956
closes #959
closes #964

Summary

  • Fix TypeScript narrowing bugs in Rust validation and Express query/param handling across controllers and routes
  • Re-enable typechecking for previously excluded backend sources (search, canvas, courses, freelance, BFF, mock subscriptions)
  • Remove ~1.1MB+ of committed build/compiler scratch files and tighten .gitignore

Task 1 — rust-validation.ts

  • Removed @ts-nocheck
  • Narrowed line[columnIndex] with a default (?? '') before property-key use
  • Added safe defaults for pairs[opener.char] so string | undefined never flows into PropertyKey / string slots

Task 2 — Express string | string[] | undefined safety

  • Added shared helpers in backend/src/utils/queryParams.ts (getQueryString, getQueryInt, getQueryBoolean)
  • Applied them in:
    • hash.controller.ts
    • p2p.controller.ts
    • voting.controller.ts
    • license.routes.ts
    • explorer.routes.ts
    • simulatorErrors.routes.ts
  • Removed @ts-nocheck from all of the above
  • Runtime behavior preserved (same defaults / validation paths)

Task 3 — Excluded backend files

Removed from tsconfig.json exclude (fixed and typechecked):

  1. src/routes/courses.ts
  2. src/routes/freelance.ts
  3. src/services/bff.service.ts
  4. src/routes/subscriptions.ts
  5. src/routes/canvas.routes.ts
  6. src/routes/search/**/*
  7. src/search/**/*

Notable fixes:

  • Search: Zod 4 z.record(key, value), ZodError.issues, filter/in typing, pagination nextCursor, sort field narrowing
  • Canvas: JSON collaborators helpers, required collaborators: [] on create, param narrowing
  • Courses: stable CourseView mapping for Prisma nullables / extra fields

Still excluded (temporary @ts-nocheck + follow-up needed):

  • subscription.controller.ts
  • subscriptions.routes.ts
  • subscription.service.ts
  • middleware/auth.ts

These still depend on Prisma models (User, Subscription, SubscriptionPlan, etc.) that are not in schema.prisma.

Task 4 — Cleanup build artifacts

Removed tracked scratch files including:

  • contracts/check_output*.json, contracts/errors*.json, contracts/test_output.txt, contracts/check_errors.txt
  • backend/build*.log, backend/ts_errors.txt, backend/test_output.log, root build.log

Updated .gitignore for *.log, contracts/check_output*.json, contracts/errors*.json, and related test/compiler outputs. No CI references to these files were found.

Test plan

  • cd backend && npx tsc -p tsconfig.json --noEmit (task files should be clean; preexisting unrelated errors may remain)
  • Spot-check license/explorer/p2p/voting/hash query routes still accept normal query strings
  • Confirm canvas create/list and course CRUD still respond as before
  • Confirm CI does not require the deleted contract/build log files

@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

@miss-yusrah is attempting to deploy a commit to the Ayomide Adeniran's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@miss-yusrah 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

@ayomideadeniran

Copy link
Copy Markdown
Contributor

pr under review

@ayomideadeniran
ayomideadeniran merged commit 96ca07c into StellarDevHub:main Aug 4, 2026
1 check failed
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