The guri handler chain refuses to compile at runtime - #2328
Conversation
Every guri packet the client sends fails in the WorldServer: Wolverine.Configuration.InvalidServiceLocationException: Found service locations while generating code for Message Handler for GuriPacketReceivedEvent, but ServiceLocationPolicy.NotAllowed is in effect. The service registration for ILogLanguageLocalizer<LanguageKey> is an 'opaque' lambda factory with the Transient lifetime and requires service location followed by a cascade of "Frame chain is being re-arranged" from the code generator. So emoticons, speakers, titles and MFA input all go nowhere, and the log fills with stack traces on every attempt. The chain reaches it through IGameLanguageLocalizer, which SpeakerHandler takes. Registering the concrete type instead of a lambda lets the generator inline the constructor, which is what it does for every other registration here. Tested: builds with 0 warnings, full suite green (991 tests). Found on a running server, from the client sending guri. The compile failure itself is what has to be confirmed gone, and that needs a client: use an emoticon, or any action that sends guri, and the WorldServer log should stay clean.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. WalkthroughThe world server replaces the factory-based language localizer registration with direct transient registration. The dependency injection container now constructs ChangesLanguage localizer registration
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This change fixes runtime construction of the existing language-localization service without changing its interface or request handling, so guri-related features can execute normally. No actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
||
| services.AddI18NLogs(); | ||
| services.AddTransient(typeof(IGameLanguageLocalizer), typeof(GameLanguageLocalizer)); | ||
| // A lambda factory here is opaque to Wolverine's code generation, which |
There was a problem hiding this comment.
this comment is useless
There was a problem hiding this comment.
Removed. The reason for the change is in the PR description instead.
Asked for on the PR: the reason for the change belongs in the description, not above the line. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
| typeof(LogLanguageLocalizer<LanguageKey, LocalizedResources>)); | ||
|
|
||
| // IClock is wired as a singleton here because SystemClock is an external | ||
| // NodaTime type with no container-friendly constructor. |
There was a problem hiding this comment.
interesting so we don't need the factory anywhere anymore ?
What
Every
guripacket the client sends fails in the WorldServer:followed by a cascade of
Frame chain is being re-arrangedfrom the code generator.So emoticons, speakers, titles and MFA input all go nowhere, and the log fills with stack traces on every attempt.
Why it reaches that registration
SpeakerHandlertakesIGameLanguageLocalizer, which depends onILogLanguageLocalizer<LanguageKey>. That one is registered as a lambda factory, which the generator cannot inline — so it falls back to service location, which Wolverine 6 refuses.Registering the concrete type instead lets it inline the constructor, the same as every other registration alongside it.
Testing
guri. The WorldServer had reachedListening on port 1337and the failure appeared only once the packet arrived, which is why unit tests never saw it: the chain is compiled on first message.documentation/manual-test-plan.mdthere is nogurisection; the check is: use an emoticon, or any action that sendsguri, and the WorldServer log should stay clean.Summary by CodeRabbit