Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Diagnostics] Add backend_error_code property #4236

Merged
merged 2 commits into from
Sep 4, 2024

Conversation

tonidero
Copy link
Contributor

@tonidero tonidero commented Sep 3, 2024

Checklist

  • If applicable, unit tests
  • If applicable, create follow-up issues for purchases-android and hybrids

Motivation

Description

This adds the backend_error_code property to diagnostics http_request_performed events.

@tonidero tonidero changed the title [Diagnostics] Add backend_error_code property [Diagnostics] Add backend_error_code property Sep 3, 2024
@tonidero tonidero force-pushed the diagnostics-add-backend-error-code branch from 892222e to 4b48f46 Compare September 3, 2024 14:29
@tonidero tonidero marked this pull request as ready for review September 3, 2024 15:06
@tonidero tonidero requested a review from a team September 3, 2024 15:06
Copy link
Contributor

@jamesrb1 jamesrb1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

resultOrigin: response.origin,
verificationResult: verificationResult)
case let .failure(error):
var responseCode = -1
if case let .errorResponse(_, code, _) = error {
var backendErrorCode: Int?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like using nil to represent the absence of a value (as this new code does), but we now seem to be mixing conventions now for "empty": -1 for responseCode and nil for backendErrorCode. Not necessarily recommending a change here, but just surfacing this in case it hadn't been considered.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point... And yeah, I also prefer to send nil for these cases... I think it's something that can be changed separately to avoid changing the data we send though. Good callout!

@tonidero tonidero merged commit 597af5f into main Sep 4, 2024
5 checks passed
@tonidero tonidero deleted the diagnostics-add-backend-error-code branch September 4, 2024 07:03
vegaro pushed a commit that referenced this pull request Sep 5, 2024
**This is an automatic release.**

### Bugfixes
* [Customer Center] Build `WrongPlatformView` from JSON (#4234) via
Cesar de la Vega (@vegaro)
* Add `feedbackSurveyCompleted` event to Customer Center events (#4194)
via Cesar de la Vega (@vegaro)
### Other Changes
* [Diagnostics] Add `backend_error_code` property (#4236) via Toni Rico
(@tonidero)
* Update README.md (#3986) via Khoa (@onmyway133)
nyeu pushed a commit that referenced this pull request Oct 2, 2024
<!-- Thank you for contributing to Purchases! Before pressing the
"Create Pull Request" button, please provide the following: -->

### Checklist
- [ ] If applicable, unit tests
- [ ] If applicable, create follow-up issues for `purchases-android` and
hybrids

### Motivation
<!-- Why is this change required? What problem does it solve? -->
<!-- Please link to issues following this format: Resolves #999999 -->

### Description
This adds the `backend_error_code` property to diagnostics
`http_request_performed` events.
nyeu pushed a commit that referenced this pull request Oct 2, 2024
**This is an automatic release.**

### Bugfixes
* [Customer Center] Build `WrongPlatformView` from JSON (#4234) via
Cesar de la Vega (@vegaro)
* Add `feedbackSurveyCompleted` event to Customer Center events (#4194)
via Cesar de la Vega (@vegaro)
### Other Changes
* [Diagnostics] Add `backend_error_code` property (#4236) via Toni Rico
(@tonidero)
* Update README.md (#3986) via Khoa (@onmyway133)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants