fix: deliver pending mail on character switch when RPCharacters enables late - #30
Conversation
…es late BirdMessenger registered its CharacterActivatedEvent listener only if RPCharacters was already enabled. The RPCharacters <-> SimpleFactions load cycle makes the legacy loader enable RPCharacters after BirdMessenger, so the listener never registered on Main or dev. Also register it from PluginEnableEvent, once. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughBirdMessenger now registers a hook at startup. The hook registers CharacterActivatedListener if RPCharacters is enabled or when RPCharacters later enables. Tests cover both registration paths and ignore enable events from other plugins. ChangesRPCharacters Registration
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to This change makes pending mail delivery on character switch work when RPCharacters enables after BirdMessenger. The listener is registered exactly once. No merge-blocking risk was found. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to Late plugin startup should now allow pending mail to be delivered, but the newly reachable delivery path relies on character IDs to select mail without independently checking the stored recipient. Whether that permits delivery to another player depends on a character-ID uniqueness guarantee that has not been established. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
A rabbit checked the plugin's state, Comment |
Why
BirdMessenger.onEnableregisteredCharacterActivatedListeneronly when RPCharacters was already enabled. On both servers, the legacy plugin loader enables RPCharacters after BirdMessenger, because the RPCharacters ↔ SimpleFactions soft-dependency cycle makes it ignore soft dependencies. So the listener never registered, and pending mail was not delivered when a player switched to the addressed character.#29 removed BirdMessenger's own cycle. After dev restarted on v1.1.4, it still showed:
Changes
RpCharactersHook. It registersCharacterActivatedListenerat startup if RPCharacters is already enabled, or whenPluginEnableEventfires for RPCharacters, and never twice. SimpleFactions and RPCharacters already handle each other the same way.RpCharactersHookTestcovers three cases: RPCharacters enabling late, RPCharacters already enabled with no double registration, and other plugins being ignored.Testing
mvn verifypasses: 37 tests, 0 failures.🤖 Generated with Claude Code
Summary by CodeRabbit