@@ -510,12 +510,15 @@ private SplitResult getTreatmentWithConfigInternal(String matchingKey, String bu
510510 long start = System .currentTimeMillis ();
511511
512512 EvaluatorImp .TreatmentLabelAndChangeNumber result = _evaluator .evaluateFeature (matchingKey , bucketingKey , featureFlag , attributes );
513-
514- if (result .label != null && result .label .contains (Labels .DEFINITION_NOT_FOUND ) && _gates .isSDKReady ()) {
515- _log .warn (String .format (
516- "%s: you passed \" %s\" that does not exist in this environment, " +
517- "please double check what feature flags exist in the Split user interface." , methodEnum .getMethod (), featureFlag ));
518- return checkFallbackTreatment (featureFlag );
513+ String label = result .label ;
514+ if (result .label != null && result .label .contains (Labels .DEFINITION_NOT_FOUND )) {
515+ if (_gates .isSDKReady ()) {
516+ _log .warn (String .format (
517+ "%s: you passed \" %s\" that does not exist in this environment, " +
518+ "please double check what feature flags exist in the Split user interface." , methodEnum .getMethod (), featureFlag ));
519+ return checkFallbackTreatment (featureFlag );
520+ }
521+ label = result .label .replace (Labels .DEFINITION_NOT_FOUND , Labels .NOT_READY );
519522 }
520523
521524 recordStats (
@@ -525,7 +528,7 @@ private SplitResult getTreatmentWithConfigInternal(String matchingKey, String bu
525528 start ,
526529 result .treatment ,
527530 String .format ("sdk.%s" , methodEnum .getMethod ()),
528- _config .labelsEnabled () ? result . label : null ,
531+ _config .labelsEnabled () ? label : null ,
529532 result .changeNumber ,
530533 attributes ,
531534 result .track ,
@@ -634,20 +637,23 @@ private Map<String, SplitResult> processEvaluatorResult(Map<String, EvaluatorImp
634637 List <DecoratedImpression > decoratedImpressions = new ArrayList <>();
635638 Map <String , SplitResult > result = new HashMap <>();
636639 evaluatorResult .keySet ().forEach (flag -> {
640+ String label = evaluatorResult .get (flag ).label ;
637641 if (evaluatorResult .get (flag ).label != null &&
638- evaluatorResult .get (flag ).label .contains (Labels .DEFINITION_NOT_FOUND ) &&
639- _gates .isSDKReady ()) {
640- _log .warn (String .format ("%s: you passed \" %s\" that does not exist in this environment please double check " +
641- "what feature flags exist in the Split user interface." , methodEnum .getMethod (), flag ));
642- result .put (flag , checkFallbackTreatment (flag ));
643- } else {
644- result .put (flag , new SplitResult (evaluatorResult .get (flag ).treatment , evaluatorResult .get (flag ).configurations ));
645- decoratedImpressions .add (
646- new DecoratedImpression (
647- new Impression (matchingKey , bucketingKey , flag , evaluatorResult .get (flag ).treatment , System .currentTimeMillis (),
648- evaluatorResult .get (flag ).label , evaluatorResult .get (flag ).changeNumber , attributes , properties ),
649- evaluatorResult .get (flag ).track ));
642+ evaluatorResult .get (flag ).label .contains (Labels .DEFINITION_NOT_FOUND )) {
643+ if (_gates .isSDKReady ()) {
644+ _log .warn (String .format ("%s: you passed \" %s\" that does not exist in this environment please double check " +
645+ "what feature flags exist in the Split user interface." , methodEnum .getMethod (), flag ));
646+ result .put (flag , checkFallbackTreatment (flag ));
647+ return ;
648+ }
649+ label = evaluatorResult .get (flag ).label .replace (Labels .DEFINITION_NOT_FOUND , Labels .NOT_READY );
650650 }
651+ result .put (flag , new SplitResult (evaluatorResult .get (flag ).treatment , evaluatorResult .get (flag ).configurations ));
652+ decoratedImpressions .add (
653+ new DecoratedImpression (
654+ new Impression (matchingKey , bucketingKey , flag , evaluatorResult .get (flag ).treatment , System .currentTimeMillis (),
655+ label , evaluatorResult .get (flag ).changeNumber , attributes , properties ),
656+ evaluatorResult .get (flag ).track ));
651657 });
652658 _telemetryEvaluationProducer .recordLatency (methodEnum , System .currentTimeMillis () - initTime );
653659 if (!decoratedImpressions .isEmpty ()) {
0 commit comments