Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix #3598: Initialize DB after store existence check for passcode res…
Browse files Browse the repository at this point in the history
…et (#3619)
  • Loading branch information
kylehickinson authored May 5, 2021
1 parent 7f6718b commit 470361d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Client/Application/Delegates/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIViewControllerRestorati

// Must happen before passcode check, otherwise may unnecessarily reset keychain
Migration.moveDatabaseToApplicationDirectory()
// We have to wait until pre1.12 migration is done until we proceed with database
// initialization. This is because Database container may change. See bugs #3416, #3377.
DataController.shared.initialize()

// Passcode checking, must happen on immediate launch
if !DataController.shared.storeExists() {
Expand All @@ -85,6 +82,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIViewControllerRestorati
KeychainWrapper.sharedAppContainerKeychain.setAuthenticationInfo(nil)
}

// We have to wait until pre1.12 migration is done until we proceed with database
// initialization. This is because Database container may change. See bugs #3416, #3377.
DataController.shared.initialize()

return startApplication(application, withLaunchOptions: launchOptions)
}

Expand Down

0 comments on commit 470361d

Please sign in to comment.