Skip to content
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

[basicprofiles] Fix handling of multiple $DELTA conditions #18088

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jimtng
Copy link
Contributor

@jimtng jimtng commented Jan 11, 2025

There was a bug when having multiple DELTA conditions, resulting in pematurely saving the previous accepted value.

Example:

$DELTA > 1, $DELTA < 10:

  • An initial input 50 will be accepted (correct behavior)

  • Second input of 60 will pass $DELTA > 1 (60 - 50 is greater than 1)

  • Here, the accepted value was incorrectly saved to be 60 before checking the next condition

  • When the next condition is checked, the input of 60 is compared against the acceptedvalue (now 60), so the delta is 60 - 60 which is less than 10.

  • The correct behavior should be that input 60 is compared against the accepted value of 50, so 60 - 50 which is not less than 10.

Only after all conditions are checked and met should the accepted value be updated.

Please backport to 4.3

@jimtng jimtng requested a review from J-N-K as a code owner January 11, 2025 11:29
@jlaur jlaur added the bug An unexpected problem or unintended behavior of an add-on label Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants