[Sync][master -> next][#384]: Fix tenant and sub-organization differentiation logic when building the PushNotificationData in push notification handler#386
Merged
Conversation
…ion and add primaryTenantDomain to push notification data if tenant org flow
…organization tenants
Comment on lines
+273
to
+275
| if (NotificationUtil.isOrganization(tenantDomain)) { | ||
| LOG.debug("Tenant domain is an organization."); | ||
| try { |
There was a problem hiding this comment.
Log Improvement Suggestion No: 1
Suggested change
| if (NotificationUtil.isOrganization(tenantDomain)) { | |
| LOG.debug("Tenant domain is an organization."); | |
| try { | |
| if (NotificationUtil.isOrganization(tenantDomain)) { | |
| LOG.debug("Tenant domain is an organization."); | |
| try { | |
| LOG.info("Resolving organization ID for tenant domain: " + tenantDomain); |
Comment on lines
+278
to
+281
| } catch (OrganizationManagementException e) { | ||
| if (LOG.isDebugEnabled()) { | ||
| LOG.debug("Error while resolving organization ID for tenant domain: " + tenantDomain, e); | ||
| } |
There was a problem hiding this comment.
Log Improvement Suggestion No: 2
Suggested change
| } catch (OrganizationManagementException e) { | |
| if (LOG.isDebugEnabled()) { | |
| LOG.debug("Error while resolving organization ID for tenant domain: " + tenantDomain, e); | |
| } | |
| } catch (OrganizationManagementException e) { | |
| if (LOG.isDebugEnabled()) { | |
| LOG.debug("Error while resolving organization ID for tenant domain: " + tenantDomain, e); | |
| } | |
| LOG.error("Failed to resolve organization ID: " + e.getMessage()); |
Comment on lines
+879
to
+882
| public static boolean isOrganization(String tenantDomain) throws IdentityEventException { | ||
|
|
||
| try { | ||
| return OrganizationManagementUtil.isOrganization(tenantDomain); |
There was a problem hiding this comment.
Log Improvement Suggestion No: 3
Suggested change
| public static boolean isOrganization(String tenantDomain) throws IdentityEventException { | |
| try { | |
| return OrganizationManagementUtil.isOrganization(tenantDomain); | |
| public static boolean isOrganization(String tenantDomain) throws IdentityEventException { | |
| if (log.isDebugEnabled()) { | |
| log.debug("Checking if tenant domain belongs to an organization: " + tenantDomain); | |
| } | |
| try { | |
| return OrganizationManagementUtil.isOrganization(tenantDomain); |
Comment on lines
+895
to
+901
| public static String getPrimaryTenantDomain(String organizationId) throws IdentityEventException { | ||
|
|
||
| try { | ||
| OrganizationManager organizationManager = NotificationHandlerDataHolder.getInstance() | ||
| .getOrganizationManager(); | ||
| String primaryOrgId = organizationManager.getPrimaryOrganizationId(organizationId); | ||
| return organizationManager.resolveTenantDomain(primaryOrgId); |
There was a problem hiding this comment.
Log Improvement Suggestion No: 4
Suggested change
| public static String getPrimaryTenantDomain(String organizationId) throws IdentityEventException { | |
| try { | |
| OrganizationManager organizationManager = NotificationHandlerDataHolder.getInstance() | |
| .getOrganizationManager(); | |
| String primaryOrgId = organizationManager.getPrimaryOrganizationId(organizationId); | |
| return organizationManager.resolveTenantDomain(primaryOrgId); | |
| public static String getPrimaryTenantDomain(String organizationId) throws IdentityEventException { | |
| if (log.isDebugEnabled()) { | |
| log.debug("Retrieving primary tenant domain for organization: " + organizationId); | |
| } | |
| try { | |
| OrganizationManager organizationManager = NotificationHandlerDataHolder.getInstance() | |
| .getOrganizationManager(); | |
| String primaryOrgId = organizationManager.getPrimaryOrganizationId(organizationId); | |
| return organizationManager.resolveTenantDomain(primaryOrgId); |
There was a problem hiding this comment.
AI Agent Log Improvement Checklist
- The log-related comments and suggestions in this review were generated by an AI tool to assist with identifying potential improvements. Purpose of reviewing the code for log improvements is to improve the troubleshooting capabilities of our products.
- Please make sure to manually review and validate all suggestions before applying any changes. Not every code suggestion would make sense or add value to our purpose. Therefore, you have the freedom to decide which of the suggestions are helpful.
✅ Before merging this pull request:
- Review all AI-generated comments for accuracy and relevance.
- Complete and verify the table below. We need your feedback to measure the accuracy of these suggestions and the value they add. If you are rejecting a certain code suggestion, please mention the reason briefly in the suggestion for us to capture it.
| Comment | Accepted (Y/N) | Reason |
|---|---|---|
| #### Log Improvement Suggestion No: 1 | ||
| #### Log Improvement Suggestion No: 2 | ||
| #### Log Improvement Suggestion No: 3 | ||
| #### Log Improvement Suggestion No: 4 |
|
PR builder started |
|
PR builder completed |
|
PR builder completed |
jenkins-is-staging
approved these changes
Apr 7, 2026
jenkins-is-staging
left a comment
There was a problem hiding this comment.
Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/24096728554
ZiyamSanthosh
approved these changes
Apr 8, 2026
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.
🤖 Auto-sync from master
This PR automatically syncs the changes from #384 to the
nextbranch.Original PR: #384
Author: @VihangaMunasinghe
Total commits: 6
Workflow run: https://github.com/wso2-extensions/identity-event-handler-notification/actions/runs/24076534518
Commits: