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

macOS VPN: Add pixels to track VPN start and stop attempts through IPC #2622

Merged
merged 11 commits into from
Apr 18, 2024

Conversation

diegoreymendez
Copy link
Contributor

@diegoreymendez diegoreymendez commented Apr 15, 2024

Task/Issue URL: https://app.asana.com/0/1199230911884351/1207077286880106/f

Description

In macOS we don't have visibility on how often and how IPC start and stop attempts are failing for our tunnel.

This PR adds pixels to track those attempts.

Testing

  1. Validate the code and the unit tests.
  2. If you want to test manually, just open Console.app, and filter by "👾" to see the new pixels.

Internal references:

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

@diegoreymendez diegoreymendez marked this pull request as ready for review April 15, 2024 10:45
Comment on lines 47 to 79
private func enableLoginItems() async throws -> Bool {
guard try await featureVisibility.canStartVPN() else {
// We shouldn't enable the menu app is the VPN feature is disabled.
return false
}

try loginItemsManager.throwingEnableLoginItems(LoginItemsManager.networkProtectionLoginItems, log: .networkProtection)
return true
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The diff looks a bit awful... the only change here is we're no longer ignoring errors when enabling login items.

Copy link
Collaborator

@graeme graeme left a comment

Choose a reason for hiding this comment

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

One small comment but non-blocking.

Copy link
Contributor

github-actions bot commented Apr 18, 2024

Warnings
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS against 5ab50fe

@diegoreymendez
Copy link
Contributor Author

For transparency I'm adding a note of some changes I made after the review. Normally I'd ask for another review but most of the changes I'm doing here are after extensive testing of my own, and after adding more automated tests to cover additional cases.

Summary of changes:

  • Improved IPC error handling as we weren't getting IPC failures when the login item was not running.
  • Improved IPC success completion, so that we'll now properly wait for the IPC request to be fully processed.
  • Addressed PR feedback.
  • Added tests to simulate IPC failures and see the right pixels are fired.

@diegoreymendez diegoreymendez force-pushed the diego/add-ipc-attempt-pixels branch from e562375 to 07d4ef1 Compare April 18, 2024 08:53
@diegoreymendez diegoreymendez changed the base branch from main to release/1.84.0 April 18, 2024 08:53
@diegoreymendez diegoreymendez changed the base branch from release/1.84.0 to main April 18, 2024 08:54
@diegoreymendez diegoreymendez force-pushed the diego/add-ipc-attempt-pixels branch from 07d4ef1 to f37cc5f Compare April 18, 2024 08:56
@diegoreymendez diegoreymendez force-pushed the diego/add-ipc-attempt-pixels branch from f7db4c9 to efb8598 Compare April 18, 2024 09:06
@diegoreymendez diegoreymendez changed the base branch from main to release/1.84.0 April 18, 2024 09:06
@diegoreymendez
Copy link
Contributor Author

Also rebased to 1.84.0 since I want info from these pixels sooner rather than later.

@diegoreymendez diegoreymendez merged commit b06570a into release/1.84.0 Apr 18, 2024
17 checks passed
@diegoreymendez diegoreymendez deleted the diego/add-ipc-attempt-pixels branch April 18, 2024 09:15
jotaemepereira pushed a commit that referenced this pull request Apr 19, 2024
#2622)

Task/Issue URL:
https://app.asana.com/0/1199230911884351/1207077286880106/f

## Description

In macOS we don't have visibility on how often and how IPC start and
stop attempts are failing for our tunnel.

This PR adds pixels to track those attempts.
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