Skip to content

Add VoteStreak migration, recurring option, and legacy progress migration#1508

Closed
BenCodez wants to merge 1 commit intomasterfrom
codex/expand-votestreak-system-for-one-time-rewards-3ype72
Closed

Add VoteStreak migration, recurring option, and legacy progress migration#1508
BenCodez wants to merge 1 commit intomasterfrom
codex/expand-votestreak-system-for-one-time-rewards-3ype72

Conversation

@BenCodez
Copy link
Copy Markdown
Owner

@BenCodez BenCodez commented May 2, 2026

Motivation

  • Provide an automated way to migrate the old VoteStreak config layout into the new VoteStreaks format and preserve existing user progress.
  • Introduce a Recurring option to allow streaks to either reward every N completions or only once at N.

Description

  • Added a recurring boolean to VoteStreakDefinition with constructors updated to preserve default behavior.
  • Changed reward logic in VoteStreakHandler.processVoteForDefinition to differentiate recurring rewards (every N completions) from one-time rewards (only at exactly N).
  • Implemented legacy progress migration so a user with old per-day/week/month streak counters will have that progress migrated into the new streak StreakState on first access.
  • Added migrateLegacyConfigManually() and legacy loader VoteStreakConfigLoader.loadLegacy to convert old VoteStreak sections into VoteStreaks, including creating new definition IDs, moving rewards, and marking legacy entries disabled.
  • Exposed an admin command MigrateVoteStreaks (shown as /av migratevotestreaks in logs) in CommandLoader to trigger migration and reload.
  • Updated VoteStreak configuration sample SpecialRewards.yml to document the Recurring option and to include the new example field.
  • Updated and expanded unit tests and small test helpers in VoteStreakHandlerTest to cover loading, legacy-state upgrade, and config migration behaviors.

Testing

  • Ran the VoteStreakHandlerTest JUnit suite which includes tests for config loading, old-state upgrades, legacy-progress migration, and config migration, and all tests passed.
  • Verified that the config loader warns when VoteStreaks is missing and suggests running the migration command.

Codex Task

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