Skip to content

[Sync][master -> next][#384]: Fix tenant and sub-organization differentiation logic when building the PushNotificationData in push notification handler#386

Merged
ZiyamSanthosh merged 6 commits into
nextfrom
sync-pr-384-to-next
Apr 8, 2026
Merged

[Sync][master -> next][#384]: Fix tenant and sub-organization differentiation logic when building the PushNotificationData in push notification handler#386
ZiyamSanthosh merged 6 commits into
nextfrom
sync-pr-384-to-next

Conversation

@github-actions

@github-actions github-actions Bot commented Apr 7, 2026

Copy link
Copy Markdown

🤖 Auto-sync from master

This PR automatically syncs the changes from #384 to the next branch.

Original PR: #384
Author: @VihangaMunasinghe
Total commits: 6
Workflow run: https://github.com/wso2-extensions/identity-event-handler-notification/actions/runs/24076534518

Commits:

c41935d9 Update push notification version to 1.1.4 in pom.xml
a824bf14 Fix typo in tenant domain parameter name in isOrganization method
5e39f7bd Update carbon kernel version to 4.12.29
820417ca Add tests for primary tenant domain retrieval and event handling for organization tenants
35d13334 Refactor organization UUID retrieval to primary tenant domain resolution and add primaryTenantDomain to push notification data if tenant org flow
49d401f4 Fix the tenant and org differentiation logic

Comment on lines +273 to +275
if (NotificationUtil.isOrganization(tenantDomain)) {
LOG.debug("Tenant domain is an organization.");
try {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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);

@wso2-engineering wso2-engineering Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

AI Agent Log Improvement Checklist

⚠️ Warning: AI-Generated Review Comments

  • 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

@jenkins-is-staging

Copy link
Copy Markdown

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

@jenkins-is-staging

Copy link
Copy Markdown

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

@jenkins-is-staging

Copy link
Copy Markdown

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

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

Copy link
Copy Markdown

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/24096728554

@ZiyamSanthosh
ZiyamSanthosh merged commit dbce898 into next Apr 8, 2026
1 check passed
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.

3 participants