Skip to content

Commit

Permalink
chore: add OS version to support requests
Browse files Browse the repository at this point in the history
  • Loading branch information
kathaypacific committed Oct 6, 2023
1 parent 119ab9a commit ce1b797
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions __mocks__/react-native-device-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
3 changes: 2 additions & 1 deletion src/account/SupportContact.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe('Contact', () => {
expect(Mailer.mail).toBeCalledWith(
expect.objectContaining({
isHTML: true,
body: 'Test Message<br/><br/><b>{"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"}</b><br/><br/><b>Support logs are attached...</b>',
body: 'Test Message<br/><br/><b>{"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"}</b><br/><br/><b>Support logs are attached...</b>',
recipients: [CELO_SUPPORT_EMAIL_ADDRESS],
subject: i18n.t('supportEmailSubject', { appName: APP_NAME, user: '+1415555XXXX' }),
attachments: logAttachments,
Expand Down Expand Up @@ -139,6 +139,7 @@ describe('Contact', () => {
os: 'android',
region: null,
sessionId: '',
systemVersion: '7.1',
version: '0.0.1',
},
logFiles: logAttachments,
Expand Down
1 change: 1 addition & 0 deletions src/account/SupportContact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions src/account/zendesk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ce1b797

Please sign in to comment.