Skip to content

GH-5089 Event Model: match the EmittedEvents manifest to a handler overload by its ParameterTypes - #5100

Merged
jeremydmiller merged 1 commit into
mainfrom
gh-5089-emitted-events-overloads
Oct 20, 2026
Merged

jeremydmiller merged 1 commit into
mainfrom
gh-5089-emitted-events-overloads

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

Wolverine side of JasperFx/jasperfx#1021, which JasperFx/jasperfx#1030 fixed and JasperFx 2.91.0 ships.

Problem

EventModelRoles.emittedFromSource keyed the source generator's [assembly: EmittedEvents(...)] manifest by (HandlerType, MethodName). Every Handle overload of one handler class got the union of all the overloads' events. Stoat's ClaimHandler, GateHandler and similar classes showed every command slice claiming events it never appends.

Fix

  • An entry applies to a MethodCall when its ParameterTypes sequence-equal the method's parameter types.
  • Only when no entry matches that way do the entries without ParameterTypes apply. Those come from older manifests, and from overloads whose parameter types the generator could not name at assembly scope.
  • Old manifests keep today's behaviour.
  • JasperFx, JasperFx.Events, JasperFx.Events.SourceGenerator, JasperFx.Events.InMemory and JasperFx.SourceGenerator go from 2.90.2 to 2.91.0. That is the same version the 6.51.2 release PR Wolverine 6.51.2: GH-5092 coordinator only observes, GH-5087 MySQL/Oracle join, JasperFx 2.91.0 matched set #5095 moves to, so the two touch identical lines.

Tests

CoreTests emitted_events_from_the_source_generators_manifest_4914 gains three cases on a three-overload handler: each typed overload gets only its own events, and an overload with no typed entry falls back to the name-only entry.

  • The three new cases fail without the fix.
  • All 187 CoreTests matching EventModel pass.
  • dotnet build wolverine.slnx -c Release -f net9.0 has 0 errors.

Closes #5089

🤖 Generated with Claude Code

https://claude.ai/code/session_01DCggXgxnG3EBXoR9rrq37U

…erload by its ParameterTypes

The JasperFx.Events source generator now writes one [assembly: EmittedEvents] entry per Handle
overload, told apart by ParameterTypes (#1021 / #1030, JasperFx 2.91.0). EventModelRoles
keyed the manifest by (HandlerType, MethodName) only, so every overload of one handler class got
the union of all the overloads' events.

An entry now applies to a MethodCall when its ParameterTypes sequence-equal the method's parameter
types. Only when there are none do the entries without ParameterTypes apply: older manifests, and
overloads the generator could not name from assembly scope.

JasperFx / JasperFx.Events / SourceGenerators / InMemory 2.90.2 -> 2.91.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DCggXgxnG3EBXoR9rrq37U
@jeremydmiller
jeremydmiller merged commit 0eb1939 into main Oct 20, 2026
47 checks passed
This was referenced Oct 21, 2026
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.

Event Model: match the EmittedEvents manifest to a handler overload by its ParameterTypes (jasperfx#1021)

1 participant