Skip to content

Commit

Permalink
Geo context cleanup before ODD sendNotifications
Browse files Browse the repository at this point in the history
  • Loading branch information
XDex committed Sep 18, 2023
1 parent e26d8eb commit d97c6cb
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Source/Adobe.Target.Client/Service/OnDeviceDecisioningService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ public TargetDeliveryResponse ExecuteRequest(TargetDeliveryRequest deliveryReque
var elapsedMilliseconds = (int)stopwatch.ElapsedMilliseconds;
var telemetry = deliveryRequest.GetTelemetryEntry(this.clientConfig, elapsedMilliseconds);

CleanupGeoContext(deliveryRequest);

this.SendNotifications(deliveryRequest, targetResponse, notifications, telemetry);

TargetClient.Logger?.LogDebug(targetResponse.ToString());
Expand All @@ -160,6 +162,25 @@ internal OnDeviceDecisioningEvaluation EvaluateLocalExecution(TargetDeliveryRequ
return this.decisioningEvaluator.EvaluateLocalExecution(request);
}

private static void CleanupGeoContext(TargetDeliveryRequest deliveryRequest)
{
var geo = deliveryRequest.DeliveryRequest.Context.Geo;
if (string.IsNullOrWhiteSpace(geo.City))
{
geo.City = null;
}

if (string.IsNullOrWhiteSpace(geo.StateCode))
{
geo.StateCode = null;
}

if (string.IsNullOrWhiteSpace(geo.CountryCode))
{
geo.CountryCode = null;
}
}

private static string RemoveLocationHint(string tntId)
{
if (string.IsNullOrEmpty(tntId))
Expand Down

0 comments on commit d97c6cb

Please sign in to comment.