Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions wire-ios-data-model/Source/MLS/MLSService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
public final class MLSService: MLSServiceInterface {

// MARK: - Properties

Check warning on line 53 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Stored property 'context' of 'Sendable'-conforming class 'MLSService' is mutable; this is an error in the Swift 6 language mode

Stored property 'context' of 'Sendable'-conforming class 'MLSService' is mutable; this is an error in the Swift 6 language mode

Check warning on line 53 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Stored property 'context' of 'Sendable'-conforming class 'MLSService' is mutable; this is an error in the Swift 6 language mode

Stored property 'context' of 'Sendable'-conforming class 'MLSService' is mutable; this is an error in the Swift 6 language mode
private weak var context: NSManagedObjectContext?
private var notificationContext: any NotificationContext
private let coreCryptoProvider: CoreCryptoProviderProtocol
Expand Down Expand Up @@ -829,7 +829,7 @@
pendingGroup: ZMConversation,
context: NSManagedObjectContext
) async throws {
let mlsUsers = await context.perform {

Check warning on line 832 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'pendingGroup' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'pendingGroup' with non-Sendable type 'ZMConversation' in a '@sendable' closure

Check warning on line 832 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'pendingGroup' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'pendingGroup' with non-Sendable type 'ZMConversation' in a '@sendable' closure
pendingGroup.localParticipants.map {
MLSUser(from: $0, localDomain: self.localDomain)
}
Expand All @@ -840,7 +840,7 @@
with: mlsUsers
)

await context.perform {

Check warning on line 843 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'pendingGroup' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'pendingGroup' with non-Sendable type 'ZMConversation' in a '@sendable' closure

Check warning on line 843 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'ciphersuite' with non-Sendable type 'MLSCipherSuite' in a '@Sendable' closure

Capture of 'ciphersuite' with non-Sendable type 'MLSCipherSuite' in a '@sendable' closure

Check warning on line 843 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'pendingGroup' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'pendingGroup' with non-Sendable type 'ZMConversation' in a '@sendable' closure

Check warning on line 843 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'ciphersuite' with non-Sendable type 'MLSCipherSuite' in a '@Sendable' closure

Capture of 'ciphersuite' with non-Sendable type 'MLSCipherSuite' in a '@sendable' closure
pendingGroup.ciphersuite = ciphersuite
pendingGroup.mlsStatus = .ready
}
Expand All @@ -862,19 +862,19 @@

let needToSave = await withTaskGroup(of: Bool.self) { group in
for pendingGroup in pendingGroups {
group.addTask {

Check warning on line 865 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'pendingGroup' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'pendingGroup' with non-Sendable type 'ZMConversation' in a '@sendable' closure

Check warning on line 865 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'pendingGroup' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'pendingGroup' with non-Sendable type 'ZMConversation' in a '@sendable' closure
guard let mlsGroupID = await context.perform({ pendingGroup.mlsGroupID }) else {
return false
}

do {
let (epoch, isSelfConversation) = await context.perform {
(pendingGroup.epoch, pendingGroup.isSelfConversation)
let epoch = await context.perform {

Check warning on line 871 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'pendingGroup' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'pendingGroup' with non-Sendable type 'ZMConversation' in a '@sendable' closure

Check warning on line 871 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'pendingGroup' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'pendingGroup' with non-Sendable type 'ZMConversation' in a '@sendable' closure
pendingGroup.epoch
}
let conversationExists = try await self.conversationExists(
groupID: mlsGroupID
)
let shouldEstablishGroup = epoch == 0 && isSelfConversation && !conversationExists
let shouldEstablishGroup = epoch == 0 && !conversationExists

if shouldEstablishGroup {
try await self.internalEstablishPendingGroup(
Expand Down Expand Up @@ -1077,7 +1077,7 @@
in conversation: ZMConversation,
context: NSManagedObjectContext
) async {
await context.perform {

Check warning on line 1080 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@sendable' closure

Check warning on line 1080 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@sendable' closure
conversation.appendNewPotentialGapSystemMessage(
users: conversation.localParticipants,
timestamp: Date()
Expand Down Expand Up @@ -1163,7 +1163,7 @@
}
return outOfSyncConversations
}
return await context.perform {

Check warning on line 1166 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversations' with non-Sendable type '[ZMConversation]' in a '@Sendable' closure

Capture of 'conversations' with non-Sendable type '[ZMConversation]' in a '@sendable' closure

Check warning on line 1166 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversations' with non-Sendable type '[ZMConversation]' in a '@Sendable' closure

Capture of 'conversations' with non-Sendable type '[ZMConversation]' in a '@sendable' closure
conversations.compactMap {
if let groupId = $0.mlsGroupID {
(groupId, $0)
Expand All @@ -1183,11 +1183,11 @@
var groupID: MLSGroupID?
var epoch: UInt64?

await context.perform {

Check warning on line 1186 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'subgroup' with non-Sendable type 'MLSSubgroup?' in a '@Sendable' closure

Capture of 'subgroup' with non-Sendable type 'MLSSubgroup?' in a '@sendable' closure

Check warning on line 1186 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'subgroup' with non-Sendable type 'MLSSubgroup?' in a '@Sendable' closure

Capture of 'subgroup' with non-Sendable type 'MLSSubgroup?' in a '@sendable' closure
if let subgroup {
groupID = subgroup.groupID
epoch = UInt64(subgroup.epoch)
} else {

Check warning on line 1190 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@sendable' closure

Check warning on line 1190 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@sendable' closure
groupID = conversation.mlsGroupID
epoch = conversation.epoch
}
Expand Down Expand Up @@ -1317,7 +1317,7 @@
var conversation: ZMConversation?
var qualifiedID: QualifiedID?
var epoch: UInt64 = 0
await context.perform {

Check warning on line 1320 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation?' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation?' in a '@sendable' closure

Check warning on line 1320 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation?' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation?' in a '@sendable' closure
conversation = ZMConversation.fetch(with: groupID, in: context)
qualifiedID = conversation?.qualifiedID
epoch = conversation?.epoch ?? 0
Expand Down Expand Up @@ -1911,7 +1911,7 @@
for conversation in groupConversations {

let (qualifiedID, members) = await context.perform {
(

Check warning on line 1914 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@sendable' closure

Check warning on line 1914 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@sendable' closure
conversation.qualifiedID,
conversation.localParticipants.map { MLSUser(from: $0, localDomain: self.localDomain) }
)
Expand All @@ -1936,7 +1936,7 @@
context: context.notificationContext
)

// create MLS group and update keying material

Check warning on line 1939 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@sendable' closure

Check warning on line 1939 in wire-ios-data-model/Source/MLS/MLSService.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@sendable' closure
let mlsGroupID = await context.perform { conversation.mlsGroupID }
guard let mlsGroupID else {
logger.warn("failed to convert conversation \(qualifiedID), `mlsGroupID` is `nil`")
Expand Down
46 changes: 39 additions & 7 deletions wire-ios-data-model/Tests/MLS/MLSServiceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@

func test_Decrypt_RepairsConversationOnWrongEpochError() async throws {
// Given
let conversation = await uiMOC.perform { self.createConversation(outOfSync: true).conversation }

Check warning on line 333 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@sendable' closure
guard let groupID = await uiMOC.perform({ conversation.mlsGroupID }) else {
XCTFail("no groupId")
return
Expand All @@ -343,7 +343,7 @@
let expectation = XCTestExpectation(description: "repaired conversation")
await uiMOC.perform {
self.setMocksForConversationRepair(
parentGroupID: groupID,

Check warning on line 346 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@sendable' closure
epoch: conversation.epoch - 1,
onJoinGroup: { joinedGroupID in
XCTAssertEqual(groupID, joinedGroupID)
Expand All @@ -361,7 +361,7 @@
)

// Then
await fulfillment(of: [expectation], timeout: 1)

Check warning on line 364 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Instance method 'waitForAllGroupsToBeEmpty' is unavailable from asynchronous contexts; Don't use wait in async contexts!; this is an error in the Swift 6 language mode

Instance method 'waitForAllGroupsToBeEmpty' is unavailable from asynchronous contexts; Don't use wait in async contexts!; this is an error in the Swift 6 language mode
_ = waitForAllGroupsToBeEmpty(withTimeout: 0.5)
}

Expand Down Expand Up @@ -584,7 +584,7 @@
conversation.mlsStatus = .pendingJoinAfterReset
return conversation
}

Check warning on line 587 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Initialization of immutable value 'mlsSelfUser' was never used; consider replacing with assignment to '_' or removing it

Initialization of immutable value 'mlsSelfUser' was never used; consider replacing with assignment to '_' or removing it
let mlsSelfUser = await uiMOC.perform {
MLSUser(from: self.selfUser, localDomain: self.localDomain)
}
Expand All @@ -611,7 +611,7 @@

// THEN
try XCTAssertCount(mockActionsProvider.syncConversationQualifiedIDContext_Invocations, count: 1)
await uiMOC.perform {

Check warning on line 614 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@sendable' closure

Check warning on line 614 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Implicit capture of 'conversation' requires that 'ZMConversation' conforms to 'Sendable'

Implicit capture of 'conversation' requires that 'ZMConversation' conforms to 'Sendable'
XCTAssertEqual(conversation.mlsStatus, .ready)
}
}
Expand Down Expand Up @@ -788,7 +788,7 @@
let futureCommitDate = Date().addingTimeInterval(2)

await uiMOC.perform { [self] in
// A group with pending proposal in the future

Check warning on line 791 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation?' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation?' in a '@sendable' closure
conversation = createConversation(in: uiMOC)
conversation.mlsGroupID = groupID
conversation.commitPendingProposalDate = futureCommitDate
Expand Down Expand Up @@ -826,7 +826,7 @@
// Then we committed pending proposals.
XCTAssertEqual(mockCommitPendingProposalsArgument, [groupID])

await uiMOC.perform {

Check warning on line 829 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation?' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation?' in a '@sendable' closure
XCTAssertNil(conversation.commitPendingProposalDate)
}

Expand Down Expand Up @@ -944,7 +944,7 @@
let futureCommitDate = Date().addingTimeInterval(2)

await uiMOC.perform { [self] in
// A group with pending proposal in the future

Check warning on line 947 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation?' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation?' in a '@sendable' closure
conversation = createConversation(in: uiMOC)
conversation.mlsGroupID = groupID
conversation.commitPendingProposalDate = futureCommitDate
Expand Down Expand Up @@ -975,7 +975,7 @@
// Then we committed pending proposals.
XCTAssertEqual(mockCommitPendingProposalsArgument, [groupID])

await uiMOC.perform {

Check warning on line 978 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation?' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation?' in a '@sendable' closure
XCTAssertNil(conversation.commitPendingProposalDate)
}

Expand Down Expand Up @@ -1023,7 +1023,35 @@

// MARK: - Joining conversations

func test_PerformPendingJoins_It_Establishes_Group() async throws {
func test_PerformPendingJoins_It_Establishes_Group_SelfConversation() async throws {
try await assert_PerformPendingJoins_It_Establishes_Group(
conversationType: .`self`,
file: #file,
line: #line
)
}

func test_PerformPendingJoins_It_Establishes_Group_OneOnOne() async throws {
try await assert_PerformPendingJoins_It_Establishes_Group(
conversationType: .oneOnOne,
file: #file,
line: #line
)
}

func test_PerformPendingJoins_It_Establishes_Group_Group() async throws {
try await assert_PerformPendingJoins_It_Establishes_Group(
conversationType: .group,
file: #file,
line: #line
)
}

func assert_PerformPendingJoins_It_Establishes_Group(
conversationType: ZMConversationType,
file: StaticString = #file,
line: UInt = #line
) async throws {
// Given
let groupID = MLSGroupID.random()
let conversationID = UUID.create()
Expand All @@ -1033,9 +1061,13 @@
conversation.remoteIdentifier = conversationID
conversation.domain = domain
conversation.mlsGroupID = groupID
conversation.mlsStatus = .pendingJoin
conversation.conversationType = .`self`
conversation.messageProtocol = .mls
conversation.mlsStatus = .pendingJoin
conversation.conversationType = conversationType

// Only epoch 0 leads to establishing group
conversation.epoch = 0

return conversation
}

Expand All @@ -1055,17 +1087,17 @@
// it creates CC conversation
let createCoreCryptoConversationInvocations = mockCoreCryptoContext
.createConversationConversationIdCreatorCredentialTypeConfig_Invocations
XCTAssertEqual(createCoreCryptoConversationInvocations.count, 1)
XCTAssertEqual(createCoreCryptoConversationInvocations.count, 1, file: file, line: line)

// it commits pending proposals
XCTAssertEqual(mockMLSActionExecutor.commitPendingProposalsCount, 1)
XCTAssertEqual(mockMLSActionExecutor.commitPendingProposalsCount, 1, file: file, line: line)

// it updates key material
XCTAssertEqual(mockMLSActionExecutor.updateKeyMaterialCount, 1)
XCTAssertEqual(mockMLSActionExecutor.updateKeyMaterialCount, 1, file: file, line: line)

// it sets conversation state to ready

Check warning on line 1098 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@sendable' closure
let conversationMLSStatus = await uiMOC.perform { conversation.mlsStatus }
XCTAssertEqual(conversationMLSStatus, .ready)
XCTAssertEqual(conversationMLSStatus, .ready, file: file, line: line)
}

func test_PerformPendingJoins_IsSuccessful() async throws {
Expand Down Expand Up @@ -1114,7 +1146,7 @@
XCTAssertEqual(joinGroupArguments.first?.groupID, groupID)
XCTAssertEqual(joinGroupArguments.first?.groupState, publicGroupState)

// it sets conversation state to ready

Check warning on line 1149 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@sendable' closure
let conversationMLSStatus = await uiMOC.perform { conversation.mlsStatus }
XCTAssertEqual(conversationMLSStatus, .ready)
}
Expand Down Expand Up @@ -1180,7 +1212,7 @@
// it asks executor to join group
XCTAssertEqual(joinGroupCount, shouldRetry ? 2 : 1, file: file, line: line)

// it sets conversation state to ready

Check warning on line 1215 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@sendable' closure
let conversationMLSStatus = await uiMOC.perform { conversation.mlsStatus }
XCTAssertEqual(conversationMLSStatus, shouldRetry ? .ready : .pendingJoin, file: file, line: line)
}
Expand Down Expand Up @@ -1266,7 +1298,7 @@

func test_FetchAndRepairConversation_RejoinsOutOfSyncConversation() async throws {
// GIVEN
let conversation = await uiMOC.perform { self.createConversation(outOfSync: true).conversation }

Check warning on line 1301 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@sendable' closure
guard let groupID = await uiMOC.perform({ conversation.mlsGroupID }) else {
XCTFail("missing groupID")
return
Expand All @@ -1277,7 +1309,7 @@

await uiMOC.perform { [self] in
setMocksForConversationRepair(
parentGroupID: groupID,

Check warning on line 1312 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@sendable' closure
epoch: conversation.epoch - 1,
onJoinGroup: { joinedGroupID in
XCTAssertEqual(groupID, joinedGroupID)
Expand All @@ -1297,7 +1329,7 @@

func test_FetchAndRepairConversation_DoesNothingIfConversationIsNotOutOfSync() async throws {
// GIVEN
let conversation = await uiMOC.perform { self.createConversation(outOfSync: true).conversation }

Check warning on line 1332 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@sendable' closure
guard let groupID = await uiMOC.perform({ conversation.mlsGroupID }) else {
XCTFail("missing groupID")
return
Expand All @@ -1310,7 +1342,7 @@

await uiMOC.perform { [self] in
setMocksForConversationRepair(
parentGroupID: groupID,

Check warning on line 1345 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@sendable' closure
epoch: conversation.epoch,
onJoinGroup: { _ in
expectation.fulfill()
Expand All @@ -1327,13 +1359,13 @@

func test_FetchAndRepairConversation_RejoinsOutOfSyncSubgroup() async throws {
// GIVEN
let conversation = await uiMOC.perform { self.createConversation(outOfSync: true).conversation }

Check warning on line 1362 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@sendable' closure
guard let groupID = await uiMOC.perform({ conversation.mlsGroupID }) else {
XCTFail("missing groupID")
return
}
mockSyncDelegate.recoverWithIncrementalSync_MockMethod = {}
let subgroupID = MLSGroupID.random()

Check warning on line 1368 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@sendable' closure
let qualifiedID = await uiMOC.perform { conversation.qualifiedID }

let subgroup = MLSSubgroup(
Expand Down Expand Up @@ -1368,13 +1400,13 @@

func test_FetchAndRepairConversation_DoesNothingIfSubgroupIsNotOutOfSync() async throws {
// GIVEN
let conversation = await uiMOC.perform { self.createConversation(outOfSync: true).conversation }

Check warning on line 1403 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@sendable' closure
guard let groupID = await uiMOC.perform({ conversation.mlsGroupID }) else {
XCTFail("missing groupID")
return
}
mockSyncDelegate.recoverWithIncrementalSync_MockMethod = {}
let subgroupID = MLSGroupID.random()

Check warning on line 1409 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@sendable' closure
let qualifiedID = await uiMOC.perform { conversation.qualifiedID }

let subgroup = MLSSubgroup(
Expand Down Expand Up @@ -2817,7 +2849,7 @@
var conversation: ZMConversation!

await uiMOC.perform { [self] in
// A group with pending proposal in the future

Check warning on line 2852 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation?' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation?' in a '@sendable' closure
conversation = createConversation(in: uiMOC)
conversation.mlsGroupID = groupID
conversation.messageProtocol = .mls
Expand Down Expand Up @@ -2864,7 +2896,7 @@
var conversation: ZMConversation!

await uiMOC.perform { [self] in
// A group with pending proposal in the future

Check warning on line 2899 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation?' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation?' in a '@sendable' closure
conversation = createConversation(in: uiMOC)
conversation.mlsGroupID = groupID
conversation.messageProtocol = .mls
Expand Down Expand Up @@ -2922,7 +2954,7 @@
XCTestExpectation(description: "updateConversationProtocol must be called")
mockActionsProvider
.updateConversationProtocolQualifiedIDMessageProtocolContext_MockMethod =
{ [uiMOC] qualifiedID, messageProtocol, notificationContext in

Check warning on line 2957 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@sendable' closure
XCTAssertEqual(qualifiedID, uiMOC.performAndWait { conversation.qualifiedID })
XCTAssertEqual(messageProtocol, .mixed)
XCTAssert(notificationContext === uiMOC.notificationContext)
Expand All @@ -2930,7 +2962,7 @@
}

let syncConversationExpectation = XCTestExpectation(description: "updateLocalConversation must be called")
mockActionsProvider.syncConversationQualifiedIDContext_MockMethod = { [uiMOC] qualifiedID, _ in

Check warning on line 2965 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@sendable' closure
XCTAssertEqual(qualifiedID, uiMOC.performAndWait { conversation.qualifiedID })
syncConversationExpectation.fulfill()
}
Expand All @@ -2943,7 +2975,7 @@
}

let updateKeyMaterialExpectation = XCTestExpectation(description: "updateKeyMaterial must be called")
mockMLSActionExecutor.mockUpdateKeyMaterial = { [self] mlsGroupID in

Check warning on line 2978 in wire-ios-data-model/Tests/MLS/MLSServiceTests.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@Sendable' closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in a '@sendable' closure
XCTAssertEqual(mlsGroupID, uiMOC.performAndWait { conversation.mlsGroupID })
updateKeyMaterialExpectation.fulfill()
}
Expand Down
Loading