Skip to content

Commit 507beac

Browse files
committed
resolve conflicts and update
1 parent 4f08173 commit 507beac

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

src/AzureAppConfigurationImpl.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
3838
#sortedTrimKeyPrefixes: string[] | undefined;
3939
readonly #requestTracingEnabled: boolean;
4040
#clientManager: ConfigurationClientManager;
41-
#client: AppConfigurationClient;
42-
#clientEndpoint: string | undefined;
4341
#options: AzureAppConfigurationOptions | undefined;
4442
#isInitialLoadCompleted: boolean = false;
4543
#isFailoverRequest: boolean = false;
@@ -662,7 +660,7 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
662660
}
663661

664662
#createFeatureFlagReference(setting: ConfigurationSetting<string>): string {
665-
let featureFlagReference = `${this.#clientEndpoint}kv/${setting.key}`;
663+
let featureFlagReference = `${this.#clientManager.endpoint}/kv/${setting.key}`;
666664
if (setting.label && setting.label.trim().length !== 0) {
667665
featureFlagReference += `?label=${setting.label}`;
668666
}

src/ConfigurationClientManager.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ interface IConfigurationClientManager {
2727

2828
export class ConfigurationClientManager implements IConfigurationClientManager {
2929
isFailoverable: boolean;
30-
#endpoint: string;
30+
endpoint: string;
3131
#secret : string;
3232
#id : string;
3333
#credential: TokenCredential;
@@ -54,21 +54,21 @@ export class ConfigurationClientManager implements IConfigurationClientManager {
5454
this.#secret = parseConnectionString(connectionString, SecretSection);
5555
this.#id = parseConnectionString(connectionString, IdSection);
5656
// TODO: need to check if it's CDN or not
57-
this.#endpoint = parseConnectionString(connectionString, EndpointSection);
57+
this.endpoint = parseConnectionString(connectionString, EndpointSection);
5858

5959
} else if (connectionStringOrEndpoint instanceof URL) {
6060
const credential = credentialOrOptions as TokenCredential;
6161
options = appConfigOptions as AzureAppConfigurationOptions;
6262
this.#clientOptions = getClientOptions(options);
6363
staticClient = new AppConfigurationClient(connectionStringOrEndpoint.toString(), credential, this.#clientOptions);
64-
this.#endpoint = connectionStringOrEndpoint.toString();
64+
this.endpoint = connectionStringOrEndpoint.toString();
6565
this.#credential = credential;
6666
} else {
6767
throw new Error("A connection string or an endpoint with credential must be specified to create a client.");
6868
}
6969

70-
this.#staticClients = [new ConfigurationClientWrapper(this.#endpoint, staticClient)];
71-
this.#validDomain = getValidDomain(this.#endpoint);
70+
this.#staticClients = [new ConfigurationClientWrapper(this.endpoint, staticClient)];
71+
this.#validDomain = getValidDomain(this.endpoint);
7272
this.isFailoverable = (options?.replicaDiscoveryEnabled ?? true) && isFailoverableEnv();
7373
}
7474

@@ -80,7 +80,7 @@ export class ConfigurationClientManager implements IConfigurationClientManager {
8080
const currentTime = Date.now();
8181
if (this.#isFallbackClientDiscoveryDue(currentTime)) {
8282
this.#lastFallbackClientRefreshAttempt = currentTime;
83-
const host = new URL(this.#endpoint).hostname;
83+
const host = new URL(this.endpoint).hostname;
8484
await this.#discoverFallbackClients(host);
8585
}
8686

@@ -101,7 +101,7 @@ export class ConfigurationClientManager implements IConfigurationClientManager {
101101
if (this.isFailoverable &&
102102
currentTime > new Date(this.#lastFallbackClientRefreshAttempt + MinimalClientRefreshInterval).getTime()) {
103103
this.#lastFallbackClientRefreshAttempt = currentTime;
104-
const url = new URL(this.#endpoint);
104+
const url = new URL(this.endpoint);
105105
await this.#discoverFallbackClients(url.hostname);
106106
}
107107
}
@@ -129,7 +129,7 @@ export class ConfigurationClientManager implements IConfigurationClientManager {
129129
for (const host of srvTargetHosts) {
130130
if (isValidEndpoint(host, this.#validDomain)) {
131131
const targetEndpoint = `https://${host}`;
132-
if (targetEndpoint.toLowerCase() === this.#endpoint.toLowerCase()) {
132+
if (targetEndpoint.toLowerCase() === this.endpoint.toLowerCase()) {
133133
continue;
134134
}
135135
const client = this.#newConfigurationClient(targetEndpoint);

0 commit comments

Comments
 (0)