Disable activity state filtering temporarily.

Commented out state filtering logic to address issues with log sanitization. The raw value is now directly stored in the activity state until a redesigned solution is implemented.
This commit is contained in:
Sipke Schoorstra 2024-12-11 18:11:36 +01:00
parent 2af951f6c3
commit fa9f83f11f

View file

@ -121,11 +121,12 @@ public static partial class ActivityExecutionContextExtensions
// Serializing the value ensures we store a copy of the value and not a reference to the input, which may change over time.
if (inputDescriptor.IsSerializable != false)
{
var serializedValue = await context.GetRequiredService<ISafeSerializer>().SerializeToElementAsync(value);
var manager = context.GetRequiredService<IActivityStateFilterManager>();
var filterContext = new ActivityStateFilterContext(context, inputDescriptor, serializedValue, context.CancellationToken);
var filterResult = await manager.RunFiltersAsync(filterContext);
context.ActivityState[inputDescriptor.Name] = filterResult;
// TODO: Disable filtering for now until we redesign log sanitization.
// var serializedValue = await context.GetRequiredService<ISafeSerializer>().SerializeToElementAsync(value);
// var manager = context.GetRequiredService<IActivityStateFilterManager>();
// var filterContext = new ActivityStateFilterContext(context, inputDescriptor, serializedValue, context.CancellationToken);
// var filterResult = await manager.RunFiltersAsync(filterContext);
context.ActivityState[inputDescriptor.Name] = value;
}
}
}