feat: experiment metadata on flags, exposure gated on inExperiment - #420
Conversation
e8b9dae to
b82e510
Compare
b82e510 to
95253d5
Compare
|
@themis-blindfold review |
⚖️ Themis review: 🟠 Fix before mergeTL;DR: Replacing a running experiment with a new one that resolves to the same assignment drops the new experiment's exposure, so its results are undercounted. The two completed Test checks passed; Jest is not installed locally, so I could not rerun the suite here.
🟠 Majors
📝 Walkthrough
🧪 How to verify
Product take: Accurate exposure attribution is core to experiment decisions. This is a solid capability addition, but missing the first exposure after an experiment replacement can skew results. 🧭 Assumptions & unverified claimsNo unverified assumptions or claims. A tiny key omission is enough to lose an experiment’s evidence · reviewed at 95253d5 |
|
@themis-blindfold review |
⚖️ Themis review: 🟠 Fix before mergeTL;DR: The experiment metadata, enrolment gate, and attribution ID are wired through, but the React bindings retain an old experiment name after a name-only server refresh. The completed Test check passed.
🟠 Majors
⚖️ Acknowledged
📝 Walkthrough
🧪 How to verify
Product take: Experiment labels can remain stale in React UIs after a rename, even though the SDK has fetched the renamed metadata. This is a solid experimentation capability, but the displayed metadata needs to stay coherent with the refreshed assignment. 🧭 Assumptions & unverified claimsNo unverified assumptions or claims. The experiment knows its new name; the hook should too. · reviewed at 348822d |
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Core now sends
metadata.experiment { id, name, in_experiment }on/identitiesflags while the feature's experiment is running (Flagsmith/flagsmith#8532).IFlagsmithFeature.experiment?: { id, name, inExperiment }, lifted frommetadata.experiment.undefinedon older servers.getExperimentFlaganduseExperimentfire the exposure only wheninExperimentistrue, instead of guessing fromvariant. Flag data is still returned otherwise.metadata.experiment_idfor attribution.useFlagspropagatesexperimentthrough the React bindings.Release after Core (Flagsmith/flagsmith#8532) and Edge (Flagsmith/edge-api#719) are live: against older servers no flag carries
experiment, so no exposure is recorded.How did you test this code?
Jest: new
test/experiment.test.tsplus extended React event, variant and type tests, 131 tests passing.tscclean.Manual QA against staging once Core and Edge are deployed.