@@ -195,16 +195,17 @@ def variable(user, key, default, opts = {})
195195 value = default
196196 type = determine_variable_type ( default )
197197 defaulted = true
198- eval = { reason : DevCycle ::EVAL_REASONS :: DEFAULT , details : DevCycle ::DEFAULT_REASON_DETAILS ::USER_NOT_TARGETED }
198+ eval = { reason : DevCycle ::DEFAULT_REASONS :: USER_NOT_TARGETED , details : DevCycle ::DEFAULT_REASON_DETAILS ::USER_NOT_TARGETED }
199199 if local_bucketing_initialized? && @local_bucketing . has_config
200200 type_code = variable_type_code_from_type ( type )
201201 variable_pb = variable_for_user_pb ( user , key , type_code )
202202 unless variable_pb . nil?
203203 value = get_variable_value ( variable_pb )
204204 defaulted = false
205- eval = get_eval_reason ( variable_pb )
206205 end
206+ eval = get_eval_reason ( variable_pb )
207207 else
208+ eval = { reason : DevCycle ::DEFAULT_REASONS ::DEFAULT , details : DevCycle ::DEFAULT_REASON_DETAILS ::MISSING_CONFIG }
208209 @logger . warn ( "Local bucketing not initialized, returning default value for variable #{ key } " )
209210 variable_event = Event . new ( { type : DevCycle ::EventTypes [ :agg_variable_defaulted ] , target : key } )
210211 bucketed_config = BucketedUserConfig . new ( { } , { } , { } , { } , { } , { } , [ ] )
@@ -578,11 +579,14 @@ def get_variable_value(variable_pb)
578579 end
579580
580581 def get_eval_reason ( variable_pb )
581- if variable_pb . eval . nil?
582- { reason : DevCycle ::DEFAULT_REASONS ::USER_NOT_TARGETED , details : DevCycle ::DEFAULT_REASON_DETAILS ::USER_NOT_TARGETED }
582+ if variable_pb . nil?
583+ { reason : DevCycle ::DEFAULT_REASONS ::DEFAULT , details : DevCycle ::DEFAULT_REASON_DETAILS ::USER_NOT_TARGETED }
583584 else
584- puts ( "variable_pb.eval bruh: #{ variable_pb . eval } " )
585- { reason : variable_pb . eval . reason , details : variable_pb . eval . details }
585+ if variable_pb . eval . nil?
586+ { reason : DevCycle ::DEFAULT_REASONS ::USER_NOT_TARGETED , details : DevCycle ::DEFAULT_REASON_DETAILS ::USER_NOT_TARGETED }
587+ else
588+ { reason : variable_pb . eval . reason , details : variable_pb . eval . details , target_id : variable_pb . eval . target_id }
589+ end
586590 end
587591 end
588592
0 commit comments