Fix bugs and telemetry (#5832)

Bugfix 1:
<img width="491" alt="Screenshot 2024-06-12 at 07 19 42"
src="https://github.com/twentyhq/twenty/assets/6399865/e3ad2771-4edd-453d-9d85-f429177dfd15">

Bugfix 2:
<img width="259" alt="Screenshot 2024-06-12 at 07 47 02"
src="https://github.com/twentyhq/twenty/assets/6399865/2f82c90e-2180-4290-b12e-e72910fb108c">

Change 3:
I remove the "telemetry anonymization enabled" parameter as it was
misleading, we were anonymization ids but still forwarding the workspace
name which is imo more sensitive than an ID
This commit is contained in:
Félix Malfait 2024-06-12 08:11:48 +02:00 committed by GitHub
parent 7d068095cd
commit a0d9fdb3de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 6 additions and 30 deletions

View File

@ -914,7 +914,6 @@ export type Support = {
export type Telemetry = {
__typename?: 'Telemetry';
anonymizationEnabled: Scalars['Boolean']['output'];
enabled: Scalars['Boolean']['output'];
};

View File

@ -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

View File

@ -128,7 +128,6 @@ describe('useAuth', () => {
});
expect(state.telemetry).toEqual({
enabled: true,
anonymizationEnabled: true,
});
expect(state.isDebugMode).toBe(false);
});

View File

@ -18,7 +18,6 @@ export const GET_CLIENT_CONFIG = gql`
debugMode
telemetry {
enabled
anonymizationEnabled
}
support {
supportDriver

View File

@ -4,5 +4,5 @@ import { Telemetry } from '~/generated/graphql';
export const telemetryState = createState<Telemetry>({
key: 'telemetryState',
defaultValue: { enabled: true, anonymizationEnabled: true },
defaultValue: { enabled: true },
});

View File

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

View File

@ -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`

View File

@ -14,7 +14,6 @@ export const mockedClientConfig: ClientConfig = {
},
telemetry: {
enabled: false,
anonymizationEnabled: true,
__typename: 'Telemetry',
},
support: {

View File

@ -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,

View File

@ -21,9 +21,6 @@ class AuthProviders {
class Telemetry {
@Field(() => Boolean)
enabled: boolean;
@Field(() => Boolean)
anonymizationEnabled: boolean;
}
@ObjectType()

View File

@ -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'),

View File

@ -86,11 +86,6 @@ export class EnvironmentVariables {
@IsBoolean()
TELEMETRY_ENABLED = true;
@CastToBoolean()
@IsOptional()
@IsBoolean()
TELEMETRY_ANONYMIZATION_ENABLED = true;
@CastToPositiveNumber()
@IsNumber()
@IsOptional()