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

Do not apply behaviors twice #107

Merged
merged 2 commits into from
Sep 12, 2023
Merged

Do not apply behaviors twice #107

merged 2 commits into from
Sep 12, 2023

Conversation

yhabteab
Copy link
Member

@yhabteab yhabteab commented Apr 19, 2023

This change prevents now the subject behaviors from being applied for the same filter condition over again when it's wrapped into a subquery. This PR removes also the (now obsolete if condition) from the binary behaviour.

fixes #48
closes Icinga/icingaweb2-module-x509#174

src/Behavior/Binary.php Show resolved Hide resolved
src/Compat/FilterProcessor.php Outdated Show resolved Hide resolved
src/Compat/FilterProcessor.php Outdated Show resolved Hide resolved
src/Compat/FilterProcessor.php Outdated Show resolved Hide resolved
src/Compat/FilterProcessor.php Outdated Show resolved Hide resolved
@lippserd
Copy link
Member

This boolean shows that the code flow is flawed and a proper solution would be not to perform any behaviors when the filter is moved to a subquery where it is processed again.

@yhabteab yhabteab force-pushed the do-not-apply-behaviours-twice branch from 7161383 to d391360 Compare April 19, 2023 12:00
@lippserd
Copy link
Member

Please use behaviors also in the PR title and description.

@yhabteab yhabteab changed the title Do not apply behaviours twice Do not apply behaviors twice Apr 19, 2023
@yhabteab yhabteab force-pushed the do-not-apply-behaviours-twice branch from d391360 to 80b4f29 Compare April 19, 2023 15:14
@nilmerg nilmerg added this to the v0.6.0 milestone Jun 14, 2023
@yhabteab yhabteab force-pushed the do-not-apply-behaviours-twice branch from 3e95512 to 1d4ecd4 Compare June 14, 2023 13:39
@lippserd lippserd self-requested a review July 13, 2023 09:36
lippserd
lippserd previously approved these changes Sep 4, 2023
src/Compat/FilterProcessor.php Outdated Show resolved Hide resolved
src/Behavior/Binary.php Show resolved Hide resolved
@nilmerg nilmerg added the bug Something isn't working label Sep 12, 2023
@nilmerg nilmerg removed the request for review from lippserd September 12, 2023 11:36
@nilmerg nilmerg merged commit 89790e0 into main Sep 12, 2023
13 checks passed
@nilmerg nilmerg deleted the do-not-apply-behaviours-twice branch September 12, 2023 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cla/signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Behaviors are processed twice when a filter is used in a subquery
3 participants