Repository navigation
fix: repair broken main baseline (tsc 373 -> 0) - #576
Conversation
origin/main (58e4df1) does not compile: 373 TypeScript errors, including syntax-level breakage in claims.cache.ts, event-indexer.service.ts, notifications.service.ts and websocket.service.ts. This repairs that baseline so this branch is reviewable and buildable. Syntax / structural repairs - Restore pre-merge versions of the four files auto-merge corrupted - Remove duplicate Redis set methods, main.ts bootstrap, database module metadata/class, and fix invalid JS regex in the redaction util - Re-nest the orphaned evidence integration describe block - Move deterministic-rpc-failover.service.ts under src/blockchain/ - Replace broken uuid imports with Node randomUUID TypeORM 1 / BullMQ 6 migration - find({ order, take: 1 }) instead of findOne({ order }) for checkpoints - Object syntax for relations/select; drop unsupported foreignKeys metadata - accept extended SQLITE_CONSTRAINT* codes in duplicate detection - upsertJobScheduler for recurring jobs; drop invalid paused job types - better-sqlite3 for sqlite driver in all configs and explicit requires Deps / codegen - Add better-sqlite3; regenerate package-lock - Add Prisma BlockCursor/BlockCursorAncestor/ChainEvent models + regenerate Type correctness - AuditLog.userId is nullable; propagate through service and controller - Reconcile duplicate NotificationCategory/NotificationPriority enums on the entity to the ones the service actually writes - Widen redactSensitiveData to unknown (it already String()s non-strings) - Express 5 read-only req.ip/req.ips override; narrow CORS origin union - Spec fixes: CacheHealthService arg, isInitialized readonly, jest mock casts, DisputeOutcome.CONFIRMED, ProjectionFreshness partial double, Claim fixtures Verified: tsc --noEmit 0 errors, nest build passes, prisma validate passes. Known pre-existing issues (not introduced here, left in place) - ~1.4k lint errors, almost all type-aware no-unsafe-* across untouched files - 159/177 jest suites cannot load @nestjs/common v12 (ESM-only) under a CJS jest config; requires Node >=24.9 or downgrading to @nestjs/common v11
|
Important Review skippedToo many files! This PR contains 460 files, which is 360 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: Repository: DigiNodes/truthbounty-api/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: ⛔ Files ignored due to path filters (26)
📒 Files selected for processing (460)
You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
daec447 to
12d6870
Compare
|
Reference the issue you worked on @Ummi-001 |
|
dDevAhmed I just referenced the issue |
Summary
Closes #485
Closes #486
Closes #487
Closes #488
main(58e4df1) does not compile. This repairs the baseline so the repo builds again. No feature work is included.npm run type-checknpm run buildprisma validateDiff: 493 files, +16471/-5715.
What was broken and what was fixed
Syntax-level corruption
claims.cache.ts,event-indexer.service.ts,notifications.service.ts,websocket.service.tsdid not parse; restored valid pre-merge versionssetmethods, duplicatemain.tsbootstrap, duplicate database module metadata/classdescribein the evidence integration specdeterministic-rpc-failover.service.tssat in the wrong directoryuuidimports replaced with NoderandomUUIDTypeORM 1 migration (
type: "sqlite", arrayrelations/select,foreignKeysmetadata were all removed)find({ order, take: 1 })instead offindOne({ order })for checkpoint readsrelations/select; dropped unsupportedforeignKeys(migrations keep the real FK)SQLITE_CONSTRAINT*codes in duplicate detectionbetter-sqlite3for the sqlite driver across all configs and explicit requiresBullMQ 6 migration
upsertJobSchedulerfor recurring jobs; dropped invalidpausedjob typeType correctness
AuditLog.userIdis nullable; propagated through the audit service and controllerNotificationCategory/NotificationPriorityenums on the entity to the ones the service actually writesredactSensitiveDatatounknown(it alreadyString()d non-strings)req.ip/req.ipsas readonly getters;cors.middlewareorigin union narrowed to what is actually constructedDeps / codegen
better-sqlite3, regeneratedpackage-lock.jsonBlockCursor,BlockCursorAncestor,ChainEventmodels and regenerated the clientKnown pre-existing problems, deliberately NOT addressed
no-unsafe-*across ~190 files this branch never touches.@nestjs/commonv12 is ESM-only ("type": "module") against a CommonJS jest config; jest needs Node >=24.9 forrequire(esm), and CI pins Node 20. 238 tests pass, 12 fail.Both predate this branch, so
lintandtest:covwill still be red here.type-checkgoing red -> green is the actual fix. These two warrant their own PRs.