https://www.growthbook.io/ logo
#ask-questions
Title
# ask-questions
h

hundreds-agent-51861

02/16/2024, 1:28 PM
Hi everyone, I'm using feature flags and targeting the evaluation with a
"Saved Group"
and integrated my
ExpressJS
application with
Growthbook Node.js SDK
. My express middleware for GB:
Copy code
- initialise GB instance
    req.gb = new GrowthBook(...);
- req.gb.setAtrributes(...)
- req.gb.loadFeatures({ timeout })
      .then(() => next())
      .catch((e) => {
        logger.error('Failed to load features from GrowthBook', e);
        next();
   });
My deployment is:
Express app => Growthbook-proxy(with REDIS enabled) => Growthbook Cloud
The feature flag rule is:
Copy code
{"id": {"$inGroup": "<grp_identifier>"}} 

Value to Force = on
In the saved group, I have specified a list of string ids on which the GrowthBook SDK helps in deciding which corresponding business logic variant to execute for that particular http request. As in:
Copy code
if request.growthBook.isOn()
   then: doThis()
else: doThat()
The problem I'm facing is despite some of the IDs not being in the saved group, GrowthBook's
.isOn
evaluates the feature flag to
true
If it is evaluated to
false
instead of
true
for an id existing in the saved group, I have a proven justification that growthbook loadFeature function failed to fetch it or the request timed out so it falls back to
false/null
. But I'm not able to further debug and find out what's going wrong with the
truthy
evaluation. I'd appreciate your response and assistance in resolving this issue.
🙃 1
f

fresh-football-47124

02/16/2024, 6:57 PM
What is the default value for your feature flag?
if it is default 'on' you wont know why its returning on - if its in the saved group or just falling to the default
h

hundreds-agent-51861

02/19/2024, 3:09 PM
Have a look at this ...
image.png
@fresh-football-47124 ^
@fresh-football-47124 ^
11 Views