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

Read underlying errors recursively #3604

Merged
merged 2 commits into from
Nov 23, 2024

Conversation

samsymons
Copy link
Contributor

Task/Issue URL: https://app.asana.com/0/414235014887631/1208811744276031/f
Tech Design URL:
CC:

Description:

This PR updates the pixel error handling to read underlying errors recursively.

Steps to test this PR:

  1. Check that the test suite changes cover everything correctly and that no pixel behavior is otherwise changing
  2. Next, we can check that this works with a pixel by adding a test call that uses many underlying errors. Add the following to the bottom of applicationDidBecomeActive:
let underlyingError4 = NSError(domain: "underlyingError4", code: 5, userInfo: [:])
let underlyingError3 = NSError(domain: "underlyingError3", code: 4, userInfo: [NSUnderlyingErrorKey: underlyingError4])
let underlyingError2 = NSError(domain: "underlyingError2", code: 3, userInfo: [NSUnderlyingErrorKey: underlyingError3])
let underlyingError1 = NSError(domain: "underlyingError1", code: 2, userInfo: [NSUnderlyingErrorKey: underlyingError2])
let error = NSError(domain: "error", code: 1, userInfo: [NSUnderlyingErrorKey: underlyingError1])

Pixel.fire(pixel: .networkProtectionRekeyFailure, error: error)

Then, run the app and filter for rekey, and check that the parameters look good.

Definition of Done (Internal Only):

Device Testing:

  • iPhone SE (1st Gen)
  • iPhone 8
  • iPhone X
  • iPhone 14 Pro
  • iPad

OS Testing:

  • iOS 15
  • iOS 16
  • iOS 17

Theme Testing:

  • Light theme
  • Dark theme

Internal references:

Software Engineering Expectations
Technical Design Template

Copy link
Contributor

@diegoreymendez diegoreymendez left a comment

Choose a reason for hiding this comment

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

This is fantastic! Thanks @samsymons

@samsymons samsymons merged commit 3f3e9aa into main Nov 23, 2024
16 checks passed
@samsymons samsymons deleted the sam/improve-underlying-error-pixel-parameters branch November 23, 2024 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants