chore: Integrate DB re-encryption process due to page size changes
Changes: 1. Bump status go to include DB migration 2. Integrate the new DB re-encryption signals to show the re-encryption loading screen
This commit is contained in:
parent
fe023d39da
commit
9d14fd60af
|
@ -53,6 +53,8 @@ type SignalType* {.pure.} = enum
|
||||||
WakuBackedUpKeycards = "waku.backedup.keycards"
|
WakuBackedUpKeycards = "waku.backedup.keycards"
|
||||||
WakuBackedUpWatchOnlyAccount = "waku.backedup.watch-only-account"
|
WakuBackedUpWatchOnlyAccount = "waku.backedup.watch-only-account"
|
||||||
LocalPairing = "localPairing"
|
LocalPairing = "localPairing"
|
||||||
|
DBReEncryptionStarted = "db.reEncryption.started"
|
||||||
|
DBReEncryptionFinished = "db.reEncryption.finished"
|
||||||
Unknown
|
Unknown
|
||||||
|
|
||||||
proc event*(self:SignalType):string =
|
proc event*(self:SignalType):string =
|
||||||
|
|
|
@ -172,10 +172,14 @@ proc init*(self: Controller) =
|
||||||
self.delegate.onLocalPairingStatusUpdate(self.localPairingStatus)
|
self.delegate.onLocalPairingStatusUpdate(self.localPairingStatus)
|
||||||
self.connectionIds.add(handlerId)
|
self.connectionIds.add(handlerId)
|
||||||
|
|
||||||
handlerId = self.events.onWithUUID(SIGNAL_REENCRYPTION_PROCESS_STARTED) do(e: Args):
|
handlerId = self.events.onWithUUID(SignalType.DBReEncryptionStarted.event) do(e: Args):
|
||||||
self.delegate.onReencryptionProcessStarted()
|
self.delegate.onReencryptionProcessStarted()
|
||||||
self.connectionIds.add(handlerId)
|
self.connectionIds.add(handlerId)
|
||||||
|
|
||||||
|
handlerId = self.events.onWithUUID(SignalType.DBReEncryptionFinished.event) do(e: Args):
|
||||||
|
self.delegate.onReencryptionProcessFinished()
|
||||||
|
self.connectionIds.add(handlerId)
|
||||||
|
|
||||||
handlerId = self.events.onWithUUID(SIGNAL_LOGIN_ERROR) do(e: Args):
|
handlerId = self.events.onWithUUID(SIGNAL_LOGIN_ERROR) do(e: Args):
|
||||||
let args = LoginErrorArgs(e)
|
let args = LoginErrorArgs(e)
|
||||||
self.delegate.emitAccountLoginError(args.error)
|
self.delegate.emitAccountLoginError(args.error)
|
||||||
|
|
|
@ -186,6 +186,9 @@ method onLocalPairingStatusUpdate*(self: AccessInterface, status: LocalPairingSt
|
||||||
method onReencryptionProcessStarted*(self: AccessInterface) {.base.} =
|
method onReencryptionProcessStarted*(self: AccessInterface) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
method onReencryptionProcessFinished*(self: AccessInterface) {.base.} =
|
||||||
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
# This way (using concepts) is used only for the modules managed by AppController
|
# This way (using concepts) is used only for the modules managed by AppController
|
||||||
type
|
type
|
||||||
DelegateInterface* = concept c
|
DelegateInterface* = concept c
|
||||||
|
|
|
@ -531,3 +531,6 @@ method onLocalPairingStatusUpdate*[T](self: Module[T], status: LocalPairingStatu
|
||||||
|
|
||||||
method onReencryptionProcessStarted*[T](self: Module[T]) =
|
method onReencryptionProcessStarted*[T](self: Module[T]) =
|
||||||
self.view.onReencryptionProcessStarted()
|
self.view.onReencryptionProcessStarted()
|
||||||
|
|
||||||
|
method onReencryptionProcessFinished*[T](self: Module[T]) =
|
||||||
|
self.view.onReencryptionProcessFinished()
|
||||||
|
|
|
@ -376,3 +376,6 @@ QtObject:
|
||||||
|
|
||||||
proc onReencryptionProcessStarted*(self: View) =
|
proc onReencryptionProcessStarted*(self: View) =
|
||||||
self.setAppState(AppState.AppEncryptionProcessState)
|
self.setAppState(AppState.AppEncryptionProcessState)
|
||||||
|
|
||||||
|
proc onReencryptionProcessFinished*(self: View) =
|
||||||
|
self.setAppState(AppState.AppLoadingState)
|
||||||
|
|
|
@ -37,7 +37,6 @@ let TEST_PEER_ENR = getEnv("TEST_PEER_ENR").string
|
||||||
|
|
||||||
const SIGNAL_CONVERTING_PROFILE_KEYPAIR* = "convertingProfileKeypair"
|
const SIGNAL_CONVERTING_PROFILE_KEYPAIR* = "convertingProfileKeypair"
|
||||||
const SIGNAL_DERIVED_ADDRESSES_FROM_NOT_IMPORTED_MNEMONIC_FETCHED* = "derivedAddressesFromNotImportedMnemonicFetched"
|
const SIGNAL_DERIVED_ADDRESSES_FROM_NOT_IMPORTED_MNEMONIC_FETCHED* = "derivedAddressesFromNotImportedMnemonicFetched"
|
||||||
const SIGNAL_REENCRYPTION_PROCESS_STARTED* = "reencryptionProcessStarted"
|
|
||||||
const SIGNAL_LOGIN_ERROR* = "errorWhileLogin"
|
const SIGNAL_LOGIN_ERROR* = "errorWhileLogin"
|
||||||
|
|
||||||
type ResultArgs* = ref object of Args
|
type ResultArgs* = ref object of Args
|
||||||
|
@ -692,9 +691,6 @@ QtObject:
|
||||||
|
|
||||||
let isOldHashPassword = self.verifyDatabasePassword(account.keyUid, hashedPasswordToUpperCase(hashedPassword))
|
let isOldHashPassword = self.verifyDatabasePassword(account.keyUid, hashedPasswordToUpperCase(hashedPassword))
|
||||||
if isOldHashPassword:
|
if isOldHashPassword:
|
||||||
# Start loading screen with warning
|
|
||||||
self.events.emit(SIGNAL_REENCRYPTION_PROCESS_STARTED, Args())
|
|
||||||
|
|
||||||
# Save tmp properties so that we can login after the timer
|
# Save tmp properties so that we can login after the timer
|
||||||
self.tmpAccount = account
|
self.tmpAccount = account
|
||||||
self.tmpHashedPassword = hashedPassword
|
self.tmpHashedPassword = hashedPassword
|
||||||
|
|
|
@ -158,6 +158,7 @@ StatusWindow {
|
||||||
}
|
}
|
||||||
else if(state === Constants.appState.appLoading) {
|
else if(state === Constants.appState.appLoading) {
|
||||||
loader.sourceComponent = undefined
|
loader.sourceComponent = undefined
|
||||||
|
appLoadingAnimation.active = false
|
||||||
appLoadingAnimation.active = true
|
appLoadingAnimation.active = true
|
||||||
startupOnboarding.visible = false
|
startupOnboarding.visible = false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue