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

VPN snooze mode #3184

Merged
merged 60 commits into from
Aug 12, 2024
Merged

VPN snooze mode #3184

merged 60 commits into from
Aug 12, 2024

Conversation

samsymons
Copy link
Contributor

Task/Issue URL: https://app.asana.com/0/72649045549333/1207974416599035/f
Tech Design URL:
CC:

Description:

This PR adds VPN snooze mode.

Steps to test this PR:

  1. Run the app on-device and activate the VPN
  2. Check that the "Snooze for 2 minutes" button appears, and that when you tap it the VPN enters snooze mode
  3. Check your IP via search and make sure it shows your local IP
  4. Go back to the VPN UI and end snooze mode, check your IP again and make sure it matches your connected server
  5. Now re-enable snooze and background the app
  6. Check that the Live Activity appears, and that the Wake Up button ends snooze mode
  7. Re-enable snooze one more time and background the app, then wait 2 minutes for it to end
  8. Make sure that snooze mode notifies you that it has ended, and the Live Activity enters the green UI state

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

samsymons added 30 commits June 26, 2024 13:39
* main:
  Update VPN metadata to include entitlement (#3002)
  Remove noise from wake pixel (#2986)
  Release 7.126.0-1 (#2998)
  [DuckPlayer] - 2. Overlay Views (#2989)
  update translations for autocomplete settings changes (#2995)
  Fixes goBack() behavior (#2996)
  Re-add the autocomplete settings toggle pixels (#2991)
  Update BSK with autofill 12.0.1 (#2983)
  Final batch of new autofill pixels (#2977)
  don't attach a new home screen if autoclear is in progress (#2988)
  Custom DNS for VPN (#2971)
  Duck Player settings page (#2990)
  Add feature flag for improved New Tab Page  (#2980)
* main: (24 commits)
  Add pixels to measure baseline for New Tab Page sections (#3024)
  backgrounding UI tests (#3021)
  improve bookmarks and favorites UI tests (#3019)
  [DuckPlayer] - 4. Remote Config (#3018)
  Updates BSK
  Fix issue when cancelling a download (#3030)
  Tentative fix for a crash and connectivity issues (#3027)
  autofill UI tests (#3012)
  scripts for running UI tests (#3000)
  Integrate RemoteMessaging with NewTabPage (#3017)
  Update to iOS 15 deployment target (#3001)
  Fire a pixel when removing the VPN configuration (#3014)
  Release 7.127.0-0 (#3020)
  point to BSK branch (#3016)
  [DuckPlayer] - 3. URL management & FE comms (#3007)
  Bump BSK version (#3011)
  New Tab Page layout and base elements (#3008)
  Remove Privacy Pro from device once expired account is deleted (#3009)
  Improvements to subscription settings (#2959)
  Toggle reports limiter (#3005)
  ...
# By Christopher Brind (3) and others
# Via Anh Do (1) and GitHub (1)
* main:
  Add connection tester failure pixels (#3049)
  Release 7.127.0-1 (#3051)
  fix bug not clearing ui properly on autoclear (#3050)
  widget UI tests (#3042)
  fix autofill widget failure (#3040)
  macOS BSK change: De-duplicate passwords on import (#3048)
  Privacy Dashboard refactor (#3038)
  Make Maestro tests fail on flow cancellation (#3036)
  Improve VPN logging logic (#3032)
  Subscription refactoring #5 (#3023)
  Update Sync error pixels (#3046)
  Fixes App Data Clearing State Status In Settings (#3041)
  update sync error copy (#2870)
  Fixes for Xcode 16 (BSK -> 164.3.0) (#3035)
  Update the Privacy Pro status attribute matcher (#3033)

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
# Via GitHub
* main:
  Hide all connection details when the VPN isn’t connected (#3053)

# Conflicts:
#	DuckDuckGo/NetworkProtectionStatusView.swift
#	DuckDuckGo/NetworkProtectionStatusViewModel.swift
# By Christopher Brind (9) and others
# Via Chris Brind (1) and GitHub (1)
* main: (48 commits)
  Reduce VPN manager instances (#3097)
  Update BSK for Mac RMF changes (#3107)
  [DuckPlayer] 7- Open Settings (#3110)
  [DuckPlayer] 6 - Init updates and Watch on YouTube (#3066)
  New Tab Page Shortcuts section (#3104)
  Fix VPN configuration removal to stop the tunnel (#3099)
  avoid resizing webview when keyboard shows/hides (#3094)
  Add support for skipping sending usage pixels for remote messages (#3106)
  Bump submodules/privacy-reference-tests from `a242bf0` to `afb4f61` (#3096)
  Updates BSK to 171.2.3
  Remove print (#3101)
  Update Package.resolved file (#3102)
  New Tab Page favorites section (#3083)
  Properly compare actual value of the entitlement check (#3100)
  fix ui tests broken by new onboarding and use shared setup flow (#3081)
  AdHoc lane: Make proper assignment to variable (#3095)
  Expand AdHoc build workflow, add debug bookmarks screen (#3086)
  Update BSK to latest - for macOS fix to AdAttribution (#3084)
  Revert "Fix tests"
  Fix tests
  ...

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
#	DuckDuckGo/NetworkProtectionStatusViewModel.swift
# By Daniel Bernal (4) and others
# Via Chris Brind (3) and others
* main:
  [DuckPlayer] 10 . Move DuckPlayer init to TabManager (#3124)
  Fix threading issue with Mesage broker (#3132)
  [Duckplayer] - 9. Edge Cases (#3115)
  Release 7.130.0-2 (#3134)
  Internal update for: fix index out-of-bounds in startAttachingCrashLogMessages (#3123) (#3128)
  Attach params to PPro pixels (#3092)
  Don't show key icon for empty passwords (#3070)
  Release 7.129.1-0 (#3127)
  fix index out-of-bounds in startAttachingCrashLogMessages (#3123)
  Release 7.130.0-1 (#3122)
  Revert old Dax icon for old onboarding (#3085)
  Scroll to Internal User setting (#3114)
  Release 7.130.0-0 (#3118)
  Allow activating subscription for internal users via debug menu (#3117)
  Update breakage report locale to JSON format (#3112)
  [Duckplayer] 8. Age restricted videos (#3111)

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
# By Daniel Bernal (3) and others
# Via GitHub
* main:
  [DuckPlayer] 13. Add openInfo message to Overlay (#3151)
  [DuckPlayer] 12. Ensure DuckPlayer does not leak without the proper config (#3147)
  [DuckPlayer] 11. Tab views and Pixel updates (#3145)
  Remove the NETWORK_PROTECTION compilation flag (#3139)
  Add favorites empty state tooltip (#3119)
  Bump submodules/privacy-reference-tests from `a603ff9` to `afb4f61` (#3113)
  iOS 14 deprecation cleanup (#3098)
  Update Xcode version to 15.4 (#3142)
  remove pixels for keyboard toggle (#3135)
  Keep Remote Messages in database if they were shown (#3136)

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
# By Dominik Kapusta (3) and others
# Via GitHub
* main:
  Automatically add Asana task to iOS App Board (#3168)
  [DuckPlayer] 14. Potential fix to crash (#3161)
  New Tab Page Settings (#3140)
  New Tab Page Settings Storage (#3159)
  Prevent endless rekey and tunnel update cycle (#3091)
  tentatively fix content blocking UI test (#3141)
  Update Autofill UI test to reflect updated app copy (#3158)
  Duck player support on RMF (#3146)
  Release 7.131.0-0 (#3157)
  Update BSK with autofill 12.1.0 (#3155)
  Report Autofill issues via Passwords screen (#3116)
  Update GRDB to 2.4.0 (upstream 6.29.0, SQLCipher 4.6.0) (#3153)
  Update fastlane to 2.222.0 (#3154)

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
Copy link
Member

@quanganhdo quanganhdo left a comment

Choose a reason for hiding this comment

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

I managed to break the feature by repeatedly tapping on Snooze/Wake Up. The VPN then stuck in some state and can no longer be manipulated from the screen.

@samsymons
Copy link
Contributor Author

@quanganhdo Thanks, I'll take a look. This PR uses a piece of state to track when a snooze request is pending, and only resets after the snooze mode has changed, but apparently it doesn't work well enough.

@quanganhdo
Copy link
Member

The expanded live activity view doesn't seem to work properly on iOS 18.1 beta. For a split second it looks like the views are offscreen somewhere.

Live activities for other apps work fine.

trim.166039DA-16FE-4BE2-B023-30E695FD5553.MOV

# By Mariusz Śpiewak (7) and others
# Via Diego Rey Mendez (1) and GitHub (1)
* main:
  Bump BSK to 181.1.0 (sets Privacy Dashboard to 5.0.0) (#3166)
  Animate transition between New Tab Page and tab switcher (#3196)
  Fix New Tab Page UI issues on iOS 15 (#3198)
  Push domain exclusions to internal release (#3195)
  Show shortcuts for enabled features only (#3193)
  Translate strings introduced in New Tab Page improvements (#3174)
  Update release workflow to use S3 bucket name from secrets (#3120)
  Handle contingency settings state on remote config (#3190)
  Add UI for displaying Duck Player contingency message #3065 (#3181)
  Open keyboard on New Tab Page based on Settings (#3187)
  Integrated macOS VPN Domain exclusion (internal release) changes into iOS. (#3164)
  Release 7.132.0-0 (#3194)
  Increase testPixelDebouncePreventsFiringWithinInterval test timeout (#3192)
  Update toolbar items for New Tab Page (#3185)
  new pixel and parameter for monitoring clearing of data stores (#3186)
  ensure new data clearing api is being used (#3191)
  If no App Store subscriptions option are available return empty options object (#3188)
  Show Intro message for existing users on New Tab Page (#3173)
  Experiment Contextual onboarding (#3160)

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
@samsymons
Copy link
Contributor Author

@quanganhdo I've fixed the issue with toggling snooze too fast. The issue was because the VPN extension was updating the snooze timing before fully starting/stopping snooze, so the app would think that snooze had changed before it really had. I can now hammer on snooze and it works great every time, but please let me know if you're still able to reproduce the issue.

Widgets/VPNWidget.swift Outdated Show resolved Hide resolved
Widgets/VPNWidget.swift Outdated Show resolved Hide resolved
@samsymons samsymons requested a review from quanganhdo August 9, 2024 02:11
# By Sam Symons (3) and others
# Via Chris Brind (2) and others
* main:
  DuckPlayer contingency messages pixels (#3220)
  New autofill onboarding for existing DDG users (#3170)
  Add translations for DuckPlayer contingency messge (#3215)
  Fix PrivacyProDataReporter crash due to premature secure vault use (#3217)
  Bump rexml from 3.2.9 to 3.3.3 (#3175)
  Bump submodules/privacy-reference-tests from `a603ff9` to `afb4f61` (#3165)
  [DuckPlayer] 16. Localization Updates (#3200)
  Release 7.132.0-3 (#3213)
  cherry pick temporary fix for https://app.asana.com/0/414235014887631/1207990702991361/f
  fix content inset when keyboard is visible (#3207)
  Ship review feedback for contingency message (#3209)
  Release 7.132.0-2 (#3211)
  Restore attribution flag (#3197)
  Restore attribution flag (#3197)
  Release 7.132.0-1 (#3208)
  Break DuckPlayer ref cycle (#3206)
  Show improved Dax onboarding on New Tab Page (#3203)

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
samsymons added a commit to duckduckgo/BrowserServicesKit that referenced this pull request Aug 12, 2024
Required:

Task/Issue URL: https://app.asana.com/0/72649045549333/1207974416599035/f
iOS PR: duckduckgo/iOS#3184
macOS PR: duckduckgo/macos-browser#3085
What kind of version bump will this require?: Major

Description:

This PR adds VPN snooze mode support.
@samsymons samsymons merged commit 73162b4 into main Aug 12, 2024
12 of 13 checks passed
@samsymons samsymons deleted the sam/vpn-snooze-initial-support branch August 12, 2024 04:42
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