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

order decryption.

// FREEBIE
This commit is contained in:
Michael Kirk 2017-06-08 08:37:28 -04:00
parent c51b762ec2
commit 6715e76c99
5 changed files with 20 additions and 19 deletions

View File

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

View File

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

View File

@ -27,7 +27,7 @@ class SessionResetJob: NSObject {
OWSDispatch.sessionStoreQueue().async {
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 {
let endSessionMessage = EndSessionMessage(timestamp:NSDate.ows_millisecondTimeStamp(), in: self.thread)

View File

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

View File

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