Describe the bug
In dynamic refresh, change detection appears to rely on strict numeric comparison of page._response.status.
The current condition in src/appConfigurationImpl.ts:
if (page._response.status === 200) { // created or changed
return true;
}
In my runtime, page._response.status is represented as a string value ("200"). When this happens, refresh does not detect changes even though the service returns updated data.
To Reproduce
- Use
@azure/app-configuration-provider@2.5.0 with feature flag refresh enabled.
const endpoint = process.env.AZURE_APP_CONFIG_ENDPOINT;
const appConfig = await load(endpoint, new DefaultAzureCredential(), {
selectors: [{ keyFilter: "_" }],
featureFlagOptions: {
enabled: true,
selectors: [{ keyFilter: "*" }],
refresh: {
enabled: true,
refreshIntervalInMs,
},
},
});
const featureProvider = new ConfigurationMapFeatureFlagProvider(appConfig);
const featureManager = new FeatureManager(featureProvider);
- Get the value of a FeatureFlag
await appConfig.refresh();
const isEnabled = await featureManager.isEnabled(flagName);
- Change the feature flag in Azure App Configuration.
- Get the value of the feature flag again.
- Observe that the value does not update.
This Gist contains a full sample script.
Expected behavior
If the service response indicates changed data (HTTP 200), refresh should detect the change and reload feature flags.
Actual behavior
Refresh requests are sent and changed data is returned, but local feature flags remain stale until process restart.
Environment
- Package:
@azure/app-configuration-provider@2.5.0
- App framework: Next.js App Router (Node SSR path)
- Node:
22.22.2
- OS: macOS Darwin
25.5.0 arm64
- Related package:
@microsoft/feature-management@2.3.1
Candidate fix (validated locally)
Changing the comparison to coerce status resolves the issue in my environment:
if (Number(page._response.status) === 200) { // created or changed
return true;
}
This local patch made refresh() apply feature flag updates without restart.
Notes
I can open a PR with the above fix.
Describe the bug
In dynamic refresh, change detection appears to rely on strict numeric comparison of
page._response.status.The current condition in
src/appConfigurationImpl.ts:In my runtime,
page._response.statusis represented as a string value ("200"). When this happens, refresh does not detect changes even though the service returns updated data.To Reproduce
@azure/app-configuration-provider@2.5.0with feature flag refresh enabled.This Gist contains a full sample script.
Expected behavior
If the service response indicates changed data (HTTP 200), refresh should detect the change and reload feature flags.
Actual behavior
Refresh requests are sent and changed data is returned, but local feature flags remain stale until process restart.
Environment
@azure/app-configuration-provider@2.5.022.22.225.5.0arm64@microsoft/feature-management@2.3.1Candidate fix (validated locally)
Changing the comparison to coerce status resolves the issue in my environment:
This local patch made
refresh()apply feature flag updates without restart.Notes
I can open a PR with the above fix.