Hi everyone, We're using GrowthBook for many featu...
# ask-questions
f
Hi everyone, We're using GrowthBook for many feature flags and recently ran into an issue. Our users have a default landing page preference. For example, if a user’s preferred landing page is
<http://url.com/a|url.com/a>
, when they visit
<http://url.com|url.com>
, we redirect them to
<http://url.com/a|url.com/a>
. Before redirecting, we check whether the user has access to the page using a feature flag (which relies on an attribute passed via a force rule). The problem is that at the time of this check, we don’t get the actual value. We assumed that the initial feature load would provide the correct values immediately, but the forced value—based on the attribute—loads later. By then, we’ve already made the access decision. We've tried timeouts, conditional loading with
growthbook.ready
, and other approaches, but nothing seems to work. Is there a workaround for this?
f
Hi Raj whats the default if the attribute is not loadded?
"Attribute passed by a force rule".- what do you mean by this?
f
For some, it is true and for some it is false.
So, by default, we are serving true, (for some flags it may be false). We have force rules set which only apply to some attributes.
Like this
f
the rules should load really quickly - usually the slow part is fetching the attributes
but you're setting an attribute based on a different feature flag result? Do i understand that?
f
No, we are setting attribute after authorization. It is one time process.
Oh, so you mean, force rules are also initially loaded as well?
Yes, they are. Why is it then re-rendering it again? Any suggestion
f
if the attributes update, we'll update the results as the flag values may change
f
Is there any better way to handle these senarios?
f
I dont think thee is a magical way, other than some sort of loading state while you wait for the user attribute
f
Cool. thank you for the quick response. Have a good day.