Skip to content

The open alternative to Salesforce, designed for AI.

Fix bugs and telemetry (#5832)

Félix Malfaita0d9fdb3de82
diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.ts
index c787c902c31..6cfa03c060f 100644
--- a/packages/twenty-front/src/generated-metadata/graphql.ts
+++ b/packages/twenty-front/src/generated-metadata/graphql.ts
@@ -914,7 +914,6 @@ export type Support = {
export type Telemetry = {
__typename?: 'Telemetry';
- anonymizationEnabled: Scalars['Boolean']['output'];
enabled: Scalars['Boolean']['output'];
};
diff --git a/packages/twenty-front/src/generated/graphql.tsx b/packages/twenty-front/src/generated/graphql.tsx
index 0341b514608..6cfd97314bd 100644
--- a/packages/twenty-front/src/generated/graphql.tsx
+++ b/packages/twenty-front/src/generated/graphql.tsx
@@ -669,7 +669,6 @@ export type Support = {
export type Telemetry = {
__typename?: 'Telemetry';
- anonymizationEnabled: Scalars['Boolean'];
enabled: Scalars['Boolean'];
};
@@ -1220,7 +1219,7 @@ export type UpdateBillingSubscriptionMutation = { __typename?: 'Mutation', updat
export type GetClientConfigQueryVariables = Exact<{ [key: string]: never; }>;
-export type GetClientConfigQuery = { __typename?: 'Query', clientConfig: { __typename?: 'ClientConfig', signInPrefilled: boolean, signUpDisabled: boolean, debugMode: boolean, chromeExtensionId?: string | null, authProviders: { __typename?: 'AuthProviders', google: boolean, password: boolean, microsoft: boolean }, billing: { __typename?: 'Billing', isBillingEnabled: boolean, billingUrl?: string | null, billingFreeTrialDurationInDays?: number | null }, telemetry: { __typename?: 'Telemetry', enabled: boolean, anonymizationEnabled: boolean }, support: { __typename?: 'Support', supportDriver: string, supportFrontChatId?: string | null }, sentry: { __typename?: 'Sentry', dsn?: string | null, environment?: string | null, release?: string | null }, captcha: { __typename?: 'Captcha', provider?: CaptchaDriverType | null, siteKey?: string | null } } };
+export type GetClientConfigQuery = { __typename?: 'Query', clientConfig: { __typename?: 'ClientConfig', signInPrefilled: boolean, signUpDisabled: boolean, debugMode: boolean, chromeExtensionId?: string | null, authProviders: { __typename?: 'AuthProviders', google: boolean, password: boolean, microsoft: boolean }, billing: { __typename?: 'Billing', isBillingEnabled: boolean, billingUrl?: string | null, billingFreeTrialDurationInDays?: number | null }, telemetry: { __typename?: 'Telemetry', enabled: boolean }, support: { __typename?: 'Support', supportDriver: string, supportFrontChatId?: string | null }, sentry: { __typename?: 'Sentry', dsn?: string | null, environment?: string | null, release?: string | null }, captcha: { __typename?: 'Captcha', provider?: CaptchaDriverType | null, siteKey?: string | null } } };
export type SkipSyncEmailOnboardingStepMutationVariables = Exact<{ [key: string]: never; }>;
@@ -2341,7 +2340,6 @@ export const GetClientConfigDocument = gql`
debugMode
telemetry {
enabled
- anonymizationEnabled
}
support {
supportDriver
diff --git a/packages/twenty-front/src/modules/auth/hooks/__test__/useAuth.test.tsx b/packages/twenty-front/src/modules/auth/hooks/__test__/useAuth.test.tsx
index 333f97ed250..ac52204f4cc 100644
--- a/packages/twenty-front/src/modules/auth/hooks/__test__/useAuth.test.tsx
+++ b/packages/twenty-front/src/modules/auth/hooks/__test__/useAuth.test.tsx
@@ -128,7 +128,6 @@ describe('useAuth', () => {
});
expect(state.telemetry).toEqual({
enabled: true,
- anonymizationEnabled: true,
});
expect(state.isDebugMode).toBe(false);
});
diff --git a/packages/twenty-front/src/modules/client-config/graphql/queries/getClientConfig.ts b/packages/twenty-front/src/modules/client-config/graphql/queries/getClientConfig.ts
index 528e68f3805..6b98067167c 100644
--- a/packages/twenty-front/src/modules/client-config/graphql/queries/getClientConfig.ts
+++ b/packages/twenty-front/src/modules/client-config/graphql/queries/getClientConfig.ts
@@ -18,7 +18,6 @@ export const GET_CLIENT_CONFIG = gql`
debugMode
telemetry {
enabled
- anonymizationEnabled
}
support {
supportDriver
diff --git a/packages/twenty-front/src/modules/client-config/states/telemetryState.ts b/packages/twenty-front/src/modules/client-config/states/telemetryState.ts
index 927cab28b43..f074ad218d5 100644
--- a/packages/twenty-front/src/modules/client-config/states/telemetryState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/telemetryState.ts
@@ -4,5 +4,5 @@ import { Telemetry } from '~/generated/graphql';
export const telemetryState = createState<Telemetry>({
key: 'telemetryState',
- defaultValue: { enabled: true, anonymizationEnabled: true },
+ defaultValue: { enabled: true },
});
diff --git a/packages/twenty-front/src/modules/object-record/record-show/record-detail-section/components/RecordDetailRelationRecordsListItem.tsx b/packages/twenty-front/src/modules/object-record/record-show/record-detail-section/components/RecordDetailRelationRecordsListItem.tsx
index faea1d17422..8e35a01b0c6 100644
--- a/packages/twenty-front/src/modules/object-record/record-show/record-detail-section/components/RecordDetailRelationRecordsListItem.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-show/record-detail-section/components/RecordDetailRelationRecordsListItem.tsx
@@ -126,7 +126,7 @@ export const RecordDetailRelationRecordsListItem = ({
)
.sort();
- const dropdownScopeId = `record-field-card-menu-${relationRecord.id}`;
+ const dropdownScopeId = `record-field-card-menu-${relationFieldMetadataId}-${relationRecord.id}`;
const { closeDropdown, isDropdownOpen } = useDropdown(dropdownScopeId);
diff --git a/packages/twenty-front/src/modules/ui/field/input/components/TextAreaInput.tsx b/packages/twenty-front/src/modules/ui/field/input/components/TextAreaInput.tsx
index 44379c3e2fc..d14efa233d5 100644
--- a/packages/twenty-front/src/modules/ui/field/input/components/TextAreaInput.tsx
+++ b/packages/twenty-front/src/modules/ui/field/input/components/TextAreaInput.tsx
@@ -39,6 +39,7 @@ const StyledTextAreaContainer = styled.div`
width: 100%;
padding: ${({ theme }) => theme.spacing(2)} ${({ theme }) => theme.spacing(1)};
border-radius: ${({ theme }) => theme.border.radius.sm};
+ background: ${({ theme }) => theme.background.primary};
`;
const StyledLightIconButtonContainer = styled.div`
diff --git a/packages/twenty-front/src/testing/mock-data/config.ts b/packages/twenty-front/src/testing/mock-data/config.ts
index 70283346dab..b3eb74af804 100644
--- a/packages/twenty-front/src/testing/mock-data/config.ts
+++ b/packages/twenty-front/src/testing/mock-data/config.ts
@@ -14,7 +14,6 @@ export const mockedClientConfig: ClientConfig = {
},
telemetry: {
enabled: false,
- anonymizationEnabled: true,
__typename: 'Telemetry',
},
support: {
diff --git a/packages/twenty-server/src/engine/core-modules/analytics/analytics.service.ts b/packages/twenty-server/src/engine/core-modules/analytics/analytics.service.ts
index 07c0ed97b71..fd685851c58 100644
--- a/packages/twenty-server/src/engine/core-modules/analytics/analytics.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/analytics/analytics.service.ts
@@ -1,7 +1,6 @@
import { Injectable, Logger } from '@nestjs/common';
import { HttpService } from '@nestjs/axios';
-import { anonymize } from 'src/utils/anonymize';
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
type CreateEventInput = {
@@ -30,19 +29,12 @@ export class AnalyticsService {
return { success: true };
}
- const anonymizationEnabled = this.environmentService.get(
- 'TELEMETRY_ANONYMIZATION_ENABLED',
- );
-
const data = {
type: createEventInput.type,
data: {
hostname: hostName,
- userUUID: anonymizationEnabled && userId ? anonymize(userId) : userId,
- workspaceUUID:
- anonymizationEnabled && workspaceId
- ? anonymize(workspaceId)
- : workspaceId,
+ userUUID: userId,
+ workspaceUUID: workspaceId,
workspaceDisplayName: workspaceDisplayName,
workspaceDomainName: workspaceDomainName,
...createEventInput.data,
diff --git a/packages/twenty-server/src/engine/core-modules/client-config/client-config.entity.ts b/packages/twenty-server/src/engine/core-modules/client-config/client-config.entity.ts
index b895f4277ba..8252db6ba1a 100644
--- a/packages/twenty-server/src/engine/core-modules/client-config/client-config.entity.ts
+++ b/packages/twenty-server/src/engine/core-modules/client-config/client-config.entity.ts
@@ -21,9 +21,6 @@ class AuthProviders {
class Telemetry {
@Field(() => Boolean)
enabled: boolean;
-
- @Field(() => Boolean)
- anonymizationEnabled: boolean;
}
@ObjectType()
diff --git a/packages/twenty-server/src/engine/core-modules/client-config/client-config.resolver.ts b/packages/twenty-server/src/engine/core-modules/client-config/client-config.resolver.ts
index 5d55f4e1779..4ce91428ca7 100644
--- a/packages/twenty-server/src/engine/core-modules/client-config/client-config.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/client-config/client-config.resolver.ts
@@ -19,9 +19,6 @@ export class ClientConfigResolver {
},
telemetry: {
enabled: this.environmentService.get('TELEMETRY_ENABLED'),
- anonymizationEnabled: this.environmentService.get(
- 'TELEMETRY_ANONYMIZATION_ENABLED',
- ),
},
billing: {
isBillingEnabled: this.environmentService.get('IS_BILLING_ENABLED'),
diff --git a/packages/twenty-server/src/engine/integrations/environment/environment-variables.ts b/packages/twenty-server/src/engine/integrations/environment/environment-variables.ts
index 670440d3c2a..f1685bab42c 100644
--- a/packages/twenty-server/src/engine/integrations/environment/environment-variables.ts
+++ b/packages/twenty-server/src/engine/integrations/environment/environment-variables.ts
@@ -86,11 +86,6 @@ export class EnvironmentVariables {
@IsBoolean()
TELEMETRY_ENABLED = true;
- @CastToBoolean()
- @IsOptional()
- @IsBoolean()
- TELEMETRY_ANONYMIZATION_ENABLED = true;
-
@CastToPositiveNumber()
@IsNumber()
@IsOptional()