From ce1b7979ce4b36c3f35ce96b8d9ced8b1f4b5600 Mon Sep 17 00:00:00 2001 From: Kathy Luo Date: Fri, 6 Oct 2023 13:49:10 +0200 Subject: [PATCH] chore: add OS version to support requests --- __mocks__/react-native-device-info.ts | 1 + src/account/SupportContact.test.tsx | 3 ++- src/account/SupportContact.tsx | 1 + src/account/zendesk.ts | 5 +++++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/__mocks__/react-native-device-info.ts b/__mocks__/react-native-device-info.ts index 19cfdb7d910..e7221a2b7dd 100644 --- a/__mocks__/react-native-device-info.ts +++ b/__mocks__/react-native-device-info.ts @@ -3,6 +3,7 @@ import mockRNDeviceInfo from 'react-native-device-info/jest/react-native-device- mockRNDeviceInfo.getBundleId.mockImplementation(() => 'org.celo.mobile.debug') mockRNDeviceInfo.getVersion.mockImplementation(() => '0.0.1') mockRNDeviceInfo.getBuildNumber.mockImplementation(() => '1') +mockRNDeviceInfo.getSystemVersion.mockImplementation(() => '7.1') mockRNDeviceInfo.getUniqueId.mockImplementation(() => Promise.resolve('abc-def-123')) mockRNDeviceInfo.getUniqueIdSync.mockImplementation(() => 'abc-def-123') mockRNDeviceInfo.getDeviceId.mockImplementation(() => 'someDeviceId') diff --git a/src/account/SupportContact.test.tsx b/src/account/SupportContact.test.tsx index 02ce763659b..1c0b80658db 100644 --- a/src/account/SupportContact.test.tsx +++ b/src/account/SupportContact.test.tsx @@ -80,7 +80,7 @@ describe('Contact', () => { expect(Mailer.mail).toBeCalledWith( expect.objectContaining({ isHTML: true, - body: 'Test Message

{"version":"0.0.1","buildNumber":"1","apiLevel":-1,"os":"android","country":"US","region":null,"deviceId":"someDeviceId","deviceBrand":"someBrand","deviceModel":"someModel","address":"0x0000000000000000000000000000000000007e57","sessionId":"","numberVerifiedCentralized":false,"hooksPreviewEnabled":false,"network":"alfajores"}

Support logs are attached...', + body: 'Test Message

{"version":"0.0.1","systemVersion":"7.1","buildNumber":"1","apiLevel":-1,"os":"android","country":"US","region":null,"deviceId":"someDeviceId","deviceBrand":"someBrand","deviceModel":"someModel","address":"0x0000000000000000000000000000000000007e57","sessionId":"","numberVerifiedCentralized":false,"hooksPreviewEnabled":false,"network":"alfajores"}

Support logs are attached...', recipients: [CELO_SUPPORT_EMAIL_ADDRESS], subject: i18n.t('supportEmailSubject', { appName: APP_NAME, user: '+1415555XXXX' }), attachments: logAttachments, @@ -139,6 +139,7 @@ describe('Contact', () => { os: 'android', region: null, sessionId: '', + systemVersion: '7.1', version: '0.0.1', }, logFiles: logAttachments, diff --git a/src/account/SupportContact.tsx b/src/account/SupportContact.tsx index 83718cdbda1..b9788e667ca 100644 --- a/src/account/SupportContact.tsx +++ b/src/account/SupportContact.tsx @@ -91,6 +91,7 @@ function SupportContact({ route }: Props) { setInProgress(true) const deviceInfo = { version: DeviceInfo.getVersion(), + systemVersion: DeviceInfo.getSystemVersion(), buildNumber: DeviceInfo.getBuildNumber(), apiLevel: DeviceInfo.getApiLevelSync(), os: Platform.OS, diff --git a/src/account/zendesk.ts b/src/account/zendesk.ts index cf2a961e608..47fcb004581 100644 --- a/src/account/zendesk.ts +++ b/src/account/zendesk.ts @@ -6,6 +6,7 @@ const ZENDESK_PROJECT_NAME = 'valoraapp' export interface DeviceInfo { version: string + systemVersion: string buildNumber: string apiLevel: number os: 'ios' | 'android' | 'windows' | 'macos' | 'web' @@ -80,6 +81,10 @@ export function _generateCustomFields(deviceInfo: DeviceInfo) { id: 5381862498317, value: deviceInfo.apiLevel.toString(), }, + { + id: 20129806706445, + value: deviceInfo.systemVersion, + }, { id: 15494972694029, value: deviceInfo.version,