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

UpdateUserGroupContext does not update user list #1014

Open
rbroggi opened this issue Jan 3, 2022 · 1 comment
Open

UpdateUserGroupContext does not update user list #1014

rbroggi opened this issue Jan 3, 2022 · 1 comment

Comments

@rbroggi
Copy link

rbroggi commented Jan 3, 2022

What happened

Method UpdateUserGroupContext does not seem to be working correctly. I tried to browse the code for a usage example in the tests to make sure I was calling it correctly but I also realized that the method is not tested.

In my code I try to update the users belonging to a user group so I have something like:

userGroup := client.GetUserGroupsContext(ctx, slack.GetUserGroupsOptionIncludeUsers(true))
userGroup.Users = getNewUsers()
userGroup, err = api.UpdateUserGroupContext(ctx, userGroup)
// here I would expect the userGroup to have the new user ids, instead it has still the old ones

Expected behavior

I would expect to be able to change the users under a usergroup with the UpdateUserGroupContext method

Steps to reproduce

userGroup := client.GetUserGroupsContext(ctx, slack.GetUserGroupsOptionIncludeUsers(true))
userGroup.Users = getNewUsers()
userGroup, err = api.UpdateUserGroupContext(ctx, userGroup)
// here I would expect the userGroup to have the new user ids, instead it has still the old ones

reproducible code

userGroup := client.GetUserGroupsContext(ctx, slack.GetUserGroupsOptionIncludeUsers(true))
userGroup.Users = getNewUsers()
userGroup, err = api.UpdateUserGroupContext(ctx, userGroup)
// here I would expect the userGroup to have the new user ids, instead it has still the old ones

manifest.yaml

Versions

  • Go: 1.17
  • slack-go/slack: v0.10.1
@rbroggi
Copy link
Author

rbroggi commented Jan 3, 2022

Found myself that the right method for that is UpdateUserGroupMembersContext, maybe would it be worth adding documentation explicitly explaining that in the UpdateUserGroupContext method? Would it be great to find unit-tests for those methods as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants