fix: marten 9 — declare conventional projections partial for source-gen dispatch#32
Merged
Merged
Conversation
…en dispatch Marten 9 / JasperFx 2.0 removed runtime codegen for conventional projections; Apply/Create are now dispatched by the compile-time JasperFx.Events.SourceGenerator, which only augments partial classes (no runtime fallback). Declaring ActiveRequestsByRiderProjection, RequestTimelineProjection, and FareQuoteAttemptsProjection partial restores dispatcher generation. dotnet test CritterCab.slnx: 7/8 failing -> 8/8 green. The analyzer flows transitively via WolverineFx.Marten -> Marten; no csproj change needed. RideRequest (self-aggregating LiveStreamAggregation target) does not need partial and is untouched.
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.
Un-reds
main. The2f83e66package bump moved the project to Marten 9 / JasperFx 2.0, which removed runtime codegen for conventional projections —Apply/Createare now dispatched by the compile-timeJasperFx.Events.SourceGenerator, with no runtime fallback. The generator only augmentspartialclasses, and CritterCab's three projection subclasses weren'tpartial, so every test died at host startup withInvalidProjectionException: No source-generated dispatcher found ….This is pre-existing
mainbreakage, not a regression from PR #31 (Aspire):main's CI for2f83e66(run27477344974) is alreadyfailure. PR #31 was just the first PR-triggered CI run to surface it.The fix
Declare the three conventional projection subclasses
partial:ActiveRequestsByRiderProjection : MultiStreamProjection<ActiveRideRequest, Guid>RequestTimelineProjection : SingleStreamProjection<RequestTimeline, Guid>FareQuoteAttemptsProjection : SingleStreamProjection<FareQuoteAttempts, Guid>RideRequest(the self-aggregatingLiveStreamAggregation<RideRequest>target) does not needpartialper the exception message and is left untouched.Verification
dotnet test CritterCab.slnx(Docker-backed Testcontainers Postgres): 7/8 failing → 8/8 passing. The source generator's analyzer asset flows transitively throughWolverineFx.Marten→Marten— no.csprojchange and nothing registered inProgram.cs;partialwas the complete fix.Sequencing
Merge this first to green
main; then PR #31 (tidy: aspire) rebases onto the fixedmainand its CI goes green.Scope
Narrow on purpose. The remaining Marten 9 / Wolverine 6 migration audit (IRevisioned/ILongVersioned, inline-lambda projection removal,
ServiceLocationPolicyflip, etc.) and the version doc-drift stay deferred to their own session — none currently reds CI.Prompt:
docs/prompts/fix-marten9-projection-source-gen.md· Retro:docs/retrospectives/fix-marten9-projection-source-gen.md· Null spec-delta.