Skip to content

Refresh change detection can miss updates when page._response.status is a string ("200") #333

Description

@IvanTheBearable

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

  1. 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);
  1. Get the value of a FeatureFlag
await appConfig.refresh();
const isEnabled = await featureManager.isEnabled(flagName);
  1. Change the feature flag in Azure App Configuration.
  2. Get the value of the feature flag again.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions