Skip to content

The guri handler chain refuses to compile at runtime - #2328

Merged
erwan-joly merged 2 commits into
NosCoreIO:masterfrom
denislauri1999:pr/guri-handler-service-location
Aug 28, 2026
Merged

The guri handler chain refuses to compile at runtime#2328
erwan-joly merged 2 commits into
NosCoreIO:masterfrom
denislauri1999:pr/guri-handler-service-location

Conversation

@denislauri1999

@denislauri1999 denislauri1999 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

What

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.
Service location(s):
Service NosCore.Core.I18N.IGameLanguageLocalizer:
Dependency: ServiceType: ILogLanguageLocalizer`1[LanguageKey] Lifetime: Transient
            ImplementationFactory: WorldServerBootstrap+<>c.<BuildHost>b__5_2
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.

Why it reaches that registration

SpeakerHandler takes IGameLanguageLocalizer, which depends on ILogLanguageLocalizer<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

  • Builds with 0 warnings; full suite green — 991 tests.
  • Found on a running server, from a client sending guri. The WorldServer had reached Listening on port 1337 and the failure appeared only once the packet arrived, which is why unit tests never saw it: the chain is compiled on first message.
  • Needs a client to confirm the fix. From documentation/manual-test-plan.md there is no guri section; the check is: use an emoticon, or any action that sends guri, and the WorldServer log should stay clean.

Summary by CodeRabbit

  • Refactor
    • Simplified internal service registration for improved dependency handling.
    • No user-visible behavior changes.

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.
@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: af766761-f7d5-453e-a2a2-6fb551c31aa9

📥 Commits

Reviewing files that changed from the base of the PR and between 3b6a18a and 8593a6a.

📒 Files selected for processing (1)
  • src/NosCore.WorldServer/WorldServerBootstrap.cs

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


Walkthrough

The world server replaces the factory-based language localizer registration with direct transient registration. The dependency injection container now constructs LogLanguageLocalizer<LanguageKey, LocalizedResources> and resolves its dependencies.

Changes

Language localizer registration

Layer / File(s) Summary
Direct localizer registration
src/NosCore.WorldServer/WorldServerBootstrap.cs
The ILogLanguageLocalizer<LanguageKey> registration uses the concrete localizer type instead of a factory lambda.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 8593a

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)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: fixing runtime compilation failures in the WorldServer guri handler chain.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.


services.AddI18NLogs();
services.AddTransient(typeof(IGameLanguageLocalizer), typeof(GameLanguageLocalizer));
// A lambda factory here is opaque to Wolverine's code generation, which

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this comment is useless

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@erwan-joly
erwan-joly merged commit 7e38658 into NosCoreIO:master Aug 28, 2026
2 checks passed
typeof(LogLanguageLocalizer<LanguageKey, LocalizedResources>));

// IClock is wired as a singleton here because SystemClock is an external
// NodaTime type with no container-friendly constructor.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting so we don't need the factory anywhere anymore ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants