Skip to content

Commit a8ddb59

Browse files
authored
Pass country to report issue. (#1471)
1 parent f7834b9 commit a8ddb59

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

issue/issue.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ func SendReport(
4242
model string, // alphanumeric name
4343
osVersion string,
4444
attachments []*Attachment,
45+
country string,
4546
) (err error) {
4647
return sendReport(
4748
userConfig.GetDeviceID(),
@@ -57,6 +58,7 @@ func SendReport(
5758
model,
5859
osVersion,
5960
attachments,
61+
country,
6062
)
6163
}
6264

@@ -74,14 +76,20 @@ func sendReport(
7476
model string,
7577
osVersion string,
7678
attachments []*Attachment,
79+
country string,
7780
) error {
7881
httpClient := &http.Client{
7982
Transport: proxied.Fronted("issue_fronted_roundtrip"),
8083
}
8184
r := &Request{}
8285

8386
r.Type = Request_ISSUE_TYPE(issueType)
84-
r.CountryCode = geolookup.GetCountry(5 * time.Second)
87+
if country == "" {
88+
r.CountryCode = geolookup.GetCountry(5 * time.Second)
89+
} else {
90+
// This is temp due to IOS still uses the old geolookup
91+
r.CountryCode = country
92+
}
8593
r.AppVersion = appVersion
8694
r.SubscriptionLevel = subscriptionLevel
8795
r.Platform = common.Platform

issue/issue_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ func TestSendReport(t *testing.T) {
7272
Data: []byte("Hello World"),
7373
},
7474
},
75+
"US",
7576
)
7677
if err != nil {
7778
t.Errorf("SendReport() error = %v", err)

0 commit comments

Comments
 (0)