fix(invite): set accepted for existing users#571
Conversation
Codecov Report
@@ Coverage Diff @@
## master #571 +/- ##
=======================================
Coverage 96.38% 96.38%
=======================================
Files 192 192
Lines 11453 11460 +7
=======================================
+ Hits 11039 11046 +7
Misses 414 414
Continue to review full report at Codecov.
|
|
|
||
| member.username = member.email; | ||
| member.invited = Date.now(); | ||
| member.accepted = password ? Date.now() : null; |
There was a problem hiding this comment.
logic is being changed here, how is the back-compatibility here?
There was a problem hiding this comment.
I suppose the logic here is not quite correct.
In the distributeUsersByExist getUserId returns only id without password for existing users.
In the registerOrganizationMember method returns the user with password
Then the existing users combines with new ones
const organizationMembers = registeredMembers.concat(createdMembers);
Some items in the merged list have a password but some do not. In the addMember method accepted-logic depends on the password.
As a result accepted flag will never assigned for existing users. Password condition is not valid in this case and I pass the { inviteAccepted: true } flag directly to determine the case when user invitation accepted .
There was a problem hiding this comment.
back-compatibility
@AVVS Added the separated field for joinedAt and keep the previous logic with accept.
a38f763 to
2b43297
Compare
|
🎉 This PR is included in version 15.6.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |
No description provided.