Fix: Condition Sets Incorrectly Evaluate Infrequent Telemetry Updates#8002
Fix: Condition Sets Incorrectly Evaluate Infrequent Telemetry Updates#8002Pranaykarvi wants to merge 4 commits into
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8002 +/- ##
==========================================
- Coverage 57.69% 57.27% -0.42%
==========================================
Files 678 678
Lines 27438 27437 -1
Branches 2694 2694
==========================================
- Hits 15829 15715 -114
- Misses 11269 11379 +110
- Partials 340 343 +3
... and 14 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
@akhenry Could you please review and approve this PR? Thanks! |
|
@Pranaykarvi Thank you for taking a look at this issue. Indeed, I initially thought that simply removing the short-circuit evaluation would be enough to fix this issue but when I tested this I found that it caused an unacceptable performance regression. So the approach I took instead was to keep the short-circuit evaluation, but pass in a snapshot of the latest telemetry values so that when the evaluation gets to the a condition set with stale telemetry it will always be evaluated with the latest telemetry. It's more work, but it gives us the best of both worlds. Let me know what you think - #8041 Thanks for your contribution. I'll make sure you're credited in the other PR. |
|
Hi @akhenry, thanks so much for the considered answer! Your solution with the telemetry snapshot is a good one — clever way to maintain accuracy without sacrificing performance. Learned a lot investigating this problem, and I'm glad I was able to help in some small way. Thanks heaps for the credit in #8041 — really appreciated! Looking forward to diving into more Open MCT work soon. |
Issue #7992
Condition sets can incorrectly evaluate telemetry objects that update infrequently due to short-circuit evaluation. This causes stale results and incorrect conditional styling. The issue occurs because the evaluation stops when a condition evaluates to
true, preventing subsequent conditions from being re-evaluated with the latest telemetry data.Fix
Removed short-circuiting in the
updateConditionResultsmethod to ensure all conditions are re-evaluated with the latest telemetry data. This prevents stale results and ensures that the condition set's state is always accurate.Changes
updateConditionResultsto iterate over all conditions and update their results, regardless of whether a previous condition evaluated totrue.Impact