Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	MatrixSDK/Contrib/Swift/JSONModels/MXEvent.swift
  • Loading branch information
artemkrachulov committed Jul 1, 2024
2 parents ce24f2a + 8a7f6b3 commit 3d266aa
Show file tree
Hide file tree
Showing 38 changed files with 373 additions and 96 deletions.
44 changes: 44 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,47 @@
## Changes in 0.27.11 (2024-06-18)

No significant changes.


## Changes in 0.27.10 (2024-06-17)

No significant changes.


## Changes in 0.27.9 (2024-06-13)

No significant changes.


## Changes in 0.27.8 (2024-05-29)

🙌 Improvements

- When sorting room list alphabetically, sort it case-insensitive. ([#1851](https://github.com/matrix-org/matrix-ios-sdk/pull/1851))
- Crypto: Update crypto SDK to 0.4.1 ([#1853](https://github.com/matrix-org/matrix-ios-sdk/pull/1853))


## Changes in 0.27.7 (2024-05-01)

No significant changes.


## Changes in 0.27.6 (2024-02-07)

No significant changes.


## Changes in 0.27.5 (2024-01-09)

🐛 Bugfixes

- Update regex for email address to be aligned email format in RFC 5322 ([#1826](https://github.com/matrix-org/matrix-ios-sdk/pull/1826))

🧱 Build

- Update CocoaPods and other gems. ([#1835](https://github.com/matrix-org/matrix-ios-sdk/pull/1835))


## Changes in 0.27.4 (2023-11-28)

🐛 Bugfixes
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source "https://rubygems.org"

gem "fastlane"
gem "cocoapods", '~>1.13.0'
gem "cocoapods", '~>1.14.3'
gem "xcode-install"
gem "slather"
81 changes: 44 additions & 37 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@ GEM
specs:
CFPropertyList (3.0.6)
rexml
activesupport (7.0.8)
activesupport (7.1.2)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
Expand All @@ -15,31 +20,33 @@ GEM
json (>= 1.5.1)
artifactory (3.0.15)
atomos (0.1.3)
aws-eventstream (1.2.0)
aws-partitions (1.828.0)
aws-sdk-core (3.183.1)
aws-eventstream (1.3.0)
aws-partitions (1.859.0)
aws-sdk-core (3.188.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.71.0)
aws-sdk-core (~> 3, >= 3.177.0)
aws-sdk-kms (1.73.0)
aws-sdk-core (~> 3, >= 3.188.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.136.0)
aws-sdk-core (~> 3, >= 3.181.0)
aws-sdk-s3 (1.140.0)
aws-sdk-core (~> 3, >= 3.188.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.6)
aws-sigv4 (1.6.0)
aws-sigv4 (1.7.0)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
base64 (0.2.0)
bigdecimal (3.1.4)
claide (1.1.0)
clamp (1.3.2)
cocoapods (1.13.0)
cocoapods (1.14.3)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.13.0)
cocoapods-core (= 1.14.3)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.6.0, < 2.0)
cocoapods-downloader (>= 2.1, < 3.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.6.0, < 2.0)
Expand All @@ -52,7 +59,7 @@ GEM
nap (~> 1.0)
ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.23.0, < 2.0)
cocoapods-core (1.13.0)
cocoapods-core (1.14.3)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
Expand All @@ -63,7 +70,7 @@ GEM
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (1.6.3)
cocoapods-downloader (2.1)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
Expand All @@ -76,17 +83,19 @@ GEM
commander (4.6.0)
highline (~> 2.0.0)
concurrent-ruby (1.2.2)
connection_pool (2.4.1)
declarative (0.0.20)
digest-crc (0.6.5)
rake (>= 12.0.0, < 14.0.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
domain_name (0.6.20231109)
dotenv (2.8.1)
drb (2.2.0)
ruby2_keywords
emoji_regex (3.2.3)
escape (0.0.4)
ethon (0.16.0)
ffi (>= 1.15.0)
excon (0.103.0)
excon (0.104.0)
faraday (1.10.3)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
Expand Down Expand Up @@ -116,7 +125,7 @@ GEM
faraday_middleware (1.2.0)
faraday (~> 1.0)
fastimage (2.2.7)
fastlane (2.216.0)
fastlane (2.217.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
Expand Down Expand Up @@ -156,13 +165,13 @@ GEM
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
ffi (1.16.2)
ffi (1.16.3)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.50.0)
google-apis-androidpublisher_v3 (0.53.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-core (0.11.1)
google-apis-core (0.11.2)
addressable (~> 2.5, >= 2.5.1)
googleauth (>= 0.16.2, < 2.a)
httpclient (>= 2.8.1, < 3.a)
Expand All @@ -175,19 +184,19 @@ GEM
google-apis-core (>= 0.11.0, < 2.a)
google-apis-playcustomapp_v1 (0.13.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-storage_v1 (0.19.0)
google-apis-core (>= 0.9.0, < 2.a)
google-apis-storage_v1 (0.29.0)
google-apis-core (>= 0.11.0, < 2.a)
google-cloud-core (1.6.0)
google-cloud-env (~> 1.0)
google-cloud-errors (~> 1.0)
google-cloud-env (1.6.0)
faraday (>= 0.17.3, < 3.0)
google-cloud-errors (1.3.1)
google-cloud-storage (1.44.0)
google-cloud-storage (1.45.0)
addressable (~> 2.8)
digest-crc (~> 0.4)
google-apis-iamcredentials_v1 (~> 0.1)
google-apis-storage_v1 (~> 0.19.0)
google-apis-storage_v1 (~> 0.29.0)
google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0)
Expand All @@ -208,24 +217,25 @@ GEM
jwt (2.7.1)
mini_magick (4.12.0)
mini_mime (1.1.5)
mini_portile2 (2.8.4)
mini_portile2 (2.8.5)
minitest (5.20.0)
molinillo (0.8.0)
multi_json (1.15.0)
multipart-post (2.3.0)
mutex_m (0.2.0)
nanaimo (0.3.0)
nap (1.1.0)
naturally (2.2.1)
netrc (0.11.0)
nokogiri (1.15.4)
nokogiri (1.15.5)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
optparse (0.1.1)
os (1.1.4)
plist (3.7.0)
public_suffix (4.0.7)
racc (1.7.1)
rake (13.0.6)
racc (1.7.3)
rake (13.1.0)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
Expand All @@ -245,11 +255,11 @@ GEM
simctl (1.6.10)
CFPropertyList
naturally
slather (2.7.4)
slather (2.8.0)
CFPropertyList (>= 2.2, < 4)
activesupport
clamp (~> 1.3)
nokogiri (>= 1.13.9)
nokogiri (>= 1.14.3)
xcodeproj (~> 1.21)
terminal-notifier (2.0.0)
terminal-table (3.0.2)
Expand All @@ -259,15 +269,12 @@ GEM
tty-screen (0.8.1)
tty-spinner (0.9.3)
tty-cursor (~> 0.7)
typhoeus (1.4.0)
typhoeus (1.4.1)
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uber (0.1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (2.4.2)
unicode-display_width (2.5.0)
webrick (1.8.1)
word_wrap (1.0.0)
xcode-install (2.8.1)
Expand All @@ -289,7 +296,7 @@ PLATFORMS
ruby

DEPENDENCIES
cocoapods (~> 1.13.0)
cocoapods (~> 1.14.3)
fastlane
slather
xcode-install
Expand Down
4 changes: 2 additions & 2 deletions 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.27.4"
s.version = "0.27.11"
s.summary = "The iOS SDK to build apps compatible with Matrix (https://www.matrix.org)"

s.description = <<-DESC
Expand Down Expand Up @@ -45,7 +45,7 @@ Pod::Spec.new do |s|
ss.dependency 'OLMKit', '~> 3.2.5'
ss.dependency 'Realm', '10.27.0'
ss.dependency 'libbase58', '~> 0.1.4'
ss.dependency 'MatrixSDKCrypto', '0.3.13', :configurations => ["DEBUG", "RELEASE"], :inhibit_warnings => true
ss.dependency 'MatrixSDKCrypto', '0.4.2', :configurations => ["DEBUG", "RELEASE"], :inhibit_warnings => true
end

s.subspec 'JingleCallStack' do |ss|
Expand Down
6 changes: 5 additions & 1 deletion MatrixSDK/Background/MXBackgroundStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,11 @@ class MXBackgroundStore: NSObject, MXStore {
func isRoomMarked(asUnread roomId: String) -> Bool {
return false
}

func removeAllMessagesSent(before limitTs: UInt64, inRoom roomId: String) -> Bool {
// Not sure if this needs to be implemented
false
}
}

// MARK: - MXRoomSummaryStore
Expand Down Expand Up @@ -341,5 +346,4 @@ extension MXBackgroundStore: MXRoomSummaryStore {
completion([])
}
}

}
4 changes: 3 additions & 1 deletion MatrixSDK/Contrib/Swift/JSONModels/MXEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public enum MXEventType: Equatable, Hashable {

case beaconInfo
case beacon
case roomRetention

case custom(String)

Expand Down Expand Up @@ -149,6 +150,7 @@ public enum MXEventType: Equatable, Hashable {
case .taggedEvents: return kMXEventTypeStringTaggedEvents
case .spaceChild: return kMXEventTypeStringSpaceChild
case .spaceOrder: return kMXEventTypeStringSpaceOrderMSC3230
case .roomRetention: return kMXEventTypeStringRoomRetention

case .pollStart: return kMXEventTypeStringPollStartMSC3381
case .pollResponse: return kMXEventTypeStringPollResponseMSC3381
Expand All @@ -165,7 +167,7 @@ public enum MXEventType: Equatable, Hashable {
}

public init(identifier: String) {
let events: [MXEventType] = [.roomName, .roomTopic, .roomAvatar, .roomMember, .roomCreate, .roomJoinRules, .roomPowerLevels, .roomAliases, .roomCanonicalAlias, .roomEncrypted, .roomEncryption, .roomGuestAccess, .roomHistoryVisibility, .roomKey, .roomForwardedKey, .roomKeyRequest, .roomMessage, .roomMessageFeedback, .roomRedaction, .roomThirdPartyInvite, .roomTag, .presence, .typing, .callInvite, .callInviteGk, .callCandidates, .callAnswer, .callAnswerGk, .callSelectAnswer, .callHangup, .callHangupGk, .callReject, .callRejectGk, .callNegotiate, .callReplaces, .callRejectReplacement, .callAssertedIdentity, .callAssertedIdentityUnstable, .reaction, .receipt, .roomTombStone, .keyVerificationStart, .keyVerificationAccept, .keyVerificationKey, .keyVerificationMac, .keyVerificationCancel, .keyVerificationDone, .secretRequest, .secretSend, .secretStorageDefaultKey, .taggedEvents, .spaceChild, .spaceOrder, .pollStart, .pollResponse, .pollEnd, .beaconInfo, .beacon]
let events: [MXEventType] = [.roomName, .roomTopic, .roomAvatar, .roomMember, .roomCreate, .roomJoinRules, .roomPowerLevels, .roomAliases, .roomCanonicalAlias, .roomEncrypted, .roomEncryption, .roomGuestAccess, .roomHistoryVisibility, .roomKey, .roomForwardedKey, .roomKeyRequest, .roomMessage, .roomMessageFeedback, .roomRedaction, .roomThirdPartyInvite, .roomTag, .presence, .typing, .callInvite, .callCandidates, .callAnswer, .callSelectAnswer, .callHangup, .callReject, .callNegotiate, .callReplaces, .callRejectReplacement, .callAssertedIdentity, .callAssertedIdentityUnstable, .reaction, .receipt, .roomTombStone, .keyVerificationStart, .keyVerificationAccept, .keyVerificationKey, .keyVerificationMac, .keyVerificationCancel, .keyVerificationDone, .secretRequest, .secretSend, .secretStorageDefaultKey, .taggedEvents, .spaceChild, .spaceOrder, .pollStart, .pollResponse, .pollEnd, .beaconInfo, .beacon, .roomRetention]

if let type = events.first(where: { $0.identifier == identifier }) {
self = type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,13 @@ actor MXRoomEventDecryption: MXRoomEventDecrypting {
])
return trackedDecryptionResult(for: event, error: error)

case .MissingRoomKey(let message):
case .MissingRoomKey(let message, let withheldCode):
if undecryptedEvents[sessionId] == nil {
log.error("Failed to decrypt event(s) due to missing room keys", context: [
"session_id": sessionId,
"message": message,
"error": error,
"withheldCode": withheldCode ?? "N/A",
"details": "further errors for the same key will be supressed",
])
}
Expand Down
13 changes: 11 additions & 2 deletions MatrixSDK/Crypto/CryptoMachine/MXCryptoMachine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ class MXCryptoMachine {
}
}

func invalidateCache() async {
await machine.clearCryptoCache()
}

// MARK: - Private

private static func createMachine(userId: String, deviceId: String, log: MXNamedLog) throws -> OlmMachine {
Expand Down Expand Up @@ -593,9 +597,14 @@ extension MXCryptoMachine: MXCryptoCrossSigning {

func bootstrapCrossSigning(authParams: [AnyHashable: Any]) async throws {
let result = try machine.bootstrapCrossSigning()
// If this is called before the device keys have been uploaded there will be a
// request to upload them, do that first.
if let optionalKeyRequest = result.uploadKeysRequest {
try await handleRequest(optionalKeyRequest)
}
let _ = try await [
requests.uploadSigningKeys(request: result.uploadSigningKeysRequest, authParams: authParams),
requests.uploadSignatures(request: result.signatureRequest)
requests.uploadSignatures(request: result.uploadSignatureRequest)
]
}

Expand Down Expand Up @@ -835,7 +844,7 @@ extension MXCryptoMachine: MXCryptoBackup {
guard let message = MXCryptoTools.canonicalJSONString(forJSON: object) else {
throw Error.cannotSerialize
}
return machine.sign(message: message)
return try machine.sign(message: message)
}

func backupRoomKeys() async throws {
Expand Down
Loading

0 comments on commit 3d266aa

Please sign in to comment.