Skip to content

Commit 0cf59df

Browse files
author
Varun Rathore
committed
fix for Bug: Custom Signals Not Evaluating Correctly
1 parent c6423af commit 0cf59df

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

firebase_admin/remote_config.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def get_float(self, key):
197197
return self.get_value(key).as_float()
198198

199199
def get_value(self, key):
200-
if self._config_values[key]:
200+
if key in self._config_values:
201201
return self._config_values[key]
202202
return _Value('static')
203203

@@ -261,7 +261,6 @@ def evaluate(self):
261261
"""Internal function Evaluates the cached server template to produce
262262
a ServerConfig"""
263263
evaluated_conditions = self.evaluate_conditions(self._conditions, self._context)
264-
265264
# Overlays config Value objects derived by evaluating the template.
266265
if self._parameters:
267266
for key, parameter in self._parameters.items():
@@ -454,10 +453,10 @@ def evaluate_custom_signal_condition(self, custom_signal_condition,
454453
Returns:
455454
True if the condition is met, False otherwise.
456455
"""
457-
custom_signal_operator = custom_signal_condition.get('custom_signal_operator') or {}
458-
custom_signal_key = custom_signal_condition.get('custom_signal_key') or {}
456+
custom_signal_operator = custom_signal_condition.get('customSignalOperator') or {}
457+
custom_signal_key = custom_signal_condition.get('customSignalKey') or {}
459458
target_custom_signal_values = (
460-
custom_signal_condition.get('target_custom_signal_values') or {})
459+
custom_signal_condition.get('targetCustomSignalValues') or {})
461460

462461
if not all([custom_signal_operator, custom_signal_key, target_custom_signal_values]):
463462
logger.warning("Missing operator, key, or target values for custom signal condition.")

0 commit comments

Comments
 (0)