Merge branch 'hotfix/segment-bug' into 'master'

Fixing minor bugs in the Segment analytics flow

See merge request theappsmith/internal-tools-server!30
This commit is contained in:
Trisha Anand 2019-09-25 17:06:28 +00:00
commit e501de6498
7 changed files with 14 additions and 11 deletions

View File

@ -116,7 +116,7 @@ public class ClientUserRepository implements ServerOAuth2AuthorizedClientReposit
newUser.setIsEnabled(true);
return userService.findByEmail(user.getEmail())
.switchIfEmpty(userService.save(newUser)); //In case the user doesnt exist, save the user.
.switchIfEmpty(userService.create(newUser)); //In case the user doesnt exist, create and save the user.
}
@Override

View File

@ -127,7 +127,7 @@ public abstract class BaseService<R extends BaseRepository, T extends BaseDomain
analyticsProperties.put("id", ((BaseDomain) savedObject).getId());
analyticsProperties.put("organizationId", user.getOrganizationId());
analytics.enqueue(
TrackMessage.builder("MONGO_DB_CREATE_" + savedObject.getClass())
TrackMessage.builder("MONGO_DB_CREATE_" + savedObject.getClass().getSimpleName().toUpperCase())
.userId(user.getId())
.properties(analyticsProperties)
);

View File

@ -9,6 +9,4 @@ public interface UserService extends CrudService<User, String> {
Mono<User> findByEmail(String email);
Mono<User> save(User newUser);
}

View File

@ -56,7 +56,7 @@ public class UserServiceImpl extends BaseService<UserRepository, User, String> i
}
@Override
public Mono<User> save(User user) {
public Mono<User> create(User user) {
Mono<User> savedUserMono = repository.save(user);
return savedUserMono

View File

@ -16,4 +16,9 @@ jdbc.postgres.password=root
spring.security.oauth2.client.registration.google.client-id=869021686091-9b84bbf7ea683t1aaefqnmefcnmk6fq6.apps.googleusercontent.com
spring.security.oauth2.client.registration.google.client-secret=9dvITt4OayEY1HfeY8bHX74p
# Accounts from specific domains are allowed to login
oauth2.allowed-domains=appsmith.com
oauth2.allowed-domains=appsmith.com
# Segment & Rollbar Properties
# These properties are intentionally set to random values so that events are not sent to either of them during local development
segment.writeKey=random-value
com.rollbar.access-token=random-value
com.rollbar.environment=development

View File

@ -14,4 +14,8 @@ jdbc.postgres.password=09275163cd7e737baf4c210b5e8db8ed88ddb7a0ee9acc82416fd7534
spring.security.oauth2.client.registration.google.client-id=869021686091-9b84bbf7ea683t1aaefqnmefcnmk6fq6.apps.googleusercontent.com
spring.security.oauth2.client.registration.google.client-secret=9dvITt4OayEY1HfeY8bHX74p
# Accounts from specific domains are allowed to login
oauth2.allowed-domains=appsmith.com
oauth2.allowed-domains=appsmith.com
# Segment & Rollbar Properties
segment.writeKey=FIRLqUgMYuTlyS6yqOE2hBGZs5umkWhr
com.rollbar.access-token=b91c4d5b9cac444088f4db9216ed6f42
com.rollbar.environment=development

View File

@ -11,7 +11,3 @@ spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
spring.jpa.show-sql=true
# Jackson Properties
spring.jackson.default-property-inclusion=non_null
# Segment Properties
segment.writeKey=FIRLqUgMYuTlyS6yqOE2hBGZs5umkWhr
com.rollbar.access-token=b91c4d5b9cac444088f4db9216ed6f42
com.rollbar.environment=development