Learning center

Record the feature flags the browser evaluated

When a feature flag or an experiment decides which code path a user gets, two people on the same build can see different products. The maintainer needs the flag values the reporter's browser actually evaluated, at the time of the bug. The flag configuration in the dashboard is not the same thing.

Why the dashboard is not the evidence#

A flag's configuration says who should get which variant: a percentage rollout, a targeting rule, an override for one account. The value a browser evaluated depends on that configuration, the user's attributes at that moment, and when the SDK last fetched the configuration. Each can differ from what the dashboard shows now.

  • Percentage rollouts assign users by hashing an identifier. The maintainer's account lands in a different bucket.
  • Targeting reads attributes such as plan, country or signup date. A test account may not match.
  • Caching. Client SDKs typically cache flag values in memory or storage and refresh them on an interval or a streamed update. A browser that was open for hours can hold old values.
  • Changes since. Someone may have changed the rollout after the report.

Capture the evaluated values#

Read the values from the reporter's browser, at the time of the bug.

  1. If the app exposes them, use that: a debug panel, a window object in non-production builds, or a response from your own flag endpoint in the Network panel.
  2. Look for the SDK's storage. Many client SDKs keep their last values in local storage or IndexedDB. The storage guide shows how to export them.
  3. Look for the request. The SDK's evaluation or configuration request in the Network panel shows the user context sent and the values returned. Copy the response.

Write down each flag name, the variant, and the time it was read. If your flag system uses the OpenFeature model, an evaluation also carries a reason, such as a targeting match, a split or a default value; record it, since "default" can mean the SDK never reached its provider.

Replay with the same values#

Give the maintainer a way to pin the reporter's variants:

  • An override mechanism in the app, such as a query parameter or a local storage key read in non-production builds.
  • A targeted rule for the maintainer's test account in staging, matching the reporter's variants exactly.
  • A seeded SDK cache before page load, if the SDK reads from storage first. Block the SDK's network refresh with request blocking so it does not overwrite the seeded values.

Then confirm the replay: read the evaluated values in the maintainer's browser the same way and compare them with the report.

Worked example: a checkout that skipped the address step#

This example is fictional. A tester reports that checkout jumps from the cart straight to payment, with no address step. Two developers cannot reproduce it.

The tester exports local storage and finds the flag SDK's cache: checkout_v2: "on", address_autofill: "off". The developers' browsers evaluate both as "on". Checkout v2 assumed that address autofill would fill the address step and skipped it when it saw a saved address. With autofill off, nothing filled it. The combination had never been tested because the rollout plan assumed both flags would always move together. A staging rule with the tester's two values reproduced it on the first try.

Questions#

What if the values changed during the session?

Some SDKs update values while the page is open. If the bug started mid-session, capture the values both before and after, or look for the update in the Network panel's log. A flag that flipped under an open page is a cause in itself.

Should flags be in every bug report?

When a page is behind any flag or experiment, yes. A template field for evaluated flags costs the reporter little and saves the maintainer a round trip.

Can flag values contain personal data?

The values rarely do, but the evaluation context sent to the flag service often includes a user ID, email or other attributes. Remove those from what you share.

Return to reproducing what someone else saw for the other layers a replay needs.

One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. Eligibility and fair-use terms.

Start free with GitHub

Related reading