diff --git a/Riot/Modules/MatrixKit/Models/Account/MXKAccount.m b/Riot/Modules/MatrixKit/Models/Account/MXKAccount.m index 36e4989f9..548442ab7 100644 --- a/Riot/Modules/MatrixKit/Models/Account/MXKAccount.m +++ b/Riot/Modules/MatrixKit/Models/Account/MXKAccount.m @@ -947,9 +947,10 @@ static NSArray *initialSyncSilentErrorsHTTPStatusCodes; if (clearStore) { - // Force a reload of device keys at the next session start. + // Force a reload of device keys at the next session start, unless we are just about to migrate + // all data and device keys into CryptoSDK. // This will fix potential UISIs other peoples receive for our messages. - if ([mxSession.crypto isKindOfClass:[MXLegacyCrypto class]]) + if ([mxSession.crypto isKindOfClass:[MXLegacyCrypto class]] && !MXSDKOptions.sharedInstance.enableCryptoSDK) { [(MXLegacyCrypto *)mxSession.crypto resetDeviceKeys]; } diff --git a/changelog.d/pr-7369.change b/changelog.d/pr-7369.change new file mode 100644 index 000000000..a38028df9 --- /dev/null +++ b/changelog.d/pr-7369.change @@ -0,0 +1 @@ +Do not reset device keys if migrating to CryptoSDK