Do not prematurely mark filter as ready for downstream processing#158
Do not prematurely mark filter as ready for downstream processing#158sabasehrish merged 2 commits intoFramework-R-D:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a critical bug in the conditional execution system where filters could be prematurely marked as ready for downstream processing. The issue occurred when product stores in the filter's data map were null, but the vector still had the expected size. The fix ensures that only non-null product stores are counted when determining if a filter has all required upstream data products available.
- Changed
data_map::is_complete()to count only non-null product stores instead of just checking vector size - Added assertions in
more_derived()to catch null stores early and fail fast
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| phlex/core/detail/filter_impl.cpp | Modified is_complete() to use std::ranges::count_if to count only non-null stores; added <algorithm> include for the ranges algorithm |
| phlex/core/message.cpp | Added defensive assertions to verify product stores are non-null before accessing their depth in more_derived() |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #158 +/- ##
==========================================
+ Coverage 81.14% 81.23% +0.08%
==========================================
Files 116 116
Lines 2042 2046 +4
Branches 326 328 +2
==========================================
+ Hits 1657 1662 +5
Misses 250 250
+ Partials 135 134 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Phlex supports conditional execution of nodes through
when("predicate1", "predicate2", ...)clauses, which can be included as part of a registration statement. When this occurs, that node is not allowed to execute until:"predicate1","predicate2", etc.) have been evaluated to trueThis PR fixes a problem with 1 above—namely, it makes a change to ensure that the products (actually, the product stores containing the products) are non-null before marking the filter as ready for downstream processing.