Skip to content

Reproduction for "HTTP endpoints resolves services wrong in codegen, but works in tests"#2992

Closed
PerfectlyNormal wants to merge 1 commit into
JasperFx:mainfrom
PerfectlyNormal:servicelocation-from-httpcontext
Closed

Reproduction for "HTTP endpoints resolves services wrong in codegen, but works in tests"#2992
PerfectlyNormal wants to merge 1 commit into
JasperFx:mainfrom
PerfectlyNormal:servicelocation-from-httpcontext

Conversation

@PerfectlyNormal

Copy link
Copy Markdown
Contributor

See #2991 for more detailed description

@jeremydmiller

Copy link
Copy Markdown
Member

Superseded by #2993

knotekbr pushed a commit to knotekbr/wolverine that referenced this pull request May 31, 2026
…on (JasperFxGH-2991)

JasperFx 2.3.0 (JasperFx#401) makes the `codegen write` / preview path honor
WolverineHttpOptions.ServiceProviderSource, matching the runtime. Previously a
service-located dependency (an opaque scoped lambda factory) was generated against an
isolated serviceScope under `codegen write` even when the app configured
FromHttpContextRequestServices, so the pre-generated code differed from (and was wrong
vs.) the runtime-generated code — yielding two different scoped instances for one request.

Carries the reproduction from JasperFx#2992 (EfCoreEndpoints /ef/servicelocation +
http_handler_with_http_context_sourced_gets_the_same_service). That test exercises the
runtime path (which was always correct); the codegen-write regression itself is guarded by
the new DynamicCodeBuilder test in JasperFx#401.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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