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

Change execution order to ensure the account is locked in case of a notification sending failure #895

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ThaminduR
Copy link
Contributor

Proposed changes in this pull request

This PR resolves an issue in the self-registration flow where user accounts would remain unlocked if the account confirmation notification failed to send. When account confirmation is enabled, the user's account should be locked until they verify it. However, if a server error occurs during notification delivery (e.g., missing account confirmation email template), the account remains unlocked, leading to unintended behavior.

Changes Made

  • Adjusted the order of execution to ensure that the user account lock and account state claims are persisted before triggering the notification for account confirmation. Guaranteed that the user account is locked immediately upon successful registration, irrespective of the success or failure of notification delivery.

Note: This behavior isn't reproduced in case of a email server failure. ATM this can be reproduced by removing the account confirmation email template.

Issue

wso2/product-is#21290

@ThaminduR ThaminduR changed the title Change execution order to ensure the account is locked in case of a n… Change execution order to ensure the account is locked in case of a notification sending failure Dec 16, 2024
Copy link

codecov bot commented Dec 16, 2024

Codecov Report

Attention: Patch coverage is 0% with 17 lines in your changes missing coverage. Please review.

Project coverage is 50.38%. Comparing base (1b9b22a) to head (d8ec2df).
Report is 50 commits behind head on master.

Files with missing lines Patch % Lines
.../recovery/handler/UserSelfRegistrationHandler.java 0.00% 17 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #895      +/-   ##
============================================
- Coverage     50.45%   50.38%   -0.08%     
- Complexity     2380     2432      +52     
============================================
  Files           297      298       +1     
  Lines         17767    18197     +430     
  Branches       2516     2615      +99     
============================================
+ Hits           8965     9168     +203     
- Misses         7662     7880     +218     
- Partials       1140     1149       +9     
Flag Coverage Δ
unit 38.41% <0.00%> (+0.48%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jenkins-is-staging
Copy link

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/12351339821

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/12351339821
Status: success

Copy link

@jenkins-is-staging jenkins-is-staging left a comment

Choose a reason for hiding this comment

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

Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/12351339821

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