Skip to content

Fix unreachable code and missing validation across multiple services - #775

Merged
meshackyaro merged 2 commits into
trustflow-protocol:mainfrom
opeaceooo:fix/issues-749-757-761-764
Oct 19, 2026
Merged

meshackyaro merged 2 commits into
trustflow-protocol:mainfrom
opeaceooo:fix/issues-749-757-761-764

Conversation

@opeaceooo

Copy link
Copy Markdown
Contributor

Summary

Fixes four critical issues where code paths were unreachable or missing validation:

Changes

env.config.ts

  • Reordered JWT_SECRET validation checks: placeholder check now runs before length check
  • This ensures placeholder values like 'secret' or 'change-me-in-production' are caught with appropriate error message

gig-expiry-worker.service.ts

  • Added missing imports: MetricsService and SentryService
  • Defined LOCK_RENEWAL_INTERVAL_MS constant (10 seconds) for lock renewal during long sweeps

deliverable.service.ts

  • Added import for PinStatus from ipfs-pinning types
  • Added mapPinStatusToDeliverableStatus() method to map IPFS pin states to deliverable states
  • Updated upload() to use pin result status: HEALTHY → PINNED, DEGRADED → PENDING, FAILED → FAILED
  • This ensures degraded pins are properly tracked and can be monitored

dispute-saga.service.ts

  • Added validation in assignJurors() to reject even juror counts
  • Prevents vote ties which previously resolved silently to SPLIT with no record

Closes #749
Closes #761
Closes #757
Closes #764

- Fix trustflow-protocol#749: Reorder JWT_SECRET validation to check placeholder values before length
- Fix trustflow-protocol#761: Add missing imports for MetricsService and SentryService, define LOCK_RENEWAL_INTERVAL_MS constant
- Fix trustflow-protocol#757: Map IPFS pin status to deliverable status so PENDING and FAILED states are reachable
- Fix trustflow-protocol#764: Add validation to reject even juror counts to prevent vote ties

These changes ensure all code paths are reachable and proper validation prevents edge cases.
@drips-wave

drips-wave Bot commented Oct 18, 2026

Copy link
Copy Markdown

@opeaceooo 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

@meshackyaro
meshackyaro merged commit 8979e3f into trustflow-protocol:main Oct 19, 2026
olayinkaabdulsalam-hub added a commit to olayinkaabdulsalam-hub/trustflow-backend that referenced this pull request Oct 19, 2026
…rustflow-protocol#775)

- Fix trustflow-protocol#749: Reorder JWT_SECRET validation to check placeholder values before length
- Fix trustflow-protocol#761: Add missing imports for MetricsService and SentryService, define LOCK_RENEWAL_INTERVAL_MS constant
- Fix trustflow-protocol#757: Map IPFS pin status to deliverable status so PENDING and FAILED states are reachable
- Fix trustflow-protocol#764: Add validation to reject even juror counts to prevent vote ties

These changes ensure all code paths are reachable and proper validation prevents edge cases.

Co-authored-by: Maverick <151352447+meshackyaro@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment