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

Expand dbp error handling iteration 2: further up the stack + pixels #2484

Conversation

THISISDINOSAUR
Copy link
Contributor

@THISISDINOSAUR THISISDINOSAUR commented Mar 22, 2024

Task/Issue URL: https://app.asana.com/0/1199230911884351/1206910398550646/f
Tech Design URL:
CC:

Description:
Adds additional error handling higher up the stack, as well as firing pixels for DBP errors.
This should not be merged yet because privacy triage isn't complete

Note that this depends on iteration 1, and is set with that as the base

Steps to test this PR:
The main thing to test is error pixels are fired as expected. There are two general cases to to test:

  1. The secure vault error pixels, both from the background agent and from the main app
  2. The new "generalError" pixel (again both from the background agent and from the main app). Pay special attention to making sure it always has at least the following params: error code, error domain, and the origin function. Special care is needed here with the origin function, because if one uses pixel kit debug events it clobbers the original params

Internal references:

Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation

@@ -33,6 +33,7 @@ public extension Notification.Name {
final class DBPHomeViewController: NSViewController {
private var presentedWindowController: NSWindowController?
private let dataBrokerProtectionManager: DataBrokerProtectionManager
private let pixelHandler: EventMapping<DataBrokerProtectionPixels> = DataBrokerProtectionPixelsHandler()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I haven't quite decided if this is a crime yet. The DataBrokerProtectionManager above it does the same thing, I did consider changing that so it's injected into DataBrokerProtectionManager and also into here, but DataBrokerProtectionManager doesn't have any of its over depqeancies injected and we start to get into a broader change...

}
} catch {
os_log("DBPHomeViewController error: viewDidLoad, error: %{public}@", log: .error, error.localizedDescription)
pixelHandler.fire(.generalError(error: error, functionOccurredIn: "DBPHomeViewController.viewDidLoad"))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm still not quite sure how I feel about this generalError construction. Ultimately I don't think I'll be happy with any solution as long as we need to keep using just the one pixel for all DBP errors

@THISISDINOSAUR THISISDINOSAUR changed the base branch from main to elle/expand-dbp-error-handling March 22, 2024 18:59
Task/Issue URL:
https://app.asana.com/0/1199230911884351/1206981846336029/f
Tech Design URL:
CC:

**Description**:
We decided to merge this straight into the base branch and review
everything at once

**Steps to test this PR**:
1.

<!--
Tagging instructions
If this PR isn't ready to be merged for whatever reason it should be
marked with the `DO NOT MERGE` label (particularly if it's a draft)
If it's pending Product Review/PFR, please add the `Pending Product
Review` label.

If at any point it isn't actively being worked on/ready for
review/otherwise moving forward (besides the above PR/PFR exception)
strongly consider closing it (or not opening it in the first place). If
you decide not to close it, make sure it's labelled to make it clear the
PRs state and comment with more information.
-->

---
###### Internal references:
[Pull Request Review
Checklist](https://app.asana.com/0/1202500774821704/1203764234894239/f)
[Software Engineering
Expectations](https://app.asana.com/0/59792373528535/199064865822552)
[Technical Design
Template](https://app.asana.com/0/59792373528535/184709971311943)
[Pull Request
Documentation](https://app.asana.com/0/1202500774821704/1204012835277482/f)

---------

Co-authored-by: Dominik Kapusta <[email protected]>
Co-authored-by: Fernando Bunn <[email protected]>
Co-authored-by: Dax the Duck <[email protected]>
Co-authored-by: Dax Mobile <[email protected]>
Co-authored-by: Diego Rey Mendez <[email protected]>
Co-authored-by: Pete Smith <[email protected]>
Co-authored-by: Sabrina Tardio <[email protected]>
Co-authored-by: Anh Do <[email protected]>
Co-authored-by: Juan Manuel Pereira <[email protected]>
Co-authored-by: Christopher Brind <[email protected]>
Co-authored-by: Michal Smaga <[email protected]>
Co-authored-by: bwaresiak <[email protected]>
Co-authored-by: Mariusz Śpiewak <[email protected]>
Co-authored-by: Daniel Bernal <[email protected]>
Co-authored-by: muodov <[email protected]>
Co-authored-by: Sam Symons <[email protected]>
Co-authored-by: Alessandro Boron <[email protected]>
Co-authored-by: Federico Cappelli <[email protected]>
Co-authored-by: Tom Strba <[email protected]>
Co-authored-by: Graeme Arthur <[email protected]>
Co-authored-by: amddg44 <[email protected]>
Co-authored-by: Brad Slayter <[email protected]>
Co-authored-by: Halle <[email protected]>
Co-authored-by: Diego Rey Mendez <[email protected]>
@THISISDINOSAUR
Copy link
Contributor Author

We decided to merge this straight into the base branch and review everything at once

@THISISDINOSAUR THISISDINOSAUR merged commit 676a402 into elle/expand-dbp-error-handling Apr 2, 2024
9 of 11 checks passed
@THISISDINOSAUR THISISDINOSAUR deleted the elle/expand-dbp-error-handling-interation-2 branch April 2, 2024 14:46
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.

1 participant