Skip to content

Add legacy VoteStreak migration, recurring flag, and admin migrate command#1507

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

Add legacy VoteStreak migration, recurring flag, and admin migrate command#1507
BenCodez wants to merge 2 commits intomasterfrom
codex/expand-votestreak-system-for-one-time-rewards-hlf3wa

Conversation

@BenCodez
Copy link
Copy Markdown
Owner

@BenCodez BenCodez commented May 2, 2026

Motivation

  • Add automatic support for migrating legacy VoteStreak config and per-user legacy progress into the new VoteStreaks format to avoid data loss when upgrading.
  • Support one-time vs recurring streak rewards so definitions can either trigger once at N or every N completions.
  • Provide an admin command to trigger manual migration and notify admins how many definitions were converted.

Description

  • Introduce a recurring flag to VoteStreakDefinition with a new constructor overload and expose it via isRecurring() to control reward behavior.
  • Update processing logic in VoteStreakHandler.processVoteForDefinition to reward either once at the interval (recurring=false) or repeatedly every interval (recurring=true).
  • Implement legacy migration helpers in VoteStreakHandler: getLegacyStreakProgress, migrateLegacyProgressIfNeeded, and migrateLegacyConfigManually, plus legacy-loading logic in VoteStreakConfigLoader to convert VoteStreak -> VoteStreaks entries, create IDs, persist migrated sections, and register user data columns.
  • Add an admin command handler (admin command MigrateVoteStreaks) in CommandLoader to run migrateLegacyConfigManually() and reload definitions with an informational message.
  • Update SpecialRewards.yml example to include the Recurring option and documentation comment for the new behavior.
  • Update unit tests in VoteStreakHandlerTest to cover migration of per-user legacy progress and the config-section migration, and adjust helper utilities for the new Recurring property and silent logger handling.

Testing

  • Ran the updated unit test class VoteStreakHandlerTest which now includes processVote_migratesLegacyProgressIntoNewState and configLoader_migratesLegacyVoteStreakSection and all tests passed.
  • Executed the test suite via the project test runner (mvn test), and the modified vote streak tests completed successfully.

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