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

Hide all connection details when the VPN isn’t connected #3053

Merged

Conversation

samsymons
Copy link
Contributor

Task/Issue URL: https://app.asana.com/0/1199333091098016/1207750283125995/f
Tech Design URL:
CC:

Description:

This PR fixes an issue with the VPN showing connection details for the last connection, even after disconnecting.

See https://github.com/duckduckgo/BrowserServicesKit/pull/858/files for where the issue was introduced - rather than modify that code, I'm adding checks on the iOS VPN UI side to ensure we only show the status row when appropriate.

Steps to test this PR:

  1. Open the VPN UI, make sure that no connection details are showing
  2. Disconnect the VPN, make sure that IP address and throughout disappear
  3. Reconnect the VPN, make sure that connection details reappear and look accurate

Definition of Done (Internal Only):

Copy Testing:

  • Use of correct apostrophes in new copy, ie rather than '

Orientation Testing:

  • Portrait
  • Landscape

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

Comment on lines +43 to 45
if statusModel.isNetPEnabled && statusModel.shouldShowConnectionDetails && statusModel.ipAddress != nil {
connectionDetails()
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should be changed before merging, the correct fix is to make sure that shouldShowConnectionDetails is accurate. I'm opening the PR now anyway since I need these changes for another branch, but will aim to update this by EOD.

Copy link
Contributor

Choose a reason for hiding this comment

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

I posted this in MM but cross-posting here so it's easy to track the conversation. I think the GUI logic is just wrong here, and I wouldn't change BSK.

Showing or hiding UI shouldn't rely directly on notifications, but on local state. In this case it should rely on connection status. This is the way macOS does it.

We don't ever want to show details when disconnected, and we always want to show details when connected.

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.

Approved, great catch - dunno how I missed this.

Still I think the issue is really in the UI code: see my comment.

Comment on lines +43 to 45
if statusModel.isNetPEnabled && statusModel.shouldShowConnectionDetails && statusModel.ipAddress != nil {
connectionDetails()
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I posted this in MM but cross-posting here so it's easy to track the conversation. I think the GUI logic is just wrong here, and I wouldn't change BSK.

Showing or hiding UI shouldn't rely directly on notifications, but on local state. In this case it should rely on connection status. This is the way macOS does it.

We don't ever want to show details when disconnected, and we always want to show details when connected.

@diegoreymendez
Copy link
Contributor

I'm going ahead to merge so this goes out in the internal.

@diegoreymendez diegoreymendez merged commit 34f9e9a into main Jul 7, 2024
18 checks passed
@diegoreymendez diegoreymendez deleted the sam/reset-vpn-connection-details-when-disconnecting branch July 7, 2024 21:58
samsymons added a commit that referenced this pull request Jul 9, 2024
# Via GitHub
* main:
  Hide all connection details when the VPN isn’t connected (#3053)

# Conflicts:
#	DuckDuckGo/NetworkProtectionStatusView.swift
#	DuckDuckGo/NetworkProtectionStatusViewModel.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.

None yet

2 participants