test(sitecall-audit): symmetric SourceNode coverage on DbOutbound emitter + clarify DI comments
Two follow-ups from the T13/T14 code review: - M1: Add CachedWrite_StampsSourceNode_OnSubmitTelemetryRow and CachedWrite_NoSourceNodeWired_LeavesSourceNodeNull to DatabaseCachedWriteEmissionTests, mirroring the existing ApiOutbound SourceNode tests in ExternalSystemCachedCallEmissionTests. Site-emitter coverage now symmetric across both cached-call channels. - M2: Clarify the GetService(INodeIdentityProvider) DI comments on the CachedCallTelemetryForwarder and CachedCallLifecycleBridge factories: it's test composition roots that may not register the provider, not central production. Both site and central hosts always register it via SiteServiceRegistration.BindSharedOptions.
This commit is contained in:
@@ -149,10 +149,13 @@ public static class ServiceCollectionExtensions
|
||||
sp.GetRequiredService<ILogger<CachedCallTelemetryForwarder>>(),
|
||||
// SourceNode-stamping (Task 14): the local node identity is
|
||||
// threaded through so RecordEnqueueAsync can stamp the
|
||||
// tracking row's SourceNode column. GetService — central
|
||||
// composition roots may not register the provider, in which
|
||||
// case the forwarder degrades to a null SourceNode rather
|
||||
// than failing the DI resolution.
|
||||
// tracking row's SourceNode column. GetService (not
|
||||
// GetRequiredService) — test composition roots that build a
|
||||
// stripped DI container may not register the provider, in
|
||||
// which case the forwarder degrades to a null SourceNode
|
||||
// rather than failing the DI resolution. Production hosts
|
||||
// (site + central) always register it via
|
||||
// SiteServiceRegistration.BindSharedOptions.
|
||||
sp.GetService<INodeIdentityProvider>()));
|
||||
|
||||
// M3 Bundle F: bridge the store-and-forward retry-loop observer hook
|
||||
@@ -165,9 +168,11 @@ public static class ServiceCollectionExtensions
|
||||
// INodeIdentityProvider singleton can be threaded through — the
|
||||
// bridge stamps SiteCallOperational.SourceNode from
|
||||
// INodeIdentityProvider.NodeName on every cached-call lifecycle row.
|
||||
// GetService (not GetRequiredService) — central composition roots may
|
||||
// not register the provider, in which case the bridge degrades to a
|
||||
// null SourceNode rather than failing the DI resolution.
|
||||
// GetService (not GetRequiredService) — test composition roots that
|
||||
// build a stripped DI container may not register the provider, in
|
||||
// which case the bridge degrades to a null SourceNode rather than
|
||||
// failing the DI resolution. Production hosts (site + central)
|
||||
// always register it via SiteServiceRegistration.BindSharedOptions.
|
||||
services.AddSingleton<CachedCallLifecycleBridge>(sp => new CachedCallLifecycleBridge(
|
||||
sp.GetRequiredService<ICachedCallTelemetryForwarder>(),
|
||||
sp.GetRequiredService<ILogger<CachedCallLifecycleBridge>>(),
|
||||
|
||||
Reference in New Issue
Block a user