Skip to content

Commit

Permalink
feat(identity): add client platform and verison to save contacts requ…
Browse files Browse the repository at this point in the history
…est (#4660)

### Description

This is included in all identity-service requests

### Test plan

Unit tests

### Related issues

- Fixes ACT-994

### Backwards compatibility

Yes
  • Loading branch information
satish-ravi authored Dec 19, 2023
1 parent c314b10 commit d19cf77
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/identity/contactMapping.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ describe('saveContacts', () => {
body: JSON.stringify({
phoneNumber: mockE164Number,
contacts: [mockE164NumberInvite, mockE164Number, mockE164Number2Invite],
clientPlatform: 'android',
clientVersion: '0.0.1',
}),
signal: expect.any(AbortSignal),
})
Expand Down Expand Up @@ -297,6 +299,8 @@ describe('saveContacts', () => {
body: JSON.stringify({
phoneNumber: mockE164Number,
contacts: [mockE164Number2, mockE164NumberInvite, mockE164Number, mockE164Number2Invite],
clientPlatform: 'android',
clientVersion: '0.0.1',
}),
signal: expect.any(AbortSignal),
})
Expand Down Expand Up @@ -367,6 +371,8 @@ describe('saveContacts', () => {
body: JSON.stringify({
phoneNumber: mockE164Number,
contacts: [mockE164NumberInvite, mockE164Number, mockE164Number2Invite],
clientPlatform: 'android',
clientVersion: '0.0.1',
}),
signal: expect.any(AbortSignal),
})
Expand Down
7 changes: 6 additions & 1 deletion src/identity/contactMapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,12 @@ export function* saveContacts() {
'Content-Type': 'application/json',
authorization: `Valora ${walletAddress}:${signedMessage}`,
},
body: JSON.stringify({ phoneNumber: ownPhoneNumber, contacts }),
body: JSON.stringify({
phoneNumber: ownPhoneNumber,
contacts,
clientPlatform: Platform.OS,
clientVersion: DeviceInfo.getVersion(),
}),
})

if (!response.ok) {
Expand Down

0 comments on commit d19cf77

Please sign in to comment.