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

Fixes startup options reset #1581

Merged
merged 8 commits into from
Sep 12, 2023
Merged

Conversation

diegoreymendez
Copy link
Contributor

@diegoreymendez diegoreymendez commented Sep 3, 2023

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

BSK PR: duckduckgo/BrowserServicesKit#489
iOS PR: duckduckgo/iOS#2003

Description

Fixes startup options reset, and improves the options loading logic so we can easily unit test it.

Testing

Test the connection tester

  1. Run the app
  2. Try disabling the connection using the script below and sudo pfctl -ef ~/Desktop/ruleset.txt

ruleset.txt

  1. Ensure the tester properly flags the connection as being broken.

Test the connection

  1. Run the app
  2. Connect NetP and make sure the connection works fine.
  3. Disconnect
  4. Delete all auth tokens.
  5. Enable NetP again and make sure the connection works fine.

Internal references:

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

@@ -30,7 +30,7 @@ final class NetworkProtectionOnboardingMenu: NSMenu {
import NetworkProtection
import NetworkProtectionUI

/// Implements the logic for Network Protection's simulate failures menu.
/// Implements the logic for Network Protection's onboarding menu.
Copy link
Contributor Author

@diegoreymendez diegoreymendez Sep 3, 2023

Choose a reason for hiding this comment

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

Just an unrelated documentation error.

@@ -318,7 +318,7 @@ final class NetworkProtectionTunnelController: NetworkProtection.TunnelControlle

if Self.simulationOptions.isEnabled(.tunnelFailure) {
Self.simulationOptions.setEnabled(false, option: .tunnelFailure)
options[NetworkProtectionOptionKey.tunnelFailureSimulation] = NetworkProtectionOptionValue.true
options[NetworkProtectionOptionKey.tunnelFailureSimulation] = NSNumber(value: 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.

Just standardizing since we get other bools as numbers.

@diegoreymendez diegoreymendez marked this pull request as ready for review September 11, 2023 14:38
diegoreymendez added a commit to duckduckgo/BrowserServicesKit that referenced this pull request Sep 12, 2023
Task/Issue URL: https://app.asana.com/0/0/1205466155643247/f
iOS PR: duckduckgo/iOS#2003
macOS PR: duckduckgo/macos-browser#1581
What kind of version bump will this require?: Patch

## Description

Fixes tunnel startup options handling, and improves the options loading mechanism to make it unit testable.

---

* Fixes startup options reset

* Makes a correction to my previous commits

* WIP

* WIP

* Adds unit tests for StartupOptions

* Fixes some swiftlint warnings and improves the code
@diegoreymendez diegoreymendez merged commit b835c0a into develop Sep 12, 2023
@diegoreymendez diegoreymendez deleted the diego/fix-startup-options-reset branch September 12, 2023 17:11
diegoreymendez added a commit to duckduckgo/iOS that referenced this pull request Sep 12, 2023
Network Protection: Connection Tester

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

BSK PR: duckduckgo/BrowserServicesKit#489
macOS PR: duckduckgo/macos-browser#1581

## Description

Fixes startup options reset, and improves the options loading logic so we can easily unit test it.
samsymons added a commit that referenced this pull request Sep 17, 2023
# By Alexey Martemyanov (8) and others
# Via GitHub
* develop:
  Clean up login titles at insert and update + migration (#1605)
  Changes for DBP internal release (#1621)
  Fix NetP builds in the DBP target (#1627)
  Put Sparkle behind a new SPARKLE flag (#1616)
  prevent WKFullScreenWindowController crashing after `close` call (#1618)
  Use Development environment for Sync by default in Debug builds (#1625)
  disable flaky testWhenAutoconsentDisabled_promptIsDisplayed (#1619)
  Prevent crash on database init failure (#1617)
  Address bar refactoring (#1610)
  Switch Sync environment to production (#1622)
  Fixes startup options reset (#1581)
  perform Email Keychain migration only once (#1600)
  Fix NetP embedding in DBP builds (#1614)
  Bump version to 1.56.0 (58)
  Update embedded files
  fix Package.resolved
  New deployment target set to 11.4 (#1592)

# Conflicts:
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
#	DuckDuckGo/Main/Main.swift
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