-
Notifications
You must be signed in to change notification settings - Fork 544
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
Improve idp deletion error scenario. #6178
base: master
Are you sure you want to change the base?
Improve idp deletion error scenario. #6178
Conversation
PR builder started |
1b2d38d
to
6565355
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6178 +/- ##
============================================
+ Coverage 45.02% 45.39% +0.36%
- Complexity 13679 13899 +220
============================================
Files 1606 1619 +13
Lines 99398 100302 +904
Branches 16761 16833 +72
============================================
+ Hits 44755 45531 +776
- Misses 48002 48082 +80
- Partials 6641 6689 +48
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
...t/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/dao/IdPManagementFacade.java
Show resolved
Hide resolved
...g.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/util/IdPManagementConstants.java
Outdated
Show resolved
Hide resolved
PR builder completed |
...t/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/dao/IdPManagementFacade.java
Show resolved
Hide resolved
} | ||
throw e; | ||
} catch (IdentityProviderManagementException e) { | ||
// Error will not be thrown, since the IDPs is already deleted. But there will be stale actions. |
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.
typo -> IdPs are deleted
@@ -604,6 +604,14 @@ public static class SQLQueries { | |||
"SELECT * FROM IDP_AUTHENTICATOR WHERE TENANT_ID = ? AND DEFINED_BY = 'USER'"; | |||
} | |||
|
|||
public static class WarningMessage { | |||
|
|||
public static final String WARN_STALE_IDP_ACTION = "The %s Identity Provider was deleted, but an error " + |
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.
Let's rather say, Identity Provider: %s is deleted. but ....
Remove "The" in the plural form as well and use present tense
Quality Gate passedIssues Measures |
Issue:
The existing implementation deletes the associated action first and then deletes the Identity Provider (IDP) from the database. If an error occurs while deleting the IDP, a rollback mechanism adds the action back. However, the newly added action does not retain the original ID, causing inconsistencies.
To address this, we are changing the implementation to delete the IDP from the database first, followed by deleting the associated action. However, if an error occurs during the deletion of the action, it will result in a stale action remaining in the system. Added a warn for that.