-
Notifications
You must be signed in to change notification settings - Fork 41
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
Issue #SH-135 managedby-user::update scenario - when email/phone is u… #949
base: release-3.0.0
Are you sure you want to change the base?
Issue #SH-135 managedby-user::update scenario - when email/phone is u… #949
Conversation
…pdated, managedBy flag set to null
…nagedBy user updating email/phone
@@ -963,6 +987,25 @@ private void sendEmailAndSms(Map<String, Object> userMap) { | |||
tellToAnother(EmailAndSmsRequest); | |||
} | |||
|
|||
private Response sendResetPasswordLink(Map<String, Object> userMap) { |
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.
Isn't this already somewhere? If so, please remove that and unify these code.
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.
I searched no-where in our code base this is present. Normally from ResetPasswordController "resetPassword" actor is called. In this use-case we need reset-password link to be generated to called from here.
LoggerEnum.INFO.name()); | ||
Response response = | ||
(Response) | ||
interServiceCommunication.getResponse( |
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.
This is a bad idea - interServiceCommunication within the actor systems. Please get rid of it and call the actor directly.
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.
@indrajra if we want to call a actor from another actor, we are calling tellToAnother() in the BaseActor, but whatever actor we call from this is purely async calls. Here in my scenario sync call is needed so tellToAnother() cannot be used. Even InterServiceCommunicationImpl.getResponse also calling the actor the same way you suggested. Correct me if i am wrong.
@@ -901,6 +916,15 @@ private void setStateValidation( | |||
userBooleanMap.put( | |||
JsonKey.STATE_VALIDATED, (boolean) userDbRecord.get(JsonKey.STATE_VALIDATED)); | |||
} | |||
// adding in release-3.0.0 |
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.
Without email, phone, setting these fields doesnt make sense. If there is any failure due to it, lets fix that.
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.
@@ -206,6 +207,12 @@ private void updateUser(Request actorMessage) { | |||
Map<String, Boolean> userBooleanMap = updatedUserFlagsMap(userMap, userDbRecord); | |||
int userFlagValue = userFlagsToNum(userBooleanMap); | |||
requestMap.put(JsonKey.FLAGS_VALUE, userFlagValue); | |||
if (StringUtils.isNotEmpty((String) userDbRecord.get(JsonKey.MANAGED_BY)) |
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.
can you add a comment - to who will this apply? A regular user or managed user.
A managed user cannot update an email or phone (UI will not allow it).
If it happens in future, then we will accept it and set managedBy = null. This managed user has become an adult and is no more dependent on the regular user.
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.
…can update the user details
SonarCloud Quality Gate failed. 0 Bugs |
…pdated, managedBy flag set to null
when email/phone is updated for a managedBy user, then managedBy filed is set to null.
Response:
{ "id": "api.user.update", "ver": "v1", "ts": "2020-05-19 12:07:34:772+0530", "params": { "resmsgid": null, "msgid": null, "err": null, "status": "success", "errmsg": null }, "responseCode": "OK", "result": { "response": "SUCCESS", "link": "reset_password_link.html" } }