Prefer archiving, to deleting old sessions for better handling of out of

order decryption.

// FREEBIE
pull/1/head
Michael Kirk 7 years ago
parent c51b762ec2
commit 6715e76c99

@ -3,10 +3,10 @@ source 'https://github.com/CocoaPods/Specs.git'
target 'Signal' do target 'Signal' do
pod 'SocketRocket', :git => 'https://github.com/facebook/SocketRocket.git' pod 'SocketRocket', :git => 'https://github.com/facebook/SocketRocket.git'
pod 'AxolotlKit', git: 'https://github.com/WhisperSystems/SignalProtocolKit.git' #pod 'AxolotlKit', git: 'https://github.com/WhisperSystems/SignalProtocolKit.git'
#pod 'AxolotlKit', path: '../SignalProtocolKit' pod 'AxolotlKit', path: '../SignalProtocolKit'
pod 'SignalServiceKit', git: 'https://github.com/WhisperSystems/SignalServiceKit.git' #pod 'SignalServiceKit', git: 'https://github.com/WhisperSystems/SignalServiceKit.git'
#pod 'SignalServiceKit', path: '../SignalServiceKit' pod 'SignalServiceKit', path: '../SignalServiceKit'
pod 'OpenSSL' pod 'OpenSSL'
pod 'JSQMessagesViewController', git: 'https://github.com/WhisperSystems/JSQMessagesViewController.git', branch: 'mkirk/position-edit-menu' pod 'JSQMessagesViewController', git: 'https://github.com/WhisperSystems/JSQMessagesViewController.git', branch: 'mkirk/position-edit-menu'
#pod 'JSQMessagesViewController' path: '../JSQMessagesViewController' #pod 'JSQMessagesViewController' path: '../JSQMessagesViewController'

@ -109,35 +109,29 @@ PODS:
- YapDatabase/SQLCipher/Core - YapDatabase/SQLCipher/Core
DEPENDENCIES: DEPENDENCIES:
- AxolotlKit (from `https://github.com/WhisperSystems/SignalProtocolKit.git`) - AxolotlKit (from `../SignalProtocolKit`)
- JSQMessagesViewController (from `https://github.com/WhisperSystems/JSQMessagesViewController.git`, branch `mkirk/position-edit-menu`) - JSQMessagesViewController (from `https://github.com/WhisperSystems/JSQMessagesViewController.git`, branch `mkirk/position-edit-menu`)
- OpenSSL - OpenSSL
- PureLayout - PureLayout
- Reachability - Reachability
- SignalServiceKit (from `https://github.com/WhisperSystems/SignalServiceKit.git`) - SignalServiceKit (from `../SignalServiceKit`)
- SocketRocket (from `https://github.com/facebook/SocketRocket.git`) - SocketRocket (from `https://github.com/facebook/SocketRocket.git`)
EXTERNAL SOURCES: EXTERNAL SOURCES:
AxolotlKit: AxolotlKit:
:git: https://github.com/WhisperSystems/SignalProtocolKit.git :path: "../SignalProtocolKit"
JSQMessagesViewController: JSQMessagesViewController:
:branch: mkirk/position-edit-menu :branch: mkirk/position-edit-menu
:git: https://github.com/WhisperSystems/JSQMessagesViewController.git :git: https://github.com/WhisperSystems/JSQMessagesViewController.git
SignalServiceKit: SignalServiceKit:
:git: https://github.com/WhisperSystems/SignalServiceKit.git :path: "../SignalServiceKit"
SocketRocket: SocketRocket:
:git: https://github.com/facebook/SocketRocket.git :git: https://github.com/facebook/SocketRocket.git
CHECKOUT OPTIONS: CHECKOUT OPTIONS:
AxolotlKit:
:commit: 9179d4e326df58185f35af45831e7a5d7250ab85
:git: https://github.com/WhisperSystems/SignalProtocolKit.git
JSQMessagesViewController: JSQMessagesViewController:
:commit: 7054e4b13ee5bcd6d524adb6dc9a726e8c466308 :commit: 7054e4b13ee5bcd6d524adb6dc9a726e8c466308
:git: https://github.com/WhisperSystems/JSQMessagesViewController.git :git: https://github.com/WhisperSystems/JSQMessagesViewController.git
SignalServiceKit:
:commit: f2f654af194c9b232ccf2b3d382f8a096bffcd00
:git: https://github.com/WhisperSystems/SignalServiceKit.git
SocketRocket: SocketRocket:
:commit: 877ac7438be3ad0b45ef5ca3969574e4b97112bf :commit: 877ac7438be3ad0b45ef5ca3969574e4b97112bf
:git: https://github.com/facebook/SocketRocket.git :git: https://github.com/facebook/SocketRocket.git
@ -164,6 +158,6 @@ SPEC CHECKSUMS:
UnionFind: c33be5adb12983981d6e827ea94fc7f9e370f52d UnionFind: c33be5adb12983981d6e827ea94fc7f9e370f52d
YapDatabase: cd911121580ff16675f65ad742a9eb0ab4d9e266 YapDatabase: cd911121580ff16675f65ad742a9eb0ab4d9e266
PODFILE CHECKSUM: 48e80d7f1e049bbf544a689fdfdf33e8196c640a PODFILE CHECKSUM: dc5ed308ade575a81ccadf5c485990530353c4ee
COCOAPODS: 1.2.1 COCOAPODS: 1.2.1

