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 Slack usergroup adapter #300

Merged

Conversation

chris-brindley
Copy link
Contributor

This PR fixes a bug in the Slack usergroup adapter that was causing issues when adding and removing users from a group in a single operation.

The Add and Remove methods rely on internal state of the adapter to understand what user IDs are to be sent to the API. This internal state is only updated on the Get method, not the Add or Remove methods. Thus, when calling Add and subsequently Remove (or vice-versa), the state is wrong and the adapter sends an incorrect set of IDs to the Slack API. This resulted is buggy behaviour causing users to be added and removed in quick succession.

Copy link

github-actions bot commented Dec 11, 2023

Test Results

196 tests   196 ✔️  9s ⏱️
  14 suites      0 💤
    1 files        0

Results for commit 48b581a.

♻️ This comment has been updated with latest results.

@chris-brindley
Copy link
Contributor Author

I've fixed the linting for the Slack usergroup adapter but the version of golangci-lint currently running adds a bunch of new linters that are failing on a lot of the existing code. Not sure what to do with these...

@chris-brindley chris-brindley force-pushed the NOJIRA/fix-slack-usergroups branch from 06e054a to 48b581a Compare December 14, 2023 17:21
@chris-brindley
Copy link
Contributor Author

@mike-gregory-ovo I have rebased and force-pushed, should be okay for a re-review now 👍

Copy link
Contributor

@mike-gregory-ovo mike-gregory-ovo left a comment

Choose a reason for hiding this comment

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

Looks great, thanks @chris-brindley! 🚀

@mike-gregory-ovo mike-gregory-ovo merged commit 1fc978e into ovotech:main Dec 15, 2023
4 checks passed
@chris-brindley chris-brindley deleted the NOJIRA/fix-slack-usergroups branch December 20, 2023 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants