Skip to content

BountiesService.expireOverdue() is dead code — nothing in the application ever calls it #152

Closed

Description

@chonilius

src/bounties/bounties.service.ts's expireOverdue() sweeps for overdue bounties and flips their status to EXPIRED. A codebase-wide search confirms it is called from nowhere: there is no @Cron decorator on it or anywhere in BountiesService (unlike IdempotencyCleanupService.removeExpired, which does carry @Cron(CronExpression.EVERY_HOUR)), and BountiesController exposes no route that invokes it either. The README's own Roadmap section confirms this gap explicitly, listing as unchecked: "Add a scheduled job for BountiesService.expireOverdue() (deadline sweeps) and recurring MaintenancePool deposits."

This is a more fundamental gap than #26's framing ("Add a background job to auto-refund expired FUNDED bounties on-chain, not just flip a status flag locally"), which presupposes the local status-flip is already happening somewhere and only the on-chain refund step is missing. In the code as it stands today, the local status flip itself never runs either — a bounty past its deadline stays exactly as it was (OPEN/FUNDED/CLAIMED) forever; expireOverdue() is fully-implemented, tested-adjacent (via bounty-state-machine.spec.ts's transition coverage), and completely unreachable.

Fix: add @Cron(...) to BountiesService.expireOverdue() (or an equivalent scheduled invocation) so it actually runs, independent of and prior to whatever on-chain-refund follow-up #26 describes.

Activity

  1. added
    bugSomething isn't working
    securitySecurity-related issue
    testingTesting/QA infrastructure
    documentationImprovements or additions to documentation
    very hardVery difficult task, expert-level effort required
    on Aug 21, 2026
  2. OlaBanjiolowo commented on Aug 26, 2026

    @OlaBanjiolowo

    @OlaBanjiolowo has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    I’d like to work on this issue because expireOverdue() already contains the logic required to transition overdue bounties, but the functionality is currently unreachable without a scheduled invocation. I would first verify the project’s existing scheduling setup and conventions, then add an appropriate scheduled invocation for BountiesService.expireOverdue() while preserving its existing behavior. I’ll also verify the relevant tests and add or update coverage as needed to ensure overdue bounties are processed correctly without introducing regressions.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @OlaBanjiolowo to this issue.

  3. thefadah commented on Aug 26, 2026

    @thefadah
    Contributor

    @thefadah has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    assign to me

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @thefadah to this issue.

  4. drips-wave commented on Aug 26, 2026

    @drips-wave

    Congratulations, @thefadah! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on August 31, 2026.

    🧑‍💻 @thefadah: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  5. added a commit that references this issue on Aug 26, 2026
  6. drips-wave commented on Aug 26, 2026

    @drips-wave

    This issue has been completed by @thefadah as part of the Stellar Wave Program's 8th Wave 🥳

    😎 @thefadah: You earned 200 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workingdocumentationImprovements or additions to documentationsecuritySecurity-related issuetestingTesting/QA infrastructurevery hardVery difficult task, expert-level effort required

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions