You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
📝 Summary
Summary by CodeRabbit
New Features
Administrators can now receive suggestions for active token codes when completing the third argument of the token deletion command. Suggestions match the entered prefix without regard to case.
Bug Fixes
Active token suggestions are refreshed after a token is successfully revoked, so deleted tokens do not remain in the suggestions. Failed revocations leave the existing suggestions unchanged.
The change adds a cache for active token codes, uses it to suggest matching codes during admin token-deletion completion, and invalidates it after successful revocation. Tests cover cache refresh and completion filtering.
Changes: Active token deletion suggestions
Layer / File(s)
Summary
Load and refresh active token codes src/main/java/net/tfminecraft/armourshop/pack/delete/ActiveTokenCodeCache.java, src/test/java/net/tfminecraft/armourshop/pack/delete/PackDeletionTest.java
The cache loads active codes, removes duplicates while preserving order, and exposes snapshot and invalidation operations. Tests cover worker-scheduled fetching, refreshes, failed results, and empty results.
Connect the cache to token deletion src/main/java/net/tfminecraft/armourshop/managers/CommandManager.java, src/test/java/net/tfminecraft/armourshop/managers/CommandManagerTest.java
Successful token revocation invalidates the cache. Admin completion for the third token-deletion argument returns cached codes filtered by the entered prefix. Tests cover matching and excluded paths.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:M30-99 effective changed lines (tests excluded in mixed PRs).
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Correct command suggestions to match the arguments accepted by ArmourShop, including the current prefix and applicable permission or sender context.
ARMOURSHOP-01: Admin-only token delete completion uses an async active-unused-code snapshot backed by the existing 30-second generational cache; successful revocation invalidates it. Clickable listtokens actions are preserved.Validation:
tfmc-mvn -o -B --no-transfer-progress clean verifypassed (229 tests, zero failures, errors or skips), including command-completion regressions.git diff --checkpassed.Documentation: TF-Minecraft/Docs#266.