I noticed my old flags are marked “stale” even tho...
# ask-questions
s
I noticed my old flags are marked “stale” even though they are simple on/off flags with no rules, but maybe now a rule is required, like opting in all users or something? Previously created flags still work fine.
f
The
stale
mark is just something we show if a flag hasn't been updated in a while. Just a reminder to check and see if it's still something you need or not. It doesn't affect anything else. You can click the warning icon to disable staleness checks for a specific feature if you want.
s
Great I am glad we can disable
f
I see in your screenshot that the feature is only toggled on for the
dev
environment. Is your application using a dev client key? If it's using any of the other environments instead, the feature will be evaluated to
null
⬆️ 1
s
Thank you for drawing my attention there, I am working in the dev environment as always. Any other common gotchas I might be missing?
We have always used :: for separators in our feature names
api::2022-12-26::release::use-new-feature
I noticed colons were not listed as acceptable characters in your docs, so I replaced with underscores, but no luck.
f
Can you share the exact code you are using to check the feature value for this feature?
s
Copy code
import omit from "lodash/omit";

import {getFeatureValue} from "@blackowl/feature-client";

export const handleSaveBasedOnLeaseStatus = async ({}) => {
  console.log(
    "getfromhandleSaveBasedOnLeaseStatus",
    getFeatureValue(
      "platform::2023-05-02::release::working-flag",
    ),
  );
  console.log(
    "getNewFlag",
    getFeatureValue(
      "api::2023-12-17::release::not-working",
    ),
  );
  console.log(
    "getNewFlagWithUnderscores",
    getFeatureValue(
      "api_2023-12-17_release_not_working",
    ),
  );
I had to delete some code for security, but this is where I am console logging flags 2,3, and 4 from the logs screen shot. The first flag is an older flag and is working properly. The other two I created an hour ago or so.
Do you want the feature-client code. We know it works, but I can send it.
f
I would double check the feature keys in your code and make sure they 100% match what's in the GrowthBook UI. I don't see a feature with id
api_2023-12-17_release_not_working
in your account at all for example.
s
Yeah, sorry I changed the name for security, but now I realize I already sent it in the log screenshot.
I copy and pasted all the names so for sure they are correct.
If there is no gotcha coming right to your mind, I will have one of the other dev try to create one and see what I can find out.
I really appreciate your time.
f
On the GrowthBook client instance, there is a
getFeatures()
method you can call and console.log it:
Copy code
console.log(growthbook.getFeatures())
You can check if the feature is listed there
s
Good call… let me try that real quick
f
It should look something like this based on your screenshot:
Copy code
{
  "api_2023-...": {
    "defaultValue": true
  }
}
s
The new ones I created are on the list with the default value set to true.
Copy code
'api::2023-12-16::backend-validations-costs-standards-interconnections': { defaultValue: true },
  'api::2023-12-17::release::be-validations-costs-all-standards': { defaultValue: true },
  'api_2023-12-17_release_be-validations-costs-all-standards': { defaultValue: true }
So big surprise, the problem is on my end 🙂
I will continue debugging with this assurance that they are coming in properly from gb. Thanks again for your help.
Really weird that the old one shows up and the new one doesn’t 🤔