Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8a58ae1
fix: potential race condition - WPB-21441
caldrian Dec 3, 2025
7c658d7
create isApp, isBot, isAppOrBot
caldrian Dec 3, 2025
a32c61c
fix build errors in Wire-iOS
caldrian Dec 3, 2025
33ab6b6
fix error
caldrian Dec 3, 2025
86e95a5
revert renaming
caldrian Dec 3, 2025
291ff43
fix property names
caldrian Dec 4, 2025
6234722
add missing argument
caldrian Dec 4, 2025
9b55828
rename protocol
caldrian Dec 4, 2025
deabb1e
revert changes
caldrian Dec 4, 2025
b2d6409
Merge branch 'develop' into fix/potential-race-condition-WPB-21441
caldrian Dec 4, 2025
5a90951
Merge branch 'fix/potential-race-condition-WPB-21441' into chore/sepa…
caldrian Dec 4, 2025
4f2fd2d
Merge remote-tracking branch 'github/gh-readonly-queue/develop/pr-396…
caldrian Dec 4, 2025
b2230d5
Merge branch 'fix/potential-race-condition-WPB-21441' into chore/sepa…
caldrian Dec 4, 2025
59edd7c
fixes
caldrian Dec 4, 2025
bdb435e
minor change
caldrian Dec 4, 2025
bab57b6
rename protocol
caldrian Dec 4, 2025
a67301a
fix condition
caldrian Dec 4, 2025
9340106
Merge branch 'release/cycle-4.12' into chore/separate-isapp-isbot-WPB…
caldrian Dec 5, 2025
edb5c09
Trigger CI
caldrian Dec 8, 2025
f92bcd5
fix: add missing developer flag check - WPB-22238 (#3987)
samwyndham Dec 8, 2025
82076c5
fix typo
caldrian Dec 8, 2025
5f4aba5
Merge branch 'release/cycle-4.12' of github.com:wireapp/wire-ios into…
caldrian Dec 10, 2025
cf7e241
chore: separate user properties isApp and isBot - WPB-21441
caldrian Dec 10, 2025
104ec35
Merge branch 'chore/separate-isapp-isbot-WPB-21441' of github.com:wir…
caldrian Dec 10, 2025
375a366
chore: separate user properties isApp and isBot - WPB-21441
caldrian Dec 10, 2025
4b0b73d
Merge branch 'chore/separate-isapp-isbot-WPB-21441' of github.com:wir…
caldrian Dec 10, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import CoreData
import GenericMessageProtocol
import WireCryptobox

Check warning on line 21 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'WireDataModel'

Add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'WireDataModel'
import WireDataModel
import WireLogging

Expand Down Expand Up @@ -71,7 +71,7 @@

return await context.perform { [context] in
ZMOTRMessage.fetch(
withNonce: id,

Check warning on line 74 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.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
for: conversation,
in: context
)
Expand All @@ -86,7 +86,7 @@
ZMUser.selfUser(in: context)
}

return await context.perform {

Check warning on line 89 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'selfUser' with non-Sendable type 'ZMUser' in a '@Sendable' closure

Capture of 'selfUser' with non-Sendable type 'ZMUser' in a '@sendable' closure

Check warning on line 89 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'selfUser' with non-Sendable type 'ZMUser' in an isolated closure

Capture of 'selfUser' with non-Sendable type 'ZMUser' in an isolated closure
text.mentions.any { $0.userID.uppercased() == selfUser.remoteIdentifier.uuidString }
}
}
Expand All @@ -94,7 +94,7 @@
public func isMessageQuotingSelf(
quotedMessage: ZMOTRMessage?
) async -> Bool {
await context.perform {

Check warning on line 97 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'quotedMessage' with non-Sendable type 'ZMOTRMessage?' in a '@Sendable' closure

Capture of 'quotedMessage' with non-Sendable type 'ZMOTRMessage?' in a '@sendable' closure
quotedMessage?.sender?.isSelfUser ?? false
}
}
Expand Down Expand Up @@ -150,8 +150,8 @@
ZMUser.selfUser(in: context)
}

