From 354746ca739c78d7ac6f38ee86885ff2b62c371f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SAL=C4=B0H=20=C3=96ZKARA?= Date: Thu, 11 Dec 2025 13:46:02 +0300 Subject: [PATCH] Add 'OldCli' flag to additional telemetry properties Ensures the 'OldCli' flag is set in the AdditionalProperties dictionary within the telemetry context, creating the dictionary if it does not exist. This provides consistent telemetry data for identifying CLI usage. --- .../Cli/Telemetry/TelemetryCliSessionProvider.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/framework/src/Volo.Abp.Cli/Volo/Abp/Cli/Telemetry/TelemetryCliSessionProvider.cs b/framework/src/Volo.Abp.Cli/Volo/Abp/Cli/Telemetry/TelemetryCliSessionProvider.cs index bc0fcc2028..17c340febd 100644 --- a/framework/src/Volo.Abp.Cli/Volo/Abp/Cli/Telemetry/TelemetryCliSessionProvider.cs +++ b/framework/src/Volo.Abp.Cli/Volo/Abp/Cli/Telemetry/TelemetryCliSessionProvider.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.IO; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; @@ -26,6 +27,18 @@ public class TelemetryCliSessionProvider : TelemetryActivityEventEnricher context.Current[ActivityPropertyNames.IsFirstSession] = !File.Exists(TelemetryPaths.ActivityStorage); context.Current["OldCli"] = true; + if(context.Current.TryGetValue>(ActivityPropertyNames.AdditionalProperties, out var additionalProperties)) + { + additionalProperties["OldCli"] = true; + } + else + { + context.Current[ActivityPropertyNames.AdditionalProperties] = new Dictionary + { + { "OldCli", true } + }; + } + return Task.CompletedTask; } } \ No newline at end of file