Skip to content

Commit 2f23df7

Browse files
committed
Be more strict about the flag operator
1 parent 2d500bb commit 2f23df7

File tree

2 files changed

+2045
-2053
lines changed

2 files changed

+2045
-2053
lines changed

posthog/feature_flags.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,10 @@ def evaluate_flag_dependency(
160160
if operator == "flag_evaluates_to":
161161
return matches_dependency_value(expected_value, actual_value)
162162
else:
163-
# For backwards compatibility, treat other operators as exact comparison
164-
# but flag dependencies should use flag_evaluates_to
165-
return actual_value == expected_value
163+
# This should never happen, but just to be defensive.
164+
raise InconclusiveMatchError(
165+
f"Flag dependency property for '{property.get('key', 'unknown')}' has invalid operator '{operator}'"
166+
)
166167

167168
# If no value check needed, return True (all dependencies passed)
168169
return True

0 commit comments

Comments
 (0)