hundreds-agent-51861
02/16/2024, 1:28 PM"Saved Group"
and integrated my ExpressJS
application with Growthbook Node.js SDK
.
My express middleware for GB:
- 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:
{"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:
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.fresh-football-47124
fresh-football-47124
hundreds-agent-51861
02/19/2024, 3:09 PMhundreds-agent-51861
02/19/2024, 3:09 PMhundreds-agent-51861
02/19/2024, 3:10 PMhundreds-agent-51861
02/22/2024, 7:20 AM