Fix #432 regression — self-aggregating projection dispatcher dropped (2.9.5)#439
Merged
jeremydmiller merged 1 commit intoJun 10, 2026
Merged
Conversation
…bump 2.9.5 #432 (2.9.3) added a Pipeline-1 dedupe in AggregateEvolverGenerator.ExecuteCombined to stop the same evolver hintName being emitted twice when a type's Apply/Create methods are split across multiple partial declarations (CS8785). The guard — `if (!seen.Add(SymbolKey(info.ClassSymbol))) continue;` — reused the cross-pipeline `seen` set, which MarkSeen also seeds with the class symbol AND (for partial projections) the aggregate type. So a self-aggregating type whose key had already been added to `seen` by an earlier candidate's MarkSeen (e.g. a projection subclass aggregating that same type) had its Pipeline-1 emission falsely skipped — no evolver was generated, surfacing at runtime as "No source-generated dispatcher found for SingleStreamProjection<T, TId>" (broke Marten's self-aggregating single-stream projections on 2.9.3/2.9.4). Dedupe Pipeline-1 emissions in a SET DISTINCT from `seen`, keyed by (type, identity) to match the emitted hintName granularity, and still call MarkSeen for cross-pipeline coordination. Preserves #432's partial-split dedupe (its regression test still passes) while restoring emission for self-aggregating types. Verified: JasperFx.Events.SourceGenerator.Tests 21/21; Marten EventSourcingTests Aggregation 228/230 (2 pre-existing skips) and TenantPartitionedEventsTests 186/186 against a local 2.9.5 build (both RED on 2.9.4). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jeremydmiller
added a commit
that referenced
this pull request
Jun 10, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Published 2.9.3 and 2.9.4 break self-aggregating single-stream projections: at runtime they throw
This regresses a core Marten pattern (e.g.
SingleStreamProjection<SimpleAggregate, Guid>) — surfaced when bumping Marten to 2.9.4 (JasperFx/marten#4714); Marten'sEventSourcingTestspass on 2.9.2 and fail on 2.9.4.Root cause
#432 (2.9.3) added a Pipeline-1 dedupe in
AggregateEvolverGenerator.ExecuteCombinedto avoid emitting the same evolver hintName twice when a type'sApply/Createmethods are split across multiplepartialdeclarations (CS8785). The guard reused the cross-pipelineseenset:But
MarkSeenseedsseenwith the class symbol and (for partial projections) the aggregate type. So a self-aggregating type whose key was already added toseenby an earlier candidate'sMarkSeen(e.g. a projection subclass aggregating that same type) had its Pipeline-1 emission falsely skipped — no evolver generated.Fix
Dedupe Pipeline-1 emissions in a set distinct from
seen, keyed by(type, identity)to match the emitted hintName granularity, while still callingMarkSeenfor cross-pipeline coordination. Preserves #432's partial-split dedupe; restores emission for self-aggregating types.Verification
JasperFx.Events.SourceGenerator.Tests21/21 (incl. Projections split across multiple partial record/class definitions results in duplicate hint name in source generator #432's partial-split regression test).EventSourcingTestsAggregation 228/230 (2 pre-existing skips) andTenantPartitionedEventsTests186/186 against a local 2.9.5 build — both RED on 2.9.4.Bumps to 2.9.5. (Recommend yanking/superseding 2.9.3 & 2.9.4 given the regression.)
🤖 Generated with Claude Code