fix: afterCreateUser callback being called before setting user's roles#30309
Merged
kodiakhq[bot] merged 17 commits intodevelopfrom Apr 23, 2024
Merged
fix: afterCreateUser callback being called before setting user's roles#30309kodiakhq[bot] merged 17 commits intodevelopfrom
afterCreateUser callback being called before setting user's roles#30309kodiakhq[bot] merged 17 commits intodevelopfrom
Conversation
afterCreateUser callback being called before setting user's roles
2cf82c6 to
32e0068
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #30309 +/- ##
===========================================
+ Coverage 51.16% 54.84% +3.68%
===========================================
Files 2026 2276 +250
Lines 46638 50407 +3769
Branches 9486 10274 +788
===========================================
+ Hits 23861 27646 +3785
+ Misses 20562 20287 -275
- Partials 2215 2474 +259
Flags with carried forward coverage won't be shown. Click here to find out more. |
🦋 Changeset detectedLatest commit: d9474b0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 32 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
pierre-lehnen-rc
previously approved these changes
Oct 16, 2023
pierre-lehnen-rc
previously approved these changes
Oct 16, 2023
Contributor
|
Thanks @pierre-lehnen-rc 🙌 Appreciate your insights and help on this item :) |
elfajriharsuda
approved these changes
Jan 9, 2024
Contributor
|
Looks like this PR is ready to merge! 🎉 |
pierre-lehnen-rc
previously approved these changes
Apr 8, 2024
pierre-lehnen-rc
approved these changes
Apr 8, 2024
ggazzo
reviewed
Apr 23, 2024
|
|
||
| if (Match.test(user.globalRoles, [String]) && user.globalRoles.length > 0) { | ||
| globalRoles.push(...user.globalRoles); | ||
| user.globalRoles.map((role) => globalRoles.add(role)); |
Member
There was a problem hiding this comment.
user.globalRoles.forEach((role) => globalRoles.add(role));
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes (including videos or screenshots)
Issue(s)
https://rocketchat.atlassian.net/browse/OC-1276
https://rocketchat.atlassian.net/browse/SUP-541
Steps to test or reproduce
Further comments
This fixes a problem with Business Hours, where the callback for updating agents and assign the proper open business hours was not being fired because
afterCreateUserwas being called way before setting the roles for a user.This caused the callback to ignore the user and thus not updating its
openBusinessHours, making the user unavailable to enable its status.