Skip to content

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

Closed

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

  1. added
    bugSomething isn't working
    GrantFox OSSIssue tracked in GrantFox OSS
    Maybe RewardedIssue may be eligible for a GrantFox reward
    on Jun 17, 2026
  2. Favourof commented on Jun 20, 2026

    @Favourof

    Hi, Maintainer I will like to work on this issue.

  3. MarvyNwaokobia commented on Jun 21, 2026

    @MarvyNwaokobia
    Contributor

    I'd like to work on this issue.

    I have experience debugging stale backend services and aligning service logic with actual database schemas. I'll first audit whether score decay is an active feature or unused code. If it's intended, I'll refactor it to use the existing scores table, replace all console.* usage with the Winston logger, and properly wire runScoreDecayJob into index.ts with a safe execution pattern (including locking to prevent duplicate runs). If it's not a real feature, I'll remove the unused service and cron job entirely.

    In both cases, I'll add tests to cover the chosen approach and document the final decision in the services README for clarity.

  4. grantfox-oss commented on Jun 21, 2026

    @grantfox-oss
    Author

    🦊 GrantFox — @MarvyNwaokobia has been assigned to this issue as part of the Official Campaign campaign!

    Next steps:

    1. Open a Pull Request referencing this issue (e.g., Closes #7)
    2. Your PR will be reviewed by the LabsCrypt maintainers

    Good luck! Track your progress on GrantFox.

  5. grantfox-oss commented on Jun 29, 2026

    @grantfox-oss
    Author

    🎉 This issue has been marked as completed on GrantFox as part of the Official Campaign campaign!

    @MarvyNwaokobia's PR #39 was approved and merged by @ogazboiz.

    🏆 @MarvyNwaokobia: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (226 total points). Track your full progress on GrantFox.

    👏 Great work, @MarvyNwaokobia! Keep contributing to LabsCrypt.

  6. added a commit that references this issue on Jun 30, 2026
    f63e16c
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