diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/AnalyticsEvents.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/AnalyticsEvents.java index 6483cf4c50..bcad9d46e2 100644 --- a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/AnalyticsEvents.java +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/constants/AnalyticsEvents.java @@ -16,6 +16,7 @@ public enum AnalyticsEvents { LOGOUT, FIRST_LOGIN, EXECUTE_ACTION("execute_ACTION_TRIGGERED"), + EXECUTE_INVITE_USERS("execute_INVITE_USERS"), UPDATE_LAYOUT, PUBLISH_APPLICATION("publish_APPLICATION"), FORK, diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/AnalyticsServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/AnalyticsServiceCEImpl.java index 9db6f6c9a8..f45c22062c 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/AnalyticsServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/AnalyticsServiceCEImpl.java @@ -22,6 +22,7 @@ import reactor.core.publisher.Mono; import reactor.core.scheduler.Schedulers; import java.util.HashMap; +import java.util.List; import java.util.Map; @Slf4j @@ -220,7 +221,12 @@ public class AnalyticsServiceCEImpl implements AnalyticsServiceCE { */ private String getEventTag(AnalyticsEvents event, T object) { // In case of action execution or instance setting update, event.getEventName() only is used to support backward compatibility of event name - boolean isNonResourceEvent = AnalyticsEvents.EXECUTE_ACTION.equals(event) || AnalyticsEvents.AUTHENTICATION_METHOD_CONFIGURATION.equals(event); + List nonResourceEvents = List.of( + AnalyticsEvents.EXECUTE_ACTION, + AnalyticsEvents.AUTHENTICATION_METHOD_CONFIGURATION, + AnalyticsEvents.EXECUTE_INVITE_USERS + ); + boolean isNonResourceEvent = nonResourceEvents.contains(event); final String eventTag = isNonResourceEvent ? event.getEventName() : event.getEventName() + "_" + object.getClass().getSimpleName().toUpperCase(); return eventTag; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/UserServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/UserServiceCEImpl.java index 6625a024f4..7aa65d24d9 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/UserServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/UserServiceCEImpl.java @@ -1,5 +1,6 @@ package com.appsmith.server.services.ce; +import com.appsmith.external.constants.AnalyticsEvents; import com.appsmith.external.helpers.AppsmithBeanUtils; import com.appsmith.external.models.Policy; import com.appsmith.external.services.EncryptionService; @@ -677,7 +678,7 @@ public class UserServiceCEImpl extends BaseService return permissionGroupService.bulkAssignToUsers(permissionGroup, users); }).cache(); - // Send analytics event and don't wait for the result + // Send analytics event Mono sendAnalyticsEventMono = Mono.zip(currentUserMono, inviteUsersMono) .flatMap(tuple -> { User currentUser = tuple.getT1(); @@ -687,8 +688,7 @@ public class UserServiceCEImpl extends BaseService List invitedUsers = users.stream().map(User::getEmail).collect(Collectors.toList()); analyticsProperties.put("numberOfUsersInvited", numberOfUsers); analyticsProperties.put("userEmails", invitedUsers); - analyticsService.sendEvent("execute_INVITE_USERS", currentUser.getEmail(), analyticsProperties); - return Mono.empty(); + return analyticsService.sendObjectEvent(AnalyticsEvents.EXECUTE_INVITE_USERS, currentUser, analyticsProperties); }); return bulkAddUserResultMono.then(sendAnalyticsEventMono).then(inviteUsersMono);