Skip to content

Commit

Permalink
resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyuanliang-ms committed Dec 2, 2024
2 parents f0dabb5 + 68aee33 commit 4f4a223
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/AzureAppConfigurationImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
#client: AppConfigurationClient;
#options: AzureAppConfigurationOptions | undefined;
#isInitialLoadCompleted: boolean = false;
#featureFlagTracing: FeatureFlagTracingOptions = new FeatureFlagTracingOptions();
#featureFlagTracing: FeatureFlagTracingOptions | undefined;

// Refresh
#refreshInProgress: boolean = false;
Expand Down Expand Up @@ -68,6 +68,9 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {

// Enable request tracing if not opt-out
this.#requestTracingEnabled = requestTracingEnabled();
if (this.#requestTracingEnabled) {
this.#featureFlagTracing = new FeatureFlagTracingOptions();
}

if (options?.trimKeyPrefixes) {
this.#sortedTrimKeyPrefixes = [...options.trimKeyPrefixes].sort((a, b) => b.localeCompare(a));
Expand Down Expand Up @@ -284,7 +287,9 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
selector.pageEtags = pageEtags;
}

this.#featureFlagTracing.resetFeatureFlagTracing();
if (this.#requestTracingEnabled && this.#featureFlagTracing !== undefined) {
this.#featureFlagTracing.resetFeatureFlagTracing();
}

// parse feature flags
const featureFlags = await Promise.all(
Expand Down Expand Up @@ -559,13 +564,13 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
throw new Error("The value of configuration setting cannot be undefined.");
}
const featureFlag = JSON.parse(rawFlag);

if (featureFlag[CONDITIONS_KEY_NAME] && featureFlag[CONDITIONS_KEY_NAME][CLIENT_FILTERS_KEY_NAME]) {
for (const filter of featureFlag[CONDITIONS_KEY_NAME][CLIENT_FILTERS_KEY_NAME]) {
this.#featureFlagTracing.updateFeatureFilterTracing(filter[NAME_KEY_NAME]);
if (this.#requestTracingEnabled && this.#featureFlagTracing !== undefined) {
if (featureFlag[CONDITIONS_KEY_NAME] && featureFlag[CONDITIONS_KEY_NAME][CLIENT_FILTERS_KEY_NAME]) {
for (const filter of featureFlag[CONDITIONS_KEY_NAME][CLIENT_FILTERS_KEY_NAME]) {
this.#featureFlagTracing.updateFeatureFilterTracing(filter[NAME_KEY_NAME]);
}
}
}

return featureFlag;
}
}
Expand Down

0 comments on commit 4f4a223

Please sign in to comment.