Repository navigation
Fix ordinary decoration without a keyed availability probe (#120) - #123
Conversation
Co-authored-by: Codex <codex@openai.com>
…120) Co-authored-by: Codex <codex@openai.com>
|
Implemented in draft PR #123: #123 This was prioritized as the new regression among the open bug/P2 reports. The exact issue reproduction independently confirms that develop fails after decoration on net472/net8.0/net9.0/net10.0 while published 0.8.0 succeeds on every target. The fixed source now succeeds on every target too. The original-type activator previously requested IServiceProviderIsKeyedService before examining any constructor. It now acquires that probe only when a constructor dependency needs a non-null lookup key. Parameterless and ordinary-dependency originals, null owner contexts, and direct ServiceKey injection therefore retain ordinary provider support. Private decorator slots still use keyed resolution; availability probing and keyed resolution remain separate capabilities. Actual explicit/inherited-key dependencies still fail clearly when the keyed availability probe is missing. Nonempty DependsOn maps retain their existing requirements. Preserving #111's generic-constraint checks required the existing snapshot helper/cache to accept the ordinary probe interface as well. For native DI, both interfaces refer to the same CallSiteFactory descriptor owner. The helper keeps its exact native-type guard, copied descriptor field, metadata-shape guard, weak provider-specific cache, and preference for Mammoth's snapshot. There is no additional reflection lookup or dependency activation during planning. The rationale is documented in the architecture document, already linked from the code comment and README Architecture section. Tests were committed first: 75 failed and 6 keyed controls passed on each target. All 81 new cases now pass, including wrappers whose ordinary probe implements only IServiceProviderIsService, native/snapshot/diagnostic providers, repeated layers, lifetimes/disposal, constructor policies, constraint failures, and keyed controls. Verification for final commit
Paused for review before another issue. #121 and #122 remain separate open defects; resolve and review those before completing the release-validation checkpoint. No release actions were taken. |
Original implementation-type activation behind a decorator unconditionally required
IServiceProviderIsKeyedService. Providers exposing ordinary availability probing and keyed resolution therefore failed even for a parameterless original. The same registration succeeded in published 0.8.0.Fixes #120. Prioritized as the new regression among the open bug/P2 issues; #121 and #122 report pre-existing defects and remain separate.
The native-compatible activator now acquires the keyed availability probe only while planning a dependency with a non-null lookup key. Ordinary dependencies and contextual
ServiceKeyinjection use their existing paths. Actual explicit/inherited-key dependencies retain their keyed-probe requirement, and nonempty DependsOn maps keep their existing capability contract.Ordinary generic-constraint checks now pass the ordinary probe to the existing registration-snapshot helper. Native DI exposes the same descriptor owner through both interfaces, preserving the #111 checks without requesting a hidden keyed probe. This changes the cache/helper interface type and adds no reflection lookup; exact native-type checks, descriptor-shape guards, snapshot preference and weak provider-specific caching remain. The architecture document explains this adjustment and the vNext changelog records the fix.
Verification on Windows:
ContinuousIntegrationBuild=True: passed. Zero errors or compiler/analyzer warnings. Only the two existing net472 support warnings from Microsoft.Extensions.Telemetry.Abstractions and Microsoft.Extensions.Diagnostics.Testing 10.0.0 remain.Exact final-commit CI results will be added to the discussion when complete. Draft for review; work pauses before the next issue. Remaining open defects mean the release-validation checkpoint is still pending their resolution and review.
Co-authored-by: Codex codex@openai.com