microscopic-ocean-92851
11/27/2024, 9:20 PMon: false, source: 'defaultValue'
I would not expect to see the default of the feature flag, when the experiment rule should be serving truemicroscopic-ocean-92851
11/27/2024, 9:29 PMhelpful-application-7107
12/04/2024, 4:39 PMHowever, when we skipped the cache on init and then asked for if the flag was onDid you set a
uniqueId
when you did this test?helpful-application-7107
12/04/2024, 4:39 PMhelpful-application-7107
12/04/2024, 4:48 PMuniqueId
set.microscopic-ocean-92851
12/04/2024, 6:46 PMSorry for the slow response here (got lost in the holiday sauce!)No worries at all!
Did you set aYes, we have been running the code in prod for a bit and have been monitor against an A/A test of the same code. For some clarity, we have successfully used the rollout once before, but for some reason in this case we did not see what we expected. PS. I am not exactly sure if a rollout will have an experiment/experiment result when asking about a feature. I reached out mainly that I could repro at the time in a code sandbox ignoring our more complicated fanout (Cloudfront -> Vercel / Edge / NextJS) each of which has it's own caching layer. The code sandbox was simply init'ing GB and inspecting the getFeatures resultswhen you did this test?uniqueId
helpful-application-7107
12/04/2024, 6:47 PMI am not exactly sure if a rollout will have an experiment/experiment result when asking about a feature.I think it should.
helpful-application-7107
12/04/2024, 6:48 PMmicroscopic-ocean-92851
12/04/2024, 6:49 PMmicroscopic-ocean-92851
12/04/2024, 6:49 PMWas the experiment still in the sdk payload when it was in the temp rollout state?Not that I saw at the time š
helpful-application-7107
12/04/2024, 6:49 PMhelpful-application-7107
12/04/2024, 6:49 PMmicroscopic-ocean-92851
12/04/2024, 6:51 PMmicroscopic-ocean-92851
12/04/2024, 6:52 PMhappy-autumn-40938
12/04/2024, 6:52 PMhappy-autumn-40938
12/04/2024, 6:56 PMhappy-autumn-40938
12/04/2024, 6:57 PMhappy-autumn-40938
12/04/2024, 6:59 PMhappy-autumn-40938
12/04/2024, 7:00 PMhappy-autumn-40938
12/04/2024, 7:08 PMmicroscopic-ocean-92851
12/04/2024, 7:20 PMSkip rule because user not included in rollout {id: 'testing', rule: Object}
Use default value {id: 'testing', value: false}
microscopic-ocean-92851
12/04/2024, 7:23 PMhappy-autumn-40938
12/04/2024, 7:23 PMmicroscopic-ocean-92851
12/04/2024, 7:25 PMmicroscopic-ocean-92851
12/04/2024, 7:26 PMhappy-autumn-40938
12/04/2024, 7:26 PMmicroscopic-ocean-92851
12/04/2024, 7:26 PMhappy-autumn-40938
12/04/2024, 7:27 PMmicroscopic-ocean-92851
12/04/2024, 7:31 PMmicroscopic-ocean-92851
12/04/2024, 7:31 PMmicroscopic-ocean-92851
12/04/2024, 8:18 PMconsole.log(growthbook.evalFeature("testing"));
there is no experiment in the evalFeature
's result.
My expectation was that there would be an experiment and result still.
Re: https://growthbookusers.slack.com/archives/C07E4HA06MD/p1733338164984769?thread_ts=1732742454.275509&cid=C07E4HA06MD
It is in the payload, but not returned by evalFeature in the same shape as a running experiment, which breaks the logic I've shown youhelpful-application-7107
12/04/2024, 8:21 PMhelpful-application-7107
12/04/2024, 8:21 PMmicroscopic-ocean-92851
12/04/2024, 8:28 PMmicroscopic-ocean-92851
12/04/2024, 8:29 PMhappy-autumn-40938
12/04/2024, 8:31 PMmicroscopic-ocean-92851
12/04/2024, 8:48 PMmore prescriptiveThat would have helped a lot. We started the journey back in Feb. We were on the App router, but there was no example at the time. Once we determined we wanted to run at the edge for caching reasons it took a lot of trial and error to get here.
microscopic-ocean-92851
12/04/2024, 8:59 PMsetForcedVariations
to bypass the experiment logic on the server where we do not have the hash attribute available.
This works as long as we run the experiment logic.
Since the rollout's eval feature is not actually computed as an experiment, we are failing to set the variation.
I would use getExperiments
and then just ask for the value for each. However that returns the experiments from the payload which is empty even when we do have experiment rules.
{
"status": 200,
"features": {
"product-overview-reorder-sections": {
"defaultValue": false,
"rules": [
{
"coverage": 1,
"hashAttribute": "uniqueId",
"seed": "647ef094-a7c6-4dcc-adf4-d1c216286e6e",
"hashVersion": 2,
"variations": [
false,
true
],
"weights": [
0.5,
0.5
],
"key": "product-overview-reorder-sections",
"meta": [
{
"key": "0",
"name": "Description First"
},
{
"key": "1",
"name": "Compatibility First"
}
],
"phase": "0",
"name": "Product Overview Reorder Sections"
}
]
},
"testing": {
"defaultValue": false,
"rules": [
{
"coverage": 1,
"hashAttribute": "uniqueId",
"seed": "3554bf39-d234-42a9-8a8f-93766d6203b8",
"hashVersion": 2,
"force": true
}
]
},
"experiments": [],
"dateUpdated": "2024-12-04T18:54:47.700Z"
}
happy-autumn-40938
12/04/2024, 9:02 PMmicroscopic-ocean-92851
12/04/2024, 9:03 PMmicroscopic-ocean-92851
12/04/2024, 9:05 PMgetExperimentsFromPayload
or a computeExperimentsValues
which accounts for rollout experiments
⢠An example of computing the experiments at the edge and passing them into a Next.js app
⦠In our case we rewrite the url to add the computedExperiments in a path and then parse it serverside
āŖļø This allows the CDN to cache server responses for each possible arrangement of valuesmicroscopic-ocean-92851
12/04/2024, 9:06 PMmicroscopic-ocean-92851
12/04/2024, 9:06 PM