@ -27,7 +27,7 @@ class SessionResetJob: NSObject {
OWSDispatch.sessionStoreQueue().async { OWSDispatch.sessionStoreQueue().async {
Logger.info("\(self.TAG) deleting sessions for recipient: \(self.recipientId)") Logger.info("\(self.TAG) deleting sessions for recipient: \(self.recipientId)")
self.storageManager.deleteAllSessions(forContact: self.recipientId) self.storageManager.archiveAllSessions(forContact: self.recipientId)
DispatchQueue.main.async { DispatchQueue.main.async {
let endSessionMessage = EndSessionMessage(timestamp:NSDate.ows_millisecondTimeStamp(), in: self.thread) let endSessionMessage = EndSessionMessage(timestamp:NSDate.ows_millisecondTimeStamp(), in: self.thread)

@ -68,8 +68,8 @@ class ProfileFetcherJob: NSObject {
} }
if OWSIdentityManager.shared().saveRemoteIdentity(latestIdentityKey, recipientId: recipientId) { if OWSIdentityManager.shared().saveRemoteIdentity(latestIdentityKey, recipientId: recipientId) {
Logger.info("\(self.TAG) updated identity key in fetched profile for recipient: \(recipientId)") Logger.info("\(self.TAG) updated identity key with fetched profile for recipient: \(recipientId)")
self.storageManager.deleteAllSessions(forContact: recipientId) self.storageManager.archiveAllSessions(forContact: recipientId)
} else { } else {
// no change in identity. // no change in identity.
} }

@ -49,13 +49,20 @@ NS_ASSUME_NONNULL_BEGIN
actionBlock:^{ actionBlock:^{
[self presentVerificationStatePickerForContactThread:contactThread]; [self presentVerificationStatePickerForContactThread:contactThread];
}], }],
[OWSTableItem itemWithTitle:@"Delete session" [OWSTableItem itemWithTitle:@"Delete all sessions"
actionBlock:^{ actionBlock:^{
dispatch_async([OWSDispatch sessionStoreQueue], ^{ dispatch_async([OWSDispatch sessionStoreQueue], ^{
[[TSStorageManager sharedManager] [[TSStorageManager sharedManager]
deleteAllSessionsForContact:contactThread.contactIdentifier]; deleteAllSessionsForContact:contactThread.contactIdentifier];
}); });
}], }],
[OWSTableItem itemWithTitle:@"Archive all sessions"
actionBlock:^{
dispatch_async([OWSDispatch sessionStoreQueue], ^{
[[TSStorageManager sharedManager]
archiveAllSessionsForContact:contactThread.contactIdentifier];
});
}],
[OWSTableItem itemWithTitle:@"Send session reset" [OWSTableItem itemWithTitle:@"Send session reset"
actionBlock:^{ actionBlock:^{
[OWSSessionResetJob [OWSSessionResetJob

Loading…
Cancel
Save