Skip to content

Backend: break feature flag request dependency

Administrator requested to merge cc/feature-flag-actor into main

Created by: camdencheek

This breaks the dependency between feature flags and a request object. Now that AnonymousUID exists on the actor struct, we don't need to hold on to the request object for the cookie and we can depend purely on the actor for the information we need to populate feature flags. This makes it possible to set feature flags for an overridden actor.

Additionally, this fixes an issue where, if the actor is changed on a context, the feature flags returned may still be for the first actor.

Builds off #32475

Test plan

Added tests for both the middleware functionality and the "to/from contexts" functionality.

Merge request reports

Loading