summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBug Magnet <marco.nikic@mullvad.net>2024-10-18 11:53:36 +0200
committerBug Magnet <marco.nikic@mullvad.net>2024-10-18 11:53:36 +0200
commit620a6cf767ff39b7afecbf2c607bbbdba840b6ac (patch)
tree046175be7794f16169e69427956bf18608454a99
parent5d881c8bda31a2b267fa3d871b1498b6f04aef8e (diff)
parent47616814703f1329629dc106315d4293b1ad42ec (diff)
downloadmullvadvpn-620a6cf767ff39b7afecbf2c607bbbdba840b6ac.tar.xz
mullvadvpn-620a6cf767ff39b7afecbf2c607bbbdba840b6ac.zip
Merge branch 'fix-app-going-into-blocked-state-on-first-time-installs-ios-886'
-rw-r--r--ios/CHANGELOG.md3
-rw-r--r--ios/MullvadVPN/AppDelegate.swift11
2 files changed, 12 insertions, 2 deletions
diff --git a/ios/CHANGELOG.md b/ios/CHANGELOG.md
index 68b62affef..aee8e0a84f 100644
--- a/ios/CHANGELOG.md
+++ b/ios/CHANGELOG.md
@@ -26,6 +26,9 @@ Line wrap the file at 100 chars. Th
- Replace the draft key encapsulation mechanism Kyber (round 3) with the standardized
ML-KEM (FIPS 203) dito in the handshake for Quantum-resistant tunnels.
+### Fixed
+- Fix app going into blocked state on first-time installs.
+
## [2024.8 - 2024-10-14]
### Added
- Add a new access method that uses the encrypted DNS proxy to reach our API.
diff --git a/ios/MullvadVPN/AppDelegate.swift b/ios/MullvadVPN/AppDelegate.swift
index 5010f71ebd..6314dc62ac 100644
--- a/ios/MullvadVPN/AppDelegate.swift
+++ b/ios/MullvadVPN/AppDelegate.swift
@@ -519,7 +519,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
}
}
- /// Returns an operation that acts on two conditions:
+ /// Returns an operation that acts on the following conditions:
+ /// 1. If the app has never been launched, preload with default settings.
+ /// - or -
/// 1. Has the app been launched at least once after install? (`FirstTimeLaunch.hasFinished`)
/// 2. Has the app - at some point in time - been updated from a version compatible with wiping settings?
/// (`SettingsManager.getShouldWipeSettings()`)
@@ -527,7 +529,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
/// compatible, thus triggering a settings wipe.
private func getWipeSettingsOperation() -> AsyncBlockOperation {
AsyncBlockOperation {
- if !FirstTimeLaunch.hasFinished, SettingsManager.getShouldWipeSettings() {
+ let appHasNeverBeenLaunched = !FirstTimeLaunch.hasFinished && !SettingsManager.getShouldWipeSettings()
+ let appWasLaunchedAfterReinstall = !FirstTimeLaunch.hasFinished && SettingsManager.getShouldWipeSettings()
+
+ if appHasNeverBeenLaunched {
+ try? SettingsManager.writeSettings(LatestTunnelSettings())
+ } else if appWasLaunchedAfterReinstall {
if let deviceState = try? SettingsManager.readDeviceState(),
let accountData = deviceState.accountData,
let deviceData = deviceState.deviceData {