Skip to content

Commit

Permalink
Pass country to report issue. (#1471)
Browse files Browse the repository at this point in the history
  • Loading branch information
jigar-f authored Dec 18, 2024
1 parent f7834b9 commit a8ddb59
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion issue/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func SendReport(
model string, // alphanumeric name
osVersion string,
attachments []*Attachment,
country string,
) (err error) {
return sendReport(
userConfig.GetDeviceID(),
Expand All @@ -57,6 +58,7 @@ func SendReport(
model,
osVersion,
attachments,
country,
)
}

Expand All @@ -74,14 +76,20 @@ func sendReport(
model string,
osVersion string,
attachments []*Attachment,
country string,
) error {
httpClient := &http.Client{
Transport: proxied.Fronted("issue_fronted_roundtrip"),
}
r := &Request{}

r.Type = Request_ISSUE_TYPE(issueType)
r.CountryCode = geolookup.GetCountry(5 * time.Second)
if country == "" {
r.CountryCode = geolookup.GetCountry(5 * time.Second)
} else {
// This is temp due to IOS still uses the old geolookup
r.CountryCode = country
}
r.AppVersion = appVersion
r.SubscriptionLevel = subscriptionLevel
r.Platform = common.Platform
Expand Down
1 change: 1 addition & 0 deletions issue/issue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func TestSendReport(t *testing.T) {
Data: []byte("Hello World"),
},
},
"US",
)
if err != nil {
t.Errorf("SendReport() error = %v", err)
Expand Down

0 comments on commit a8ddb59

Please sign in to comment.