Skip to content

Polling clients receive stale feature data when non-environment changes occur (revision ID not updated) #11281

@gastonfournier

Description

@gastonfournier

Describe the bug

In Unleash v7.2+, changes to feature flags that are not tied to a specific environment are not propagated to clients using polling mode. As a result, clients (and Edge) keep serving stale feature data until an unrelated environment-scoped change occurs (e.g. toggling a flag on/off).

This happens because some non-environment changes still affect the environment-scoped feature payload, but do not update the revision ID used for cache invalidation / polling. Consequently, polling clients never detect the change.

This regression does not occur in Unleash 7.0 or 7.1.x (tested up to 7.1.2), and was introduced in 7.2.

Restarting Edge or clients does not resolve the issue. Making an unrelated environment change does fix it, which strongly suggests incorrect revision handling.

Steps to reproduce the bug

Example (archiving case):

  1. Run Unleash v7.2+.
  2. Create a feature flag enabled in an environment.
  3. Archive the feature (archive is environment-agnostic).
  4. Query the /api/client/features endpoint using an environment token.
  5. Observe that the archived feature is still returned.
  6. Unarchive the feature.
  7. Check again: The feature is returned but with incorrect state.
  8. Toggle the feature on/off.
  9. Poll again: data is now correct.

Similar reproduction applies to:

  • Adding/removing a parent flag
  • Changing impression data
  • Moving the feature to another project

Expected behavior

Any change that affects the environment-scoped feature payload should:

  • Update the revision ID for that environment
  • Be detected by polling clients
  • Result in updated feature data without requiring unrelated changes

Polling clients should always converge to the correct state.

Logs, error output, etc.

Screenshots

No response

Additional context

  • Confirmed not to be an Edge-specific issue (same behavior observed directly against the backend).
  • Regression introduced in v7.2.
  • Root cause identified: revision handling does not account for non-environment changes that still affect environment responses.
  • Likely related to PR chore(AI): etagByEnv flag cleanup #10560.
  • Proposed fix adjusts revision calculation to correctly account for environment-impacting changes.

Unleash version

7.2.0

Subscription type

None

Hosting type

None

SDK information (language and version)

No response

Metadata

Metadata

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions