-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
fixes #40: persist members and admins in group updates #104
fixes #40: persist members and admins in group updates #104
Conversation
@Redor I think I have solved a bug, but you might have also deliberately excluded admins and members from group updates, for a reason that I don't know. Can you confirm what your intentions here were? |
@guusdk there is no specific reason. The endpoint was just made to manage groups (add, create etc). But without directly setting the users (on creating of the group). |
That leads to odd behavior, in my opinion, as the data structure that acts as input does allow for setting users. Them being ignored is something that I suspect many users find unexpected.
I have noticed that. That endpoint is useful, but it does not allow for two things:
Do you have any concerns with my PR? If not then I would like to merge it. |
No concerns. I love the PR :) |
\o/ Let us allow @Fishbowler some time to point out my mistakes, or forever hold his peace. ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a bunch of questions, that might all be non-issues, but HTH.
src/java/org/jivesoftware/openfire/plugin/rest/controller/GroupController.java
Show resolved
Hide resolved
src/java/org/jivesoftware/openfire/plugin/rest/controller/GroupController.java
Show resolved
Hide resolved
src/java/org/jivesoftware/openfire/plugin/rest/controller/GroupController.java
Show resolved
Hide resolved
src/java/org/jivesoftware/openfire/plugin/rest/controller/GroupController.java
Show resolved
Hide resolved
1018146
to
12dfac9
Compare
@Fishbowler want to press the big green button, if you're OK with my last few changes? |
There's a lot of deletion since the last review. Intentional? |
Other than that, all looking like sensible change |
When creating or updating a group, the provided members and admins should not be ignored. Note that this change will result in admins/members being removed, when an update to an existing group does not properly include the existing members and admins. Prior to this commit, no modification would have been made to the admins and members.
… users JIDs on domains other than the local domain can be in groups. This commit adds support for that in the UserGroups endpoints, with the exception of an endpoint that would make the code iterate over all groups in the system.
09c3660
to
92818da
Compare
I'm unsure what deletions you're referring to. I have now rebased to the latest main branch to resolve a small merge conflict in |
Don't worry. Looks like a bug in the GH mobile app that I can't reproduce this morning. I was seeing chunks of docs and changelogs deleted last night. Take my 👍 |
When creating or updating a group, the provided members and admins should not be ignored.
Note that this change will result in admins/members being removed, when an update to an existing group does not properly include the existing members and admins. Prior to this commit, no modification would have been made to the admins and members.
I've tested this as follows:
First, see if a group that will be used for testing happens to exist (it should not):
Response status 404. The group doesn't exist, which is what was expected.
Create a new group, that has a couple of members and admins (all on a XMPP domain that is different from the XMPP domain services by the instance of Openfire):
Response status 201
(no body)
Retrieving the group again, to see if it was created as expected:
Response status 200:
This seems to include all members and admins as expected.
Next, try to modify the group members and admins. Remove two, retain one, and add one (which covers all permutations that I could think of) in each list.
Response status 200:
(no body)
Finally, retrieve the group again, to see if the modifications were persisted:
Response status 200:
That seems all fine by me.