private async Task <IEnumerable <LoggingContext <ActionWrapper <T> > > > GetActionsInternalAsync <T>(string actionPath, bool shouldCheckFlight)
        {
            actionPath = actionPath.NormalizePath();
            IEnumerable <ActionResponse> filteredActionsForPath         = new List <ActionResponse>();
            List <LoggingContext <ActionWrapper <T> > > returnedActions = new List <LoggingContext <ActionWrapper <T> > >();

            if (tnActions.TryGetValue(actionPath, out Dictionary <string, ActionResponse> value))
            {
                foreach (ActionResponse actionResponse in value.Values)
                {
                    if (string.IsNullOrWhiteSpace(actionResponse.TriggerJson))
                    {
                        bool flag = true;
                        if (shouldCheckFlight && !string.IsNullOrEmpty(actionResponse.FlightName))
                        {
                            try
                            {
                                flag = await experimentationService.IsFlightEnabledAsync(actionResponse.FlightName, cancellationTokenSource.Token).ConfigureAwait(false);
                            }
                            catch
                            {
                                flag = false;
                            }
                            logger.LogVerbose($"{Name}-{actionResponse} depends on flight {actionResponse.FlightName}, isFlightEnabled: {flag}");
                        }
                        if (flag)
                        {
                            (filteredActionsForPath as List <ActionResponse>).Add(actionResponse);
                        }
                    }
                }
                if (useCache)
                {
                    filteredActionsForPath = notificationAndCourtesyCache.GetSendableActionsFromSet(filteredActionsForPath, cacheTimeoutMs);
                }
                foreach (ActionResponse item in filteredActionsForPath)
                {
                    try
                    {
                        returnedActions.Add(new LoggingContext <ActionWrapper <T> >(item.ToString(), item.AsTypedAction <T>()));
                    }
                    catch (TargetedNotificationsException exception)
                    {
                        string eventName = "VS/Core/TargetedNotifications/ActionJsonParseFailure";
                        string text      = $"Error handling {Name}-{item}";
                        Dictionary <string, object> additionalProperties = new Dictionary <string, object>
                        {
                            {
                                "VS.Core.TargetedNotifications.RuleId",
                                item.RuleId
                            },
                            {
                                "VS.Core.TargetedNotifications.FlightName",
                                item.FlightName
                            }
                        };
                        logger.LogError(text, exception);
                        targetedNotificationsTelemetry.PostCriticalFault(eventName, text, exception, additionalProperties);
                    }
                }
            }
            logger.LogVerbose($"Got {returnedActions.Count()} actions for path {actionPath} from provider {Name}");
            return(returnedActions);
        }
 /// <summary>
 /// Handles async requests for Flight.NameOfFlight
 /// </summary>
 /// <param name="key">Name of the flight</param>
 /// <returns>A True <see cref="T:Coding4Fun.VisualStudio.RemoteSettings.BoolScopeValue" /> if flight is enabled.</returns>
 public async Task <BoolScopeValue> ProvideAsync(string key)
 {
     return(new BoolScopeValue(await experimentationService.IsFlightEnabledAsync(key, CancellationToken.None)));
 }