return await context.perform {

Check warning on line 153 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.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 153 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'selfUser' with non-Sendable type 'ZMUser' in a '@Sendable' closure

Capture of 'selfUser' with non-Sendable type 'ZMUser' in a '@sendable' closure

Check warning on line 153 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Implicit capture of 'selfUser' requires that 'ZMUser' conforms to 'Sendable'

Implicit capture of 'selfUser' requires that 'ZMUser' conforms to 'Sendable'
let isSelf = conversation.isSelfConversation && senderID != selfUser.remoteIdentifier

Check warning on line 154 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.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'
return !isSelf && !conversation.isForcedReadOnly
}
}
Expand Down Expand Up @@ -200,13 +200,13 @@
) async {
await context.perform { [self] in
if isNewMessage {
do {

Check warning on line 203 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'clientMessage' with non-Sendable type 'ZMClientMessage' in a '@Sendable' closure

Capture of 'clientMessage' with non-Sendable type 'ZMClientMessage' in a '@sendable' closure
try clientMessage.setUnderlyingMessage(genericMessage)
clientMessage.updateNormalizedText()
} catch {
assertionFailure("Failed to set generic message: \(error.localizedDescription)")
}
} else {

Check warning on line 209 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'self' with non-Sendable type 'MessageLocalStore' in a '@Sendable' closure

Capture of 'self' with non-Sendable type 'MessageLocalStore' in a '@sendable' closure
applyLinkPreviewUpdate(
clientMessage: clientMessage,
updatedMessage: genericMessage,
Expand All @@ -217,7 +217,7 @@
finalizeMessageUpdate(
message: clientMessage,
senderID: senderID,
senderDomain: senderDomain,

Check warning on line 220 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.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: conversation
)
}
Expand All @@ -232,7 +232,7 @@
senderDomain: String
) async {
await context.perform { [self] in
do {

Check warning on line 235 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'assetClientMessage' with non-Sendable type 'ZMAssetClientMessage' in a '@Sendable' closure

Capture of 'assetClientMessage' with non-Sendable type 'ZMAssetClientMessage' in a '@sendable' closure
try assetClientMessage.setUnderlyingMessage(genericMessage)
} catch {
return assertionFailure(
Expand All @@ -242,7 +242,7 @@

// We assume received assets are V3 since backend no longer supports sending V2 assets.
assetClientMessage.version = 3

Check warning on line 245 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'self' with non-Sendable type 'MessageLocalStore' in a '@Sendable' closure

Capture of 'self' with non-Sendable type 'MessageLocalStore' in a '@sendable' closure
assetTransferStateResolver.resolveTransferState(
assetMessage: assetClientMessage,
genericMessage: genericMessage,
Expand All @@ -252,7 +252,7 @@
finalizeMessageUpdate(
message: assetClientMessage,
senderID: senderID,
senderDomain: senderDomain,

Check warning on line 255 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.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: conversation
)
}
Expand All @@ -270,7 +270,7 @@
await context.perform { [self] in
guard let conversation = ZMConversation.fetch(
with: conversationID,
domain: conversationDomain,

Check warning on line 273 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'self' with non-Sendable type 'MessageLocalStore' in a '@Sendable' closure

Capture of 'self' with non-Sendable type 'MessageLocalStore' in a '@sendable' closure
in: context
) else { return }

Expand All @@ -294,7 +294,7 @@
_ hiddenMessage: MessageHide,
in conversation: ZMConversation
) async {
await context.perform { [context] in

Check warning on line 297 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.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 conversation.isSelfConversation else {
return
}
Expand All @@ -313,7 +313,7 @@
) async {
await context.perform { [context] in
ZMMessage.remove(
remotelyDeletedMessage: deletedMessage,

Check warning on line 316 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.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
inConversation: conversation,
senderID: senderID,
inContext: context
Expand All @@ -330,7 +330,7 @@
await context.perform { [context] in
ZMMessage.add(
reaction: messageReaction,
senderID: senderID,

Check warning on line 333 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.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: conversation,
creationDate: date,
inContext: context
Expand All @@ -347,7 +347,7 @@
) async {
await context.perform {
_ = ZMMessageConfirmation.createMessageConfirmations(
confirmation,

Check warning on line 350 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.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: conversation,
senderUUID: senderID,
senderDomain: senderDomain,
Expand All @@ -369,7 +369,7 @@

ZMClientMessage.updateButtonStates(
buttonID: buttonID,
referenceMessageID: referenceMessageID,

Check warning on line 372 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.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
for: conversation,
in: context
)
Expand All @@ -391,8 +391,8 @@

await context.perform { [self] in
guard let editedClientMessage = ZMClientMessage.fetch(
withNonce: editedMessageID,

Check warning on line 394 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.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
for: conversation,

Check warning on line 395 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'self' with non-Sendable type 'MessageLocalStore' in a '@Sendable' closure

Capture of 'self' with non-Sendable type 'MessageLocalStore' in a '@sendable' closure
in: context
) else {
return
Expand Down Expand Up @@ -423,7 +423,7 @@
date: Date
) async throws -> (ZMOTRMessage, isNew: Bool) {
try await context.perform { [self] in

Check warning on line 426 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.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
if let clearedTime = conversation.clearedTimeStamp, clearedTime.compare(date) != .orderedAscending {
throw Failure.invalidInsertion(reason: "message is older than cleared time")
}
Expand All @@ -439,7 +439,7 @@
let clientMessage = messageType == .asset ?
ZMAssetClientMessage.fetch(
withNonce: nonce,
for: conversation,

Check warning on line 442 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'self' with non-Sendable type 'MessageLocalStore' in a '@Sendable' closure

Capture of 'self' with non-Sendable type 'MessageLocalStore' in a '@sendable' closure
in: context
) :
ZMClientMessage.fetch(
Expand Down Expand Up @@ -532,7 +532,7 @@
case let .participantsRemovedAnonymously(participants, date):

let removedUsers = await context.perform {
participants.compactMap { id, domain in

Check warning on line 535 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.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 535 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in an isolated closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in an isolated closure
let existing = conversation.localParticipants

return existing.first(where: {
Expand All @@ -556,7 +556,7 @@
case let .participantsRemoved(participants, sender, date):

let removedUsers = await context.perform {
participants.compactMap { id, domain in

Check warning on line 559 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.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 559 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'conversation' with non-Sendable type 'ZMConversation' in an isolated closure

Capture of 'conversation' with non-Sendable type 'ZMConversation' in an isolated closure
let existing = conversation.localParticipants

return existing.first(where: {
Expand Down Expand Up @@ -658,7 +658,7 @@
let selfUser = await fetchSelfUser()

let (creator, localParticipants, userDefinedName) = await context.perform {
(

Check warning on line 661 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.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.creator,
conversation.localParticipants,
conversation.userDefinedName
Expand All @@ -672,22 +672,22 @@
timestamp: date
)

await context.perform {

Check warning on line 675 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'newConversationMessage' with non-Sendable type 'ZMSystemMessage' in a '@Sendable' closure

Capture of 'newConversationMessage' with non-Sendable type 'ZMSystemMessage' in a '@sendable' closure
newConversationMessage.text = userDefinedName

Check warning on line 677 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'selfUser' with non-Sendable type 'ZMUser' in a '@Sendable' closure

Capture of 'selfUser' with non-Sendable type 'ZMUser' in a '@sendable' closure
guard let selfUserTeam = selfUser.team,

Check warning on line 678 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.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.team == selfUserTeam else { return }

let members = selfUserTeam.members.compactMap(\.user)

Check warning on line 681 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'localParticipants' with non-Sendable type 'Set<ZMUser>' in a '@Sendable' closure

Capture of 'localParticipants' with non-Sendable type 'Set<ZMUser>' in a '@sendable' closure
let guests = localParticipants.filter {
!$0.isApp && $0.membership == nil
!$0.isAppOrBot && $0.membership == nil
}

newConversationMessage.allTeamUsersAdded = localParticipants.isSuperset(of: members)
newConversationMessage.numberOfGuestsAdded = Int16(guests.count)
}

let hasReadReceiptsEnabled = await context.perform {

Check warning on line 690 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.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.hasReadReceiptsEnabled
}

Expand Down Expand Up @@ -738,11 +738,11 @@
timestamp: date
)

let previousLastMessage = await context.perform {

Check warning on line 741 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.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.lastMessage
}

await context.perform { [context] in

Check warning on line 745 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'previousLastMessage' with non-Sendable type '(any ZMConversationMessage)?' in a '@Sendable' closure

Capture of 'previousLastMessage' with non-Sendable type '(any ZMConversationMessage)?' in a '@sendable' closure
let lastMessage = previousLastMessage as? ZMSystemMessage
let isPotentialGapMigration = lastMessage?.systemMessageType == .mlsMigrationPotentialGap
let lastMessageTimestamp = lastMessage?.serverTimestamp
Expand Down Expand Up @@ -775,7 +775,7 @@

case let .receiptModeIsOn(date):

let creator = await context.perform {

Check warning on line 778 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.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.creator
}

Expand Down Expand Up @@ -827,7 +827,7 @@
return []
}

let senderClient = await context.perform {

Check warning on line 830 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'sender' with non-Sendable type 'ZMUser' in a '@Sendable' closure

Capture of 'sender' with non-Sendable type 'ZMUser' in a '@sendable' closure
sender.clients.first(where: {
$0.remoteIdentifier == senderClientID
})
Expand Down Expand Up @@ -858,7 +858,7 @@

let client = await context.perform {
UserClient.fetchUserClient(
withRemoteId: senderClientID,

Check warning on line 861 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'sender' with non-Sendable type 'ZMUser' in a '@Sendable' closure

Capture of 'sender' with non-Sendable type 'ZMUser' in a '@sendable' closure
forUser: sender,
createIfNeeded: true
)
Expand Down Expand Up @@ -910,8 +910,8 @@
timestamp: date
)

await context.perform {

Check warning on line 913 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'systemMessage' with non-Sendable type 'ZMSystemMessage' in a '@Sendable' closure

Capture of 'systemMessage' with non-Sendable type 'ZMSystemMessage' in a '@sendable' closure
systemMessage.text = newName

Check warning on line 914 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.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
systemMessage.visibleInConversation = conversation
conversation.updateTimestampsAfterUpdatingMessage(systemMessage)
}
Expand All @@ -932,7 +932,7 @@
timestamp: date
)

await context.perform {

Check warning on line 935 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.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 isArchived = conversation.isArchived
let mutedMessageTypes = conversation.mutedMessageTypes

Expand Down Expand Up @@ -976,10 +976,10 @@
) async -> ZMSystemMessage {
await context.perform { [context] in
let systemMessage = ZMSystemMessage(nonce: UUID(), managedObjectContext: context)
systemMessage.systemMessageType = messageType

Check warning on line 979 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'sender' with non-Sendable type 'ZMUser' in a '@Sendable' closure

Capture of 'sender' with non-Sendable type 'ZMUser' in a '@sendable' closure
systemMessage.sender = sender

Check warning on line 980 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'users' with non-Sendable type 'Set<ZMUser>?' in a '@Sendable' closure

Capture of 'users' with non-Sendable type 'Set<ZMUser>?' in a '@sendable' closure
systemMessage.users = users ?? Set()

Check warning on line 981 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'addedUsers' with non-Sendable type 'Set<ZMUser>' in a '@Sendable' closure

Capture of 'addedUsers' with non-Sendable type 'Set<ZMUser>' in a '@sendable' closure
systemMessage.addedUsers = addedUsers

Check warning on line 982 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'clients' with non-Sendable type 'Set<UserClient>?' in a '@Sendable' closure

Capture of 'clients' with non-Sendable type 'Set<UserClient>?' in a '@sendable' closure
systemMessage.clients = clients ?? Set()
systemMessage.serverTimestamp = timestamp
systemMessage.text = text
Expand All @@ -1004,8 +1004,8 @@
_ messages: Set<ZMSystemMessage>,
to conversation: ZMConversation
) async {
await context.perform {

Check warning on line 1007 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'messages' with non-Sendable type 'Set<ZMSystemMessage>' in a '@Sendable' closure

Capture of 'messages' with non-Sendable type 'Set<ZMSystemMessage>' in a '@sendable' closure
for message in messages {

Check warning on line 1008 in WireDomain/Sources/WireDomain/Repositories/Message/MessageLocalStore.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.append(message)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
}
}

@objc
@objc(ZMContextProvider)
public protocol ContextProvider {

var account: Account { get }
Expand Down Expand Up @@ -114,8 +114,8 @@

}

@objcMembers
public class CoreDataStack: NSObject, CoreDataStackProtocol {
@objc @objcMembers
public class CoreDataStack: NSObject, CoreDataStackProtocol, ContextProvider {

public let account: Account

Expand Down Expand Up @@ -369,7 +369,7 @@

func configureViewContext(_ context: NSManagedObjectContext) async {
context.markAsUIContext()
await context.perform {

Check warning on line 372 in wire-ios-data-model/Source/ManagedObjectContext/CoreDataStack.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'self' with non-Sendable type 'CoreDataStack' in a '@Sendable' closure

Capture of 'self' with non-Sendable type 'CoreDataStack' in a '@sendable' closure
context.localDomain = self.localDomain
context.isFederationEnabled = self.isFederationEnabled
context.createDispatchGroups()
Expand All @@ -381,17 +381,17 @@
}

func configureContextReferences() async {
await viewContext.perform {

Check warning on line 384 in wire-ios-data-model/Source/ManagedObjectContext/CoreDataStack.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'self' with non-Sendable type 'CoreDataStack' in a '@Sendable' closure

Capture of 'self' with non-Sendable type 'CoreDataStack' in a '@sendable' closure
self.viewContext.zm_sync = self.syncContext
}
await syncContext.perform {

Check warning on line 387 in wire-ios-data-model/Source/ManagedObjectContext/CoreDataStack.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'self' with non-Sendable type 'CoreDataStack' in a '@Sendable' closure

Capture of 'self' with non-Sendable type 'CoreDataStack' in a '@sendable' closure
self.syncContext.zm_userInterface = self.viewContext
}
}

func configureSyncContext(_ context: NSManagedObjectContext) async {
context.markAsSyncContext()
await context.perform {

Check warning on line 394 in wire-ios-data-model/Source/ManagedObjectContext/CoreDataStack.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'self' with non-Sendable type 'CoreDataStack' in a '@Sendable' closure

Capture of 'self' with non-Sendable type 'CoreDataStack' in a '@sendable' closure
context.localDomain = self.localDomain
context.isFederationEnabled = self.isFederationEnabled
context.createDispatchGroups()
Expand All @@ -417,7 +417,7 @@

func configureSearchContext(_ context: NSManagedObjectContext) async {
context.markAsSearch()
await context.perform {

Check warning on line 420 in wire-ios-data-model/Source/ManagedObjectContext/CoreDataStack.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'self' with non-Sendable type 'CoreDataStack' in a '@Sendable' closure

Capture of 'self' with non-Sendable type 'CoreDataStack' in a '@sendable' closure
context.localDomain = self.localDomain
context.isFederationEnabled = self.isFederationEnabled
context.createDispatchGroups()
Expand All @@ -430,7 +430,7 @@

func configureEventContext(_ context: NSManagedObjectContext) async {
await context.perform {
context.createDispatchGroups()

Check warning on line 433 in wire-ios-data-model/Source/ManagedObjectContext/CoreDataStack.swift

View workflow job for this annotation

GitHub Actions / Test Results

Capture of 'self' with non-Sendable type 'CoreDataStack' in a '@Sendable' closure

Capture of 'self' with non-Sendable type 'CoreDataStack' in a '@sendable' closure
self.dispatchGroup.map(context.addGroup(_:))
}
}
Expand Down Expand Up @@ -559,7 +559,7 @@
}

// MARK: -

Check warning on line 562 in wire-ios-data-model/Source/ManagedObjectContext/CoreDataStack.swift

View workflow job for this annotation

GitHub Actions / Test Results

Class 'PersistentContainer' must restate inherited '@unchecked Sendable' conformance

Class 'PersistentContainer' must restate inherited '@unchecked Sendable' conformance
public class PersistentContainer: NSPersistentContainer {

var storeURL: URL? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ extension ZMConversation: ConversationLike {

public var sortedOtherParticipants: [UserType] {
localParticipants
.filter { !$0.isApp }
.filter { !$0.isAppOrBot }
.sortedAscendingPrependingNil(by: \.name)
}

public var sortedApps: [UserType] {
localParticipants
.filter(\.isApp)
.filter(\.isAppOrBot)
.sortedAscendingPrependingNil(by: \.name)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public extension ZMConversation {
internal class func keyPathsForValuesAffectingExternalParticipantsState() -> Set<String> {
[
"participantRoles.user.isApp",
"participantRoles.user.isBot",
"participantRoles.user.hasTeam",
"participantRoles.user.isExternalPartner"
]
Expand All @@ -63,7 +64,7 @@ public extension ZMConversation {
let selfUser = ZMUser.selfUser(in: managedObjectContext!)
let otherUsers = participants.subtracting([selfUser])

if otherUsers.count == 1, otherUsers.first!.isApp {
if otherUsers.count == 1, otherUsers.first!.isAppOrBot {
return []
}

Expand All @@ -75,7 +76,7 @@ public extension ZMConversation {
for user in otherUsers {
if canDisplayGuests, user.isFederated {
state.insert(.visibleRemotes)
} else if user.isApp {
} else if user.isAppOrBot {
state.insert(.visibleApps)
} else if canDisplayExternals, user.isExternalPartner {
state.insert(.visibleExternals)
Expand All @@ -98,7 +99,7 @@ public extension ZMConversation {
/// Returns whether apps are present, regardless of the display rules.

var areAppsPresent: Bool {
localParticipants.any(\.isApp)
localParticipants.any(\.isAppOrBot)
}

/// Returns whether guests are present, regardless of the display rules.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public extension ZMConversation {
team == selfUserTeam {

let members = selfUserTeam.members.compactMap(\.user)
let guests = users.filter { !$0.isApp && $0.membership == nil }
let guests = users.filter { !$0.isAppOrBot && $0.membership == nil }

systemMessage.allTeamUsersAdded = users.isSuperset(of: members)
systemMessage.numberOfGuestsAdded = Int16(guests.count)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
@property (nonatomic) ZMConversationSecurityLevel securityLevel;
@end


Check warning on line 150 in wire-ios-data-model/Source/Model/Conversation/ZMConversation.m

View workflow job for this annotation

GitHub Actions / Test Results

Property 'sortedActiveParticipants' requires method 'sortedActiveParticipants' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation

Property 'sortedActiveParticipants' requires method 'sortedActiveParticipants' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation

Check warning on line 150 in wire-ios-data-model/Source/Model/Conversation/ZMConversation.m

View workflow job for this annotation

GitHub Actions / Test Results

Property 'isPendingMetadataRefresh' requires method 'isPendingMetadataRefresh' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation

Property 'isPendingMetadataRefresh' requires method 'isPendingMetadataRefresh' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation

Check warning on line 150 in wire-ios-data-model/Source/Model/Conversation/ZMConversation.m

View workflow job for this annotation

GitHub Actions / Test Results

Property 'isPendingMetadataRefresh' requires method 'setIsPendingMetadataRefresh:' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation

Property 'isPendingMetadataRefresh' requires method 'setIsPendingMetadataRefresh:' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation

Check warning on line 150 in wire-ios-data-model/Source/Model/Conversation/ZMConversation.m

View workflow job for this annotation

GitHub Actions / Test Results

Property 'isPendingInitialFetch' requires method 'isPendingInitialFetch' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation

Property 'isPendingInitialFetch' requires method 'isPendingInitialFetch' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation

Check warning on line 150 in wire-ios-data-model/Source/Model/Conversation/ZMConversation.m

View workflow job for this annotation

GitHub Actions / Test Results

Property 'isPendingInitialFetch' requires method 'setIsPendingInitialFetch:' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation

Property 'isPendingInitialFetch' requires method 'setIsPendingInitialFetch:' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation
@implementation ZMConversation

@dynamic userDefinedName;
Expand Down Expand Up @@ -393,7 +393,7 @@
return [NSSet setWithObjects:ZMConversationConversationTypeKey, ZMConversationParticipantRolesKey, ZMConversationIsForcedReadOnlyKey, nil];
}

+ (instancetype)existingOneOnOneConversationWithUser:(ZMUser *)otherUser inUserSession:(id<ContextProvider>)session;
+ (instancetype)existingOneOnOneConversationWithUser:(ZMUser *)otherUser inUserSession:(id<ZMContextProvider>)session;
{
NOT_USED(session);
return otherUser.oneOnOneConversation;
Expand Down
9 changes: 5 additions & 4 deletions wire-ios-data-model/Source/Model/User/ServiceUser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@
// along with this program. If not, see http://www.gnu.org/licenses/.
//

import Foundation

@objc
public protocol ServiceUser: AnyObject, UserType {
public protocol Bot: AnyObject, UserType {
var providerIdentifier: String? { get }
var serviceIdentifier: String? { get }
}

@objc
public protocol SearchServiceUser: ServiceUser {
public protocol BotSearchResult: Bot {
var summary: String? { get }
}

public typealias ServiceUser = Bot
public typealias SearchServiceUser = BotSearchResult

extension ZMUser {
static let servicesMustBeMentioned = false
static let serviceMentionKeyword = "@bots"
Expand Down
8 changes: 3 additions & 5 deletions wire-ios-data-model/Source/Model/User/Set+ServiceUser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@
// along with this program. If not, see http://www.gnu.org/licenses/.
//

import Foundation

extension Set<ZMUser> {

var apps: Set<ZMUser> {
filter(\.isApp)
var appsOrBots: Set<ZMUser> {
filter(\.isAppOrBot)
}

func categorizeServicesAndUser() -> (services: Set<ZMUser>, users: Set<ZMUser>) {
let services = apps
let services = appsOrBots
let users = subtracting(services)
return (services, users)
}
Expand Down
8 changes: 7 additions & 1 deletion wire-ios-data-model/Source/Model/User/UserType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,16 @@ public protocol UserType: NSObjectProtocol, UserConnections {
/// The role (and permissions) e.g. partner, member, admin, owner
var teamRole: TeamRole { get }

/// Whether this is an app/bot/service user.
/// Whether this is an app (new-style MLS service).

var isApp: Bool { get }

/// Whether this is a bot (old-style service).

var isBot: Bool { get }

var isAppOrBot: Bool { get }

/// Whether this uses uses SSO.
var usesCompanyLogin: Bool { get }

Expand Down
13 changes: 10 additions & 3 deletions wire-ios-data-model/Source/Model/User/ZMSearchUser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ extension ZMSearchUser: SearchServiceUser {

@objc
public class ZMSearchUser: NSObject, UserType {

public var providerIdentifier: String?
public var summary: String?
public var assetKeys: SearchUserAssetKeys?
Expand Down Expand Up @@ -209,9 +210,15 @@ public class ZMSearchUser: NSObject, UserType {
}

public var isApp: Bool {
providerIdentifier != nil
false // Apps (new-style services) don't use ZMSearchUser
}

public var isBot: Bool {
providerIdentifier?.isEmpty == false
}

public var isAppOrBot: Bool { isBot }

public var usesCompanyLogin: Bool {
user?.usesCompanyLogin == true
}
Expand Down Expand Up @@ -474,7 +481,7 @@ public class ZMSearchUser: NSObject, UserType {
}

@objc
public init(
public required init(
contextProvider: ContextProvider,
name: String,
handle: String?,
Expand Down Expand Up @@ -650,7 +657,7 @@ public class ZMSearchUser: NSObject, UserType {
}

@objc public var canBeConnected: Bool {
guard !isApp else { return false }
guard !isAppOrBot else { return false }

if let user {
return user.canBeConnected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public extension ZMUser {
return false
}

return !isApp // Bots are never guests
return !isAppOrBot // Apps or bots are never guests
&& !isFederated // Federated users are never guests
&& ZMUser.selfUser(in: context).hasTeam // There can't be guests in a team that doesn't exist
&& conversation.localParticipantsContain(user: self)
Expand Down
14 changes: 12 additions & 2 deletions wire-ios-data-model/Source/Model/User/ZMUser.m
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
@end



Check warning on line 158 in wire-ios-data-model/Source/Model/User/ZMUser.m

View workflow job for this annotation

GitHub Actions / Test Results

Property 'connectionRequestMessage' requires method 'connectionRequestMessage' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation

Property 'connectionRequestMessage' requires method 'connectionRequestMessage' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation

Check warning on line 158 in wire-ios-data-model/Source/Model/User/ZMUser.m

View workflow job for this annotation

GitHub Actions / Test Results

Property 'isPendingMetadataRefresh' requires method 'isPendingMetadataRefresh' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation

Property 'isPendingMetadataRefresh' requires method 'isPendingMetadataRefresh' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation

Check warning on line 158 in wire-ios-data-model/Source/Model/User/ZMUser.m

View workflow job for this annotation

GitHub Actions / Test Results

Property 'isPendingMetadataRefresh' requires method 'setIsPendingMetadataRefresh:' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation

Property 'isPendingMetadataRefresh' requires method 'setIsPendingMetadataRefresh:' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation
@implementation ZMUser

+ (NSSet<NSString *> *)keyPathsForValuesAffectingIsApp
Expand All @@ -163,6 +163,16 @@
return [NSSet setWithObjects:TypeKey, nil];
}

+ (NSSet<NSString *> *)keyPathsForValuesAffectingIsBot
{
return [NSSet setWithObjects:TypeKey, nil];
}

+ (NSSet<NSString *> *)keyPathsForValuesAffectingIsAppOrBot
{
return [NSSet setWithObjects:TypeKey, nil];
}

- (BOOL)isSelfUser
{
if ([self isZombieObject]) {
Expand Down Expand Up @@ -239,7 +249,7 @@

- (BOOL)canBeConnected;
{
if (self.isApp || self.isWirelessUser) {
if (self.isAppOrBot || self.isWirelessUser) {
return NO;
}
return ! self.isConnected && ! self.isPendingApprovalByOtherUser;
Expand Down Expand Up @@ -710,7 +720,7 @@

@implementation ZMUser (Utilities)

+ (ZMUser<ZMEditableUserType> *)selfUserInUserSession:(id<ContextProvider>)session
+ (ZMUser<ZMEditableUserType> *)selfUserInUserSession:(id<ZMContextProvider>)session
{
VerifyReturnNil(session != nil);
return [self selfUserInContext:session.viewContext];
Expand Down
10 changes: 9 additions & 1 deletion wire-ios-data-model/Source/Model/User/ZMUser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,15 @@
}

@objc public var isApp: Bool {
type == .app || type == .bot
type == .app
}

@objc public var isBot: Bool {
type == .bot
}

@objc public var isAppOrBot: Bool {
isApp || isBot
}

public var teamName: String? {
Expand Down Expand Up @@ -528,7 +536,7 @@
Set(participantRoles.compactMap(\.conversation))
}
}

Check warning on line 539 in wire-ios-data-model/Source/Model/User/ZMUser.swift

View workflow job for this annotation

GitHub Actions / Test Results

Extension declares a conformance of imported type 'NSManagedObject' to imported protocol 'SafeForLoggingStringConvertible'; this will not behave correctly if the owners of 'CoreData' introduce this conformance in the future

Extension declares a conformance of imported type 'NSManagedObject' to imported protocol 'SafeForLoggingStringConvertible'; this will not behave correctly if the owners of 'CoreData' introduce this conformance in the future
extension NSManagedObject: SafeForLoggingStringConvertible {
public var safeForLoggingDescription: String {
let moc: String = managedObjectContext?.description ?? "nil"
Expand Down
4 changes: 2 additions & 2 deletions wire-ios-data-model/Source/Model/ZMManagedObject.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ @interface ZMManagedObject ()

@implementation ZMManagedObject

+ (NSManagedObjectID *)objectIDForURIRepresentation:(NSURL *)url inUserSession:(id<ContextProvider>)userSession
+ (NSManagedObjectID *)objectIDForURIRepresentation:(NSURL *)url inUserSession:(id<ZMContextProvider>)userSession
{
VerifyReturnNil(url != nil);
VerifyReturnNil(userSession != nil);
Expand All @@ -56,7 +56,7 @@ + (NSManagedObjectID *)objectIDForURIRepresentation:(NSURL *)url inManagedObject
return [psc managedObjectIDForURIRepresentation:url];
}

+ (instancetype)existingObjectWithID:(NSManagedObjectID *)identifier inUserSession:(id<ContextProvider>)userSession;
+ (instancetype)existingObjectWithID:(NSManagedObjectID *)identifier inUserSession:(id<ZMContextProvider>)userSession;
{
VerifyReturnNil(identifier);
VerifyReturnNil(userSession);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ extension ZMUser: ObjectInSnapshot {
#keyPath(ZMUser.readReceiptsEnabledChangedRemotely),
ZMUserKeys.RichProfile,
#keyPath(ZMUser.isApp),
#keyPath(ZMUser.isBot),
#keyPath(ZMUser.serviceIdentifier),
#keyPath(ZMUser.providerIdentifier),
ZMUserKeys.legalHoldRequest,
Expand Down
2 changes: 1 addition & 1 deletion wire-ios-data-model/Source/Public/ZMConversation.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ typedef NS_ENUM(int16_t, ZMConversationListIndicator) {
- (void)markAsUnread;

/// If that conversation exists, it is returned, @c nil otherwise.
+ (nullable instancetype)existingOneOnOneConversationWithUser:(nonnull ZMUser *)otherUser inUserSession:(nonnull id<ContextProvider> )session;
+ (nullable instancetype)existingOneOnOneConversationWithUser:(nonnull ZMUser *)otherUser inUserSession:(nonnull id<ZMContextProvider> )session;

@end

Expand Down
6 changes: 3 additions & 3 deletions wire-ios-data-model/Source/Public/ZMManagedObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@

extern NSString * _Nonnull const ZMDataPropertySuffix;

@protocol ContextProvider;
@protocol ZMContextProvider;

@interface ZMManagedObject : NSManagedObject

@property (nonatomic, readonly) BOOL isZombieObject;

+ (nullable NSManagedObjectID *)objectIDForURIRepresentation:(nullable NSURL *)url inUserSession:(nullable id<ContextProvider>)userSession;
+ (nullable NSManagedObjectID *)objectIDForURIRepresentation:(nullable NSURL *)url inUserSession:(nullable id<ZMContextProvider>)userSession;
+ (nullable NSManagedObjectID *)objectIDForURIRepresentation:(nullable NSURL *)url inManagedObjectContext:(nullable NSManagedObjectContext *)context;
+ (nullable instancetype)existingObjectWithID:(nullable NSManagedObjectID *)identifier inUserSession:(nullable id<ContextProvider>)userSession;
+ (nullable instancetype)existingObjectWithID:(nullable NSManagedObjectID *)identifier inUserSession:(nullable id<ZMContextProvider>)userSession;
+ (nullable instancetype)existingObjectWithObjectIdentifier:(nullable NSString *)identifier inManagedObjectContext:(nullable NSManagedObjectContext *)context;

- (nullable NSString *)objectIDURLString;
Expand Down
2 changes: 1 addition & 1 deletion wire-ios-data-model/Source/Public/ZMUser.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ typedef NS_ENUM(int16_t, ZMBlockState) {

@interface ZMUser (Utilities)

+ (ZMUser<ZMEditableUserType> *_Nonnull)selfUserInUserSession:(id<ContextProvider> _Nonnull)session;
+ (ZMUser<ZMEditableUserType> *_Nonnull)selfUserInUserSession:(id<ZMContextProvider> _Nonnull)session;

@end

Expand Down
2 changes: 1 addition & 1 deletion wire-ios-data-model/Tests/Source/Model/TeamTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ final class TeamTests: ZMConversationTestsBase {
let guest = ZMUser.insertNewObject(in: uiMOC)
let bot = ZMUser.insertNewObject(in: uiMOC)
bot.type = .bot
XCTAssert(bot.isApp)
XCTAssert(bot.isAppOrBot)
guard let conversation = ZMConversation.insertGroupConversation(
moc: uiMOC,
participants: [guest, bot],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ final class ZMSearchUserPayloadParsingTests: ZMBaseManagedObjectTest {
XCTAssertEqual(user.domain, domain)
XCTAssertEqual(user.remoteIdentifier, uuid)
XCTAssertEqual(user.zmAccentColor?.rawValue, 5)
XCTAssertFalse(user.isApp)
XCTAssertFalse(user.isAppOrBot)
XCTAssertTrue(user.canBeConnected)
}

Expand All @@ -88,7 +88,7 @@ final class ZMSearchUserPayloadParsingTests: ZMBaseManagedObjectTest {
)!

// then
XCTAssertTrue(user.isApp)
XCTAssertTrue(user.isAppOrBot)
XCTAssertEqual(user.summary, "Short summary")
XCTAssertEqual(user.providerIdentifier, provider.transportString())
XCTAssertEqual(user.serviceIdentifier, uuid.transportString())
Expand Down
2 changes: 1 addition & 1 deletion wire-ios-data-model/Tests/Source/Model/User/ZMUserTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -1927,7 +1927,7 @@ - (void)testThatItReturnsCorrectUserNameForService
user.name = @"User Name";
[user setValue:@(ZMTypeOfUserBot) forKey:@"typeValue"];

XCTAssertTrue(user.isApp);
XCTAssertTrue(user.isAppOrBot);
XCTAssertEqualObjects(user.name, @"User Name");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

@interface ZMSyncStrategy : NSObject <TearDownCapable, RequestStrategy>

- (instancetype _Nonnull )initWithContextProvider:(id<ContextProvider> _Nonnull)contextProvider
- (instancetype _Nonnull )initWithContextProvider:(id<ZMContextProvider> _Nonnull)contextProvider
notificationsDispatcher:(NotificationDispatcher * _Nonnull)notificationsDispatcher
operationStatus:(OperationStatus * _Nonnull)operationStatus
application:(id<ZMApplication> _Nonnull)application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ @implementation ZMSyncStrategy
ZM_EMPTY_ASSERTING_INIT()


- (instancetype)initWithContextProvider:(id<ContextProvider>)contextProvider
- (instancetype)initWithContextProvider:(id<ZMContextProvider>)contextProvider
notificationsDispatcher:(NotificationDispatcher *)notificationsDispatcher
operationStatus:(OperationStatus *)operationStatus
application:(id<ZMApplication>)application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ final class ConnectToBotURLActionProcessor: NSObject, URLActionProcessor {
func process(urlAction: URLAction, delegate: PresentationDelegate?) {
guard case let .connectBot(serviceUserData) = urlAction else { return }

let providerIdentifier = serviceUserData.provider.transportString()
let serviceUser = ZMSearchUser(
contextProvider: contextProvider,
name: "",
Expand All @@ -52,7 +53,7 @@ final class ConnectToBotURLActionProcessor: NSObject, URLActionProcessor {
user: nil,
searchUsersCache: searchUsersCache
)
serviceUser.providerIdentifier = serviceUserData.provider.transportString()
serviceUser.providerIdentifier = providerIdentifier
serviceUser.createConversation(
transportSession: transportSession,
eventProcessor: eventProcessor,
Expand Down
Loading
Loading