Skip to content

Support recurring vote-streak rewards and migrate legacy streak config/state#1506

Closed
BenCodez wants to merge 2 commits intomasterfrom
codex/expand-votestreak-system-for-one-time-rewards
Closed

Support recurring vote-streak rewards and migrate legacy streak config/state#1506
BenCodez wants to merge 2 commits intomasterfrom
codex/expand-votestreak-system-for-one-time-rewards

Conversation

@BenCodez
Copy link
Copy Markdown
Owner

@BenCodez BenCodez commented May 2, 2026

Motivation

  • Add support for recurring vote-streak rewards (reward every N completions) in addition to one-time rewards at N.
  • Smooth upgrade path for users upgrading from older plugin versions by migrating legacy per-user streak fields and the deprecated VoteStreak config section into the new VoteStreaks format.

Description

  • Added a recurring boolean to VoteStreakDefinition and updated its constructor and usages to carry the new option.
  • Updated reward logic in VoteStreakHandler.processVoteForDefinition to honor recurring (reward every N completions when true, otherwise reward only once at N).
  • Implemented legacy migration helpers getLegacyStreakProgress and migrateLegacyProgressIfNeeded to import old per-user streak counters into the new serialized streak state on first use.
  • Added legacy config loader methods loadLegacy and loadLegacyType to ingest the deprecated VoteStreak -> Day|Week|Month sections, create VoteStreakDefinition entries, and disable the old config nodes; also added Recurring support to the example SpecialRewards.yml.

Testing

  • Ran the unit tests in VoteStreakHandlerTest, including configLoader_loadsDefinition_andGetDefinitionWorks, processVote_whenAlreadyCountedThisPeriod_doesNotIncrementStreakAgain, processVote_acceptsOldFiveFieldFormat_andUpgradesState, processVote_migratesLegacyProgressIntoNewState, and configLoader_migratesLegacyVoteStreakSection.
  • All unit tests passed (no failing assertions).

Codex Task

@BenCodez BenCodez closed this May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant