-
Notifications
You must be signed in to change notification settings - Fork 13
Make the invitation of slack users more robust #160
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
Conversation
…and improve return type for invite function
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.
Pull Request Overview
This PR aims to make the invitation of Slack users more robust by enhancing error handling and improving the invitation flow.
- Added handling for ultra-restricted users in conversation_invite.
- Introduced a new helper function get_userid_by_username and updated invite_newuser_to_channel to return a user_id.
- Updated proposal channel logic to store managers and bots while processing user invitations.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…and update documentation
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.
Pull Request Overview
This pull request enhances the Slack invitation flow by inviting new workspace users directly into the channel upon invitation and handling edge cases with restricted users more gracefully.
- Force-invokes channel invites by using the force parameter.
- Introduces error handling for ultra-restricted users.
- Refactors the invitation process to look up new users immediately after inviting.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Pull Request Overview
This PR improves the Slack invitation flow by ensuring that new workspace invites and channel additions are robust and clear to users. Key changes include adding a force parameter to the conversations_invite API call, introducing error handling for ultra-restricted users, and refactoring the invitation logic (including adding a new function to retrieve user IDs by username) to ensure consistency and clarity.
Comments suppressed due to low confidence (1)
src/nsls2api/services/slack_service.py:363
- [nitpick] Add a comment to clarify that if lookup_user_by_email returns None after a successful invite, the function will return None, ensuring clarity on how failures in user retrieval post-invitation are handled.
if response.get("ok"):
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
For users that need to be invited in the NSLS2 workspace, they will not appear as a member of the channel that they are invited into until they accept the invite, but for any additional channels that we add the user to they will appear instantly. In order to avoid confusion this PR intends to, once the new user is invited to the workspace, we then also add it to the channel at the same time.