I am trying to use the chrome extension to overrid...
# announcements
r
I am trying to use the chrome extension to override the variation but I am not getting the updated value and cannot figure why the exact reason, anyone had a similar issue?
👀 1
f
Are you using the React SDK or the Javascript SDK?
r
Javascript, and I think I figured out the reason
f
Ok, after the chrome extension overrides the feature, you need to re-render your app to re-evaluate all of the features. If you're using a SPA framework like Angular or Vue, you can do this pretty easily by calling the
setRenderer
function on the GrowthBook instance and give it a callback function. It will be called every time you change a feature value in the dev tools
r
No I did not 😅
I am a bit lost of what I should pass exactly to the renderer, and I am using angular
f
Depends on what framework you're using
Copy code
growthbook.setRenderer(function() {
  // Code to force your application to re-render and
  // re-evaluate features
})
r
Sorry for not passing the framework before
f
I'm not too familiar with Angular. In our React SDK, we have a counter that we increment every time the render function is called. And we pass that counter value to any component that is using features. This forces the components to re-render when the counter changes
r
so you basically have to pass this to every component?
I would like to avoid this and be able to implement a more generic approach instead of adding logic to every single component
f
In React we're using Context, which does just that. Not sure if Angular has something similar. Basically, any component that calls
useFeature("my-feature")
will be re-rendered automatically, but nothing else will be
r
I am trying to understand something here, without any override I have this value
after I override the current value, I just want to change the variation
I think I am trying something wrong here
f
So if I understand correctly you have an experiment rule for a feature and you want to switch between the different variations. Is that right?
r
Exactly
f
Do you see the "Experiments" section in devtools? That's where you can switch between variations.
Overriding the feature value directly takes precedence over the experiment, so you might need to revert that global override first (icon next to "Current Value"
r
there is something wrong with my test setup I think, I have values 1 and 2 as you can see here
but in the chrome extension when I go to variation 2 the value goes tto 0
f
do you want to hop on a quick call and share your screen? Might be easier to debug that way
r
I would really appreciate it
I figured out the devtools issue. The chrome extension has it's own copy of the Javascript SDK that it uses internally and that version is out of date and displaying the wrong value when an experiment variation is forced.
r
Can I have it fixed somehow?
f
yep, I'm deploying a new version of the extension in a minute. Doing final testing now
r
About the SSR thing now I am only updating the id when it is in the browser so the id is the correct one now
I compared with the one in the extension and it is indeed the same one
f
That's good. I submitted the updated chrome extension, but it needs to go through Google's review process before it's available which could take a day or two.
r
hmm I think I can live with our current override logic until then
178 Views