Skip to content

Fix 19633 interrupting event processing in the process_event_rules() function #19856

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ravenrs
Copy link

@ravenrs ravenrs commented Jul 10, 2025

Fixes: #19633

  1. condition.py
  • Added condition to to check when value is None. It should return False or not False if self.negative is True.
  • Change condition with self.negate to result XOR self.negate for compactness.
  1. test_condition.py
  • Added test to cover cases when Value is None.
  1. context_manager.py
  • Added context manager suppress_event_exp to prevent missing exceptions in cycles related to sequential event handling
  1. event.py
  • Using cm suppress_event_exp.
  1. test_event_rules.py
  • Added test to emulate the exception in process_event_function and verify that exception was logged properly.

…ere the field being compared (x) doesn't exist in the data dictionary, which would result in None when trying to access it, and you want these comparisons to safely return False rather than raising an error.

For this moment it returns and brake process_event_rules().
TypeError: expected string or bytes-like object, got 'NoneType'.
…Error and raise exeption: "TypeError: argument of type 'NoneType' is not iterable" with lead to breaking all events in the same object_type.
conditions.py - Change condition with self.negate to result XOR self.negate for compactness.
context_managers.py added context manager suppress_event_exp to prevent missing exceptions in cycles related to sequential event handling
events.py - using cm suppress_event_exp.
test_event_rules.py - added test to emulate the exception in process_event_function and verify that exception was logged properly.
@jeremystretch
Copy link
Member

@ravenrs please update the body of your PR above to reference the correct issue number.

@ravenrs
Copy link
Author

ravenrs commented Jul 10, 2025

@jeremystretch done.

@ravenrs ravenrs changed the title 19633 fix in condition eval Fix 19633 interrupting event processing in the process_event_rules() function Jul 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

process_event_rules() broke all events when condition evaluation contains None values.
3 participants