Skip to content

[Backend] scoreDecayService and scoreDecayJob are dead, broken code querying a non-existent table #7

Description

@grantfox-oss

Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0

Why this matters

src/services/scoreDecayService.ts queries a borrowers table that does not exist in any migration (scores live in the scores table), uses console.* in src/cron/scoreDecayJob.ts, and runScoreDecayJob is never wired into index.ts. Either the decay feature is unimplemented or this is stale code that would crash if ever invoked.

Acceptance criteria

  • Decide whether score decay is a real feature: if yes, rewrite against the actual scores schema and wire it into index.ts with logging and a lock; if no, delete both files
  • Replace console.log/console.error with the winston logger if the code is kept
  • Add a test covering whichever path is chosen
  • Document the decision in the services README

Files to touch

  • src/services/scoreDecayService.ts
  • src/cron/scoreDecayJob.ts
  • src/index.ts

Out of scope

  • Designing a new decay algorithm
  • On-chain score decay

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignbugSomething isn't workinghardAdvanced / high-difficulty issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions