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

Fix the recursive group membership check #4088

Merged
merged 1 commit into from Feb 12, 2024

Conversation

jimtng
Copy link
Contributor

@jimtng jimtng commented Feb 12, 2024

Allow a group to be a member of its direct parent and also its parent's ancestors without raising an error.

So this scenario is now allowed:

Group G1
Group G2 (G1)
Group G3 (G1, G2)

Looping membership is still detected and prevented as before, thus Stack Overflow is still avoided.
So this scenario is still not allowed, as it was originally intended:

Group R1 (R2)
Group R2 (R1)

and also not allowed:

Group R1 (R3)
Group R2 (R1)
Group R3 (R2)

Hopefully the new error message is also easier to understand, although it will only be issued when a real membership loop occurred.

See https://community.openhab.org/t/recursive-group-membership-found/135192
#3748

Allow a group to be a member of its direct parent and also its parent's ancestors without raising an error.

Looping membership is still detected and prevented as before, thus Stack Overflow is still avoided.

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
@jimtng jimtng requested a review from a team as a code owner February 12, 2024 10:52
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/recursive-group-membership-found/135192/29

@mherwege
Copy link
Contributor

Thanks, fixes a warning in my logs I have been ignoring all the time.

Copy link
Member

@J-N-K J-N-K left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@J-N-K J-N-K added the bug An unexpected problem or unintended behavior of the Core label Feb 12, 2024
@J-N-K J-N-K added this to the 4.2 milestone Feb 12, 2024
@J-N-K J-N-K merged commit 0efaf23 into openhab:main Feb 12, 2024
3 checks passed
@jimtng jimtng deleted the fix-recursive-membership branch February 13, 2024 03:03
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 the Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants