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

NetP - Create observers to extract from StatusReporter #445

Conversation

graeme
Copy link
Contributor

@graeme graeme commented Aug 4, 2023

Please review the release process for BrowserServicesKit here.

Required:

Task/Issue URL: https://app.asana.com/0/0/1205210093476964/f
iOS PR: duckduckgo/iOS#1894
macOS PR: duckduckgo/macos-browser#1436
What kind of version bump will this require?: Minor

Optional:

Tech Design URL:
CC:

Description:

For Update Status View to match designs, I planned to rely on the shared Connection*Observer types to receive events from the PacketTunnnelProvider and other NetP types. However, on doing this, I noticed that we’re exposing the Subject type in order to synchronously access the most recent state.

Exposing these types as it means these events can be sent from anywhere and not just the source of the events. Rather than letting dependency on this propagate into iOS too, I decided to do a quick refactor to clean it up.

Additionally, I’ve created the associated mock types which I will also need throughout the iOS: Network Protection MVP TestFlight build for internal testing project. I decided now was the right time to create them as these types have been altered.

This is the first of two PRs to make this happen. It creates the types which will be extracted from the NetworkProtectionStatusReporter.

Steps to test this PR:
For this PR just check everything compiles. More testing will be needed for #446

OS Testing:

  • iOS 14
  • iOS 15
  • iOS 16
  • macOS 10.15
  • macOS 11
  • macOS 12

Internal references:

Software Engineering Expectations
Technical Design Template

@graeme graeme changed the title Create observers to extract from StatusReporter NetP - Create observers to extract from StatusReporter Aug 4, 2023
@graeme graeme marked this pull request as ready for review August 4, 2023 17:37

/// Observes the tunnel status through Distributed Notifications.
///
public class ControllerErrorMesssageObserverThroughDistributedNotifications: ControllerErrorMesssageObserver {
Copy link
Contributor Author

@graeme graeme Aug 7, 2023

Choose a reason for hiding this comment

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

This is extracted from the NetworkProtectionStatusReporter in #446 https://github.com/duckduckgo/BrowserServicesKit/pull/446/files#r1285476923

Copy link
Contributor

@samsymons samsymons left a comment

Choose a reason for hiding this comment

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

LGTM!

* Encapsulate sending through subjects in observers

* Wrap MockNetworkProtectionStatusReporter in macOS check

* Wrap MockNetworkProtectionStatusReporter in macOS check

* Move mock token store (back?) into NetPTestutils

* Create MockTunnelController (#447)
@graeme graeme merged commit b01e001 into main Aug 9, 2023
3 checks passed
@graeme graeme deleted the graeme/create-status-observers-for-extraction-from-status-reporter branch August 9, 2023 08:00
samsymons added a commit that referenced this pull request Aug 10, 2023
* main:
  NetP - Create observers to extract from StatusReporter (#445)
samsymons added a commit that referenced this pull request Aug 11, 2023
# By Dax Mobile (1) and others
# Via GitHub
* main:
  BSK SwiftLint fixes part 1: Autofix many SwiftLint warnings (#452)
  Add support for syncing Credentials (#425)
  Update autofill to 8.1.2 (#457)
  NetP - Create observers to extract from StatusReporter (#445)

# Conflicts:
#	Sources/BrowserServicesKit/Autofill/AutofillUserScript+SecureVault.swift
#	Sources/BrowserServicesKit/SecureVault/SecureVaultManager.swift
#	Tests/BrowserServicesKitTests/SecureVault/MockAutofillDatabaseProvider.swift
#	Tests/BrowserServicesKitTests/SecureVault/VaultFactoryTests.swift
#	Tests/SecureStorageTests/TestMocks.swift
samsymons added a commit that referenced this pull request Aug 16, 2023
# By Sam Symons (3) and others
# Via GitHub
* main:
  Moved iOS Extension to BSK (#458)
  Bump Tests/BrowserServicesKitTests/Resources/privacy-reference-tests (#431)
  feat: duck player v2 (#451)
  Update NetP endpoint (#456)
  BSK SwiftLint fixes part 2: Disable some test suite warnings (#453)
  BSK SwiftLint fixes part 1: Autofix many SwiftLint warnings (#452)
  Add support for syncing Credentials (#425)
  Update autofill to 8.1.2 (#457)
  NetP - Create observers to extract from StatusReporter (#445)

# Conflicts:
#	Sources/BookmarksTestsUtils/BookmarkTree.swift
#	Sources/BrowserServicesKit/Autofill/AutofillUserScript+SecureVault.swift
#	Sources/BrowserServicesKit/SecureVault/AutofillSecureVault.swift
#	Sources/BrowserServicesKit/SecureVault/SecureVaultManager.swift
#	Sources/BrowserServicesKit/SecureVault/SecureVaultModels.swift
#	Sources/BrowserServicesKit/Suggestions/Suggestion.swift
#	Sources/SyncDataProviders/Bookmarks/BookmarksProvider.swift
#	Tests/.swiftlint.yml
#	Tests/BrowserServicesKitTests/SecureVault/MockAutofillDatabaseProvider.swift
#	Tests/BrowserServicesKitTests/SecureVault/VaultFactoryTests.swift
#	Tests/NavigationTests/ClosureNavigationResponderTests.swift
#	Tests/NavigationTests/Helpers/NavigationTestHelpers.swift
#	Tests/NavigationTests/NavigationAuthChallengeTests.swift
#	Tests/SecureStorageTests/TestMocks.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