Skip to content
Snippets Groups Projects
Commit e92cb521 authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Start network follower when restoring backup

parent f8321d30
No related branches found
No related tags found
2 merge requests!102Release 1.0.0,!100Messenger - restore from backup
...@@ -48,6 +48,7 @@ extension MessengerRestoreBackup { ...@@ -48,6 +48,7 @@ extension MessengerRestoreBackup {
password: password, password: password,
cMixParamsJSON: env.getCMixParams() cMixParamsJSON: env.getCMixParams()
) )
try cMix.startNetworkFollower(timeoutMS: 30_000)
let e2e = try env.login( let e2e = try env.login(
cMixId: cMix.getId(), cMixId: cMix.getId(),
authCallbacks: env.authCallbacks.registered(), authCallbacks: env.authCallbacks.registered(),
......
...@@ -71,6 +71,9 @@ final class MessengerRestoreBackupTests: XCTestCase { ...@@ -71,6 +71,9 @@ final class MessengerRestoreBackupTests: XCTestCase {
caughtActions.append(.cMixDidMakeReceptionIdentity(legacy: legacy)) caughtActions.append(.cMixDidMakeReceptionIdentity(legacy: legacy))
return receptionIdentity return receptionIdentity
} }
cMix.startNetworkFollower.run = { timeoutMS in
caughtActions.append(.cMixDidStartNetworkFollower(timeoutMS: timeoutMS))
}
return cMix return cMix
} }
env.login.run = { ephemeral, cMixId, _, identity, e2eParams in env.login.run = { ephemeral, cMixId, _, identity, e2eParams in
...@@ -130,6 +133,9 @@ final class MessengerRestoreBackupTests: XCTestCase { ...@@ -130,6 +133,9 @@ final class MessengerRestoreBackupTests: XCTestCase {
password: password, password: password,
cMixParams: cMixParams cMixParams: cMixParams
), ),
.cMixDidStartNetworkFollower(
timeoutMS: 30_000
),
.cMixDidMakeReceptionIdentity( .cMixDidMakeReceptionIdentity(
legacy: true legacy: true
), ),
...@@ -213,6 +219,9 @@ private enum CaughtAction: Equatable { ...@@ -213,6 +219,9 @@ private enum CaughtAction: Equatable {
case cMixDidMakeReceptionIdentity( case cMixDidMakeReceptionIdentity(
legacy: Bool legacy: Bool
) )
case cMixDidStartNetworkFollower(
timeoutMS: Int
)
case didNewUdManagerFromBackup( case didNewUdManagerFromBackup(
params: NewUdManagerFromBackup.Params params: NewUdManagerFromBackup.Params
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment