Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.26.10 #1779

Merged
merged 25 commits into from
May 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
edc99aa
Enable Crypto SDK by default
Anderas Apr 14, 2023
3c614a8
Deprecate MXLegacyCrypto
Anderas Apr 17, 2023
0b9001f
Add crypto migration delegate
Anderas Apr 18, 2023
e13d4b0
Merge branch 'master' into develop
pixlwave Apr 18, 2023
d72008e
Prepare for new sprint
pixlwave Apr 18, 2023
9fec550
update breadcrumb list when leaving a room
JanNikGra Apr 19, 2023
cfaf594
refactoring
JanNikGra Apr 19, 2023
c9005c9
add success and failure callbacks
JanNikGra Apr 19, 2023
485490e
One more legacy crypto use
Anderas Apr 19, 2023
db75814
Merge pull request #1772 from matrix-org/andy/deprecate_crypto
Anderas Apr 19, 2023
98e7c1c
Merge pull request #1770 from matrix-org/andy/crypto_sdk
Anderas Apr 19, 2023
fb464aa
Fix: Refreshing the poll when receiving pollEnd can break the chronol…
nimau Apr 20, 2023
01abe16
add changelog
JanNikGra Apr 21, 2023
d1754dd
Rename 1777.bug to 1777.bugfix
JanNikGra Apr 21, 2023
af3059b
Fix: PollAggregator will now try to fetch pollStartEvent if it is mis…
nimau Apr 21, 2023
a0f2cf9
PollAggregator: poll is now optional
nimau Apr 26, 2023
e1eb69c
update account data only when necessary
JanNikGra Apr 27, 2023
c6903ec
formatting
JanNikGra Apr 27, 2023
fc76004
Merge branch 'update-breadcrumb-list-when-leaving-room' into update_b…
JanNikGra Apr 27, 2023
99227c7
Fix: PollAggregator - code refactoring
nimau Apr 27, 2023
45ca433
Fix: compilation issue
nimau Apr 27, 2023
da17ebf
Merge pull request #1777 from bwi-de/update-breadcrumb-list-when-leav…
nimau Apr 27, 2023
fb064c4
Fix: UnitTests
nimau Apr 27, 2023
3b76982
Merge pull request #1776 from matrix-org/nimau/7497_timeline_closed_p…
nimau Apr 27, 2023
226ab23
version++
May 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 0 additions & 86 deletions .github/workflows/ci-crypto-tests.yml

This file was deleted.

13 changes: 13 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## Changes in 0.26.10 (2023-05-16)

🙌 Improvements

- Crypto: Enable Crypto SDK by default ([#1770](https://github.com/matrix-org/matrix-ios-sdk/pull/1770))
- Crypto: Deprecate MXLegacyCrypto ([#1772](https://github.com/matrix-org/matrix-ios-sdk/pull/1772))

🐛 Bugfixes

- Poll: Refreshing the poll when receiving pollEnd can break the chronological order in the store. ([#1776](https://github.com/matrix-org/matrix-ios-sdk/pull/1776))
- Fix breadcrumb list not updating when leaving a room. Contributed by @JanNikGra. ([#1777](https://github.com/vector-im/element-ios/issues/1777))


## Changes in 0.26.9 (2023-04-18)

🐛 Bugfixes
Expand Down
2 changes: 1 addition & 1 deletion MatrixSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "MatrixSDK"
s.version = "0.26.9"
s.version = "0.26.10"
s.summary = "The iOS SDK to build apps compatible with Matrix (https://www.matrix.org)"

s.description = <<-DESC
Expand Down
134 changes: 86 additions & 48 deletions MatrixSDK.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@
<TestPlanReference
reference = "container:MatrixSDKTests/TestPlans/UnitTestsWithSanitizers.xctestplan">
</TestPlanReference>
<TestPlanReference
reference = "container:MatrixSDKTests/TestPlans/CryptoTests.xctestplan">
</TestPlanReference>
<TestPlanReference
reference = "container:MatrixSDKTests/TestPlans/AllWorkingTests.xctestplan">
</TestPlanReference>
Expand Down
2 changes: 0 additions & 2 deletions MatrixSDK/Aggregations/MXAggregations.m
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,6 @@ - (void)registerListener
[self.beaconAggregations handleBeaconWithEvent:event];
}
break;
case MXEventTypePollEnd:
[self.aggregatedPollsUpdater refreshPollAfter:event];
default:
break;
}
Expand Down
12 changes: 2 additions & 10 deletions MatrixSDK/Background/MXBackgroundSyncService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public enum MXBackgroundSyncServiceError: Error {
/// - Parameter credentials: account credentials
public init(
withCredentials credentials: MXCredentials,
isCryptoSDKEnabled: Bool = false,
persistTokenDataHandler: MXRestClientPersistTokenDataHandler? = nil,
unauthenticatedHandler: MXRestClientUnauthenticatedHandler? = nil
) {
Expand All @@ -90,16 +89,9 @@ public enum MXBackgroundSyncServiceError: Error {
self.restClient = restClient

store = MXBackgroundStore(withCredentials: credentials)
// We can flush any crypto data if our sync response store is empty
let resetBackgroundCryptoStore = syncResponseStoreManager.syncToken() == nil

if isCryptoSDKEnabled {
MXLog.debug("[MXBackgroundSyncService] init: constructing crypto v2")
crypto = MXBackgroundCryptoV2(credentials: credentials, restClient: restClient)
} else {
MXLog.debug("[MXBackgroundSyncService] init: constructing legacy crypto")
crypto = MXLegacyBackgroundCrypto(credentials: credentials, resetBackgroundCryptoStore: resetBackgroundCryptoStore)
}
MXLog.debug("[MXBackgroundSyncService] init: constructing crypto")
crypto = MXBackgroundCryptoV2(credentials: credentials, restClient: restClient)

pushRulesManager = MXBackgroundPushRulesManager(withCredentials: credentials)
MXLog.debug("[MXBackgroundSyncService] init complete")
Expand Down
2 changes: 1 addition & 1 deletion MatrixSDK/Crypto/CrossSigning/MXCrossSigningV2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class MXCrossSigningV2: NSObject, MXCrossSigning {
// If we are considered verified, there is no need for a verification upgrade
// after migrating from legacy crypto
if myUserCrossSigningKeys?.trustLevel.isVerified == true {
MXSDKOptions.sharedInstance().cryptoSDKFeature?.needsVerificationUpgrade = false
MXSDKOptions.sharedInstance().cryptoMigrationDelegate?.needsVerificationUpgrade = false
}

log.debug("Cross signing state refreshed, new state: \(state)")
Expand Down
22 changes: 0 additions & 22 deletions MatrixSDK/Crypto/MXCrypto.m
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,6 @@ @implementation MXLegacyCrypto
__block id<MXCrypto> crypto;

#ifdef MX_CRYPTO
if (MXSDKOptions.sharedInstance.enableCryptoSDK)
{
MXLogFailure(@"[MXCrypto] createCryptoWithMatrixSession: Crypto V2 should not be created directly, use initializeCryptoWithMatrixSession instead");
return nil;
}

dispatch_queue_t cryptoQueue = [MXLegacyCrypto dispatchQueueForUser:mxSession.matrixRestClient.credentials.userId];
dispatch_sync(cryptoQueue, ^{

Expand All @@ -180,22 +174,6 @@ + (void)initializeCryptoWithMatrixSession:(MXSession *)mxSession
complete:(void (^)(id<MXCrypto> crypto, NSError *error))complete
{
#ifdef MX_CRYPTO

// Each time we construct the crypto module (app launch, login etc) we have a chance to try to enable
// the newer SDK crypto module, if it is available for this particular user.
[MXSDKOptions.sharedInstance.cryptoSDKFeature enableIfAvailableForUserId:mxSession.myUserId];
if (MXSDKOptions.sharedInstance.enableCryptoSDK)
{
[MXCryptoV2Factory.shared buildCryptoWithSession:mxSession
migrationProgress:migrationProgress
success:^(id<MXCrypto> crypto) {
complete(crypto, nil); }
failure:^(NSError *error) {
complete(nil, error);
}];
return;
}

[self initalizeLegacyCryptoWithMatrixSession:mxSession complete:complete];
#else
complete(nil);
Expand Down
27 changes: 26 additions & 1 deletion MatrixSDK/Crypto/MXCryptoV2Factory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@

import Foundation

/// Delegate for migrating account data from legacy crypto to rust-based Crypto SDK
@objc public protocol MXCryptoV2MigrationDelegate {

/// Flag indicating whether this account requires a re-verification after migrating to Crypto SDK
///
/// This flag is set to true if the legacy account is considered verified but the rust account
/// does not consider the migrated data secure enough, as it applies stricter security conditions.
var needsVerificationUpgrade: Bool { get set }
}

@objc public class MXCryptoV2Factory: NSObject {
enum Error: Swift.Error {
case cryptoNotAvailable
Expand All @@ -28,6 +38,21 @@ import Foundation
.deprecated3
}

@objc public func hasCryptoData(for session: MXSession!) -> Bool {
guard let userId = session?.myUserId else {
log.error("Missing required dependencies")
return false
}

do {
let url = try MXCryptoMachineStore.storeURL(for: userId)
return FileManager.default.fileExists(atPath: url.path)
} catch {
log.error("Failed creating url for user", context: error)
return false
}
}

@objc public func buildCrypto(
session: MXSession!,
migrationProgress: ((Double) -> Void)?,
Expand Down Expand Up @@ -124,7 +149,7 @@ import Foundation
// unless the rust-based crypto already considers the current session to be verified given
// the migration data
log.debug("Needs verification upgrade")
MXSDKOptions.sharedInstance().cryptoSDKFeature?.needsVerificationUpgrade = true
MXSDKOptions.sharedInstance().cryptoMigrationDelegate?.needsVerificationUpgrade = true
}
}
}
50 changes: 0 additions & 50 deletions MatrixSDK/Crypto/MXCryptoV2Feature.swift

This file was deleted.

6 changes: 0 additions & 6 deletions MatrixSDK/Data/EventTimeline/Room/MXRoomEventTimeline.m
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ - (void)initialiseState:(NSArray<MXEvent *> *)stateEvents

- (void)destroy
{
[room.mxSession resetReplayAttackCheckInTimeline:_timelineId];

if (httpOperation)
{
// Cancel the current server request
Expand Down Expand Up @@ -190,8 +188,6 @@ - (BOOL)canPaginate:(MXTimelineDirection)direction

- (void)resetPagination
{
[room.mxSession resetReplayAttackCheckInTimeline:_timelineId];

// Reset the back state to the current room state
backState = [[MXRoomState alloc] initBackStateWith:_state];

Expand All @@ -203,8 +199,6 @@ - (MXHTTPOperation *)resetPaginationAroundInitialEventWithLimit:(NSUInteger)limi
{
NSParameterAssert(success);
NSAssert(_initialEventId, @"[MXRoomEventTimeline] resetPaginationAroundInitialEventWithLimit cannot be called on live timeline");

[room.mxSession resetReplayAttackCheckInTimeline:_timelineId];

// Reset the store
if (!store.isPermanent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ public class MXThreadEventTimeline: NSObject, MXEventTimeline {
}

public func destroy() {
thread.session?.resetReplayAttackCheck(inTimeline: timelineId)

removeAllListeners()

currentHttpOperation?.cancel()
Expand Down Expand Up @@ -132,8 +130,6 @@ public class MXThreadEventTimeline: NSObject, MXEventTimeline {
}

public func resetPagination() {
thread.session?.resetReplayAttackCheck(inTimeline: timelineId)

// Reset store pagination
storeMessagesEnumerator = store.messagesEnumerator(forRoom: thread.roomId)

Expand All @@ -150,8 +146,6 @@ public class MXThreadEventTimeline: NSObject, MXEventTimeline {
fatalError("[MXThreadEventTimeline][\(timelineId)] resetPaginationAroundInitialEventWithLimit cannot be called on live timeline")
}

thread.session?.resetReplayAttackCheck(inTimeline: timelineId)

// Reset the store
if !store.isPermanent {
store.deleteAllData()
Expand Down
Loading