From a520d947606997f72ddfe8264a9e86ea2de865a2 Mon Sep 17 00:00:00 2001 From: Mauro <34335419+Velin92@users.noreply.github.com> Date: Thu, 18 Jun 2026 17:55:31 +0200 Subject: [PATCH] Swift 6 Migration (#5733) * Enable Swift 6.2 with default main actor isolation for the app target Turn on SWIFT_VERSION 6.2, SWIFT_APPROACHABLE_CONCURRENCY and SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor for the ElementX target, matching the NSE and Share Extension (which already use 6.2 without the main actor default). # Conflicts: # ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved * Update the code generation templates for Swift 6 Emit nonisolated/@unchecked Sendable mocks and nonisolated string enums, and mark async mock methods @concurrent so they keep suspending like the real implementations (otherwise intermediate states are unobservable in tests). Includes the regenerated mocks and strings. # Conflicts: # ElementX/Sources/Mocks/Generated/GeneratedMocks.swift * Make the data layer and services nonisolated and Sendable Annotate the value-type models, Rust SDK proxy wrappers, timeline item graph, settings, logging and NSE-shared types as nonisolated, and conform the service protocols to Sendable so their existentials can cross isolation boundaries. These types run off the main actor and no longer inherit the target's default main actor isolation. * Adopt the new isolation across call sites, mocks and signatures Update call sites, closure signatures and mock configuration helpers to match the nonisolated/Sendable data layer, including the main actor isolated mock inits and the @Sendable filter on recentlyVisitedRooms. ^ Conflicts: ^ ElementX/Sources/Services/SecureBackup/SecureBackupController.swift * Remove redundant @MainActor annotations With the app target defaulting to main actor isolation, the explicit @MainActor on view models, coordinators, views and their protocols is no longer required. * Fix concurrency hotspots surfaced by the migration Resolve the room summary main-thread deadlock by moving diff processing onto AsyncStreams, add the SDKListener.onMainActor FIFO bridge for SDK callbacks, hop KVO/timer/UIKit callbacks to the main actor via assumeIsolated, add isolated deinits, and apply the few justified nonisolated(unsafe) escapes for queue-confined Apple APIs. * Fix the unit tests for Swift 6 concurrency Hop the waitForConfirmation body onto the caller's actor (Swift Testing runs confirmation closures off-actor), and adjust the affected suites and async signatures. * offload diffs on concurrent threads instead of main actor * make room info protocols sendable * use a task group for fetching data so that everything runs concurrently in the TextRoomTimelineView when getting the preview. * use the generic onMainActor implementation, which already makes a stream and send the continuation on the main actor. * small pr comments issues being addressed * update enterprise * Update StaticCode to 1.1.0 and specify the required Swift isolation. * fix ElementCallServiceTests * update enterprise * re-generate mocks * update enterprise * enterprise new code conformed to swift 6 --------- Co-authored-by: Doug --- ElementX.xcodeproj/project.pbxproj | 6 + .../xcshareddata/xcschemes/ElementX.xcscheme | 23 +- .../xcshareddata/xcschemes/UnitTests.xcscheme | 23 +- .../AccessibilityTestsAppCoordinator.swift | 18 +- ElementX/Sources/AppHooks/AppHooks.swift | 6 +- .../AppHooks/Hooks/AppSettingsHook.swift | 4 +- .../AppHooks/Hooks/BugReportHook.swift | 2 +- .../AppHooks/Hooks/ClientBuilderHook.swift | 4 +- .../Sources/AppHooks/Hooks/CompoundHook.swift | 2 +- .../Hooks/DeveloperOptionsScreenHook.swift | 2 +- .../AppHooks/Hooks/OAuthPresenterHook.swift | 4 +- .../Hooks/RecoveryKeyScreenHook.swift | 2 +- .../AppHooks/Hooks/RoomScreenHook.swift | 6 +- .../Sources/AppHooks/Hooks/TracingHook.swift | 4 +- .../Sources/Application/AppCoordinator.swift | 3 + .../Application/AppCoordinatorProtocol.swift | 1 - .../Sources/Application/AppMediator.swift | 2 +- .../Application/AppMediatorProtocol.swift | 3 +- .../Sources/Application/Application.swift | 2 + .../Application/CoordinatorProtocol.swift | 1 - .../Application/FlowCoordinatorProtocol.swift | 2 - .../Navigation/NavigationModule.swift | 1 - .../Navigation/NavigationTabCoordinator.swift | 3 +- .../Settings/AnalyticsConfiguration.swift | 2 +- .../Settings/AnalyticsConsentState.swift | 2 +- .../Application/Settings/AppAppearance.swift | 2 +- .../Application/Settings/AppSettings.swift | 108 +- .../Settings/AudioPlaybackSpeed.swift | 2 +- .../Settings/FrequentlyUsedEmoji.swift | 2 +- .../Settings/LiveLocationSession.swift | 2 +- .../Settings/MapTilerSettings.swift | 2 +- .../Settings/OAuthConfiguration.swift | 4 +- .../Settings/RageshakeConfiguration.swift | 2 +- .../Settings/RemotePreference.swift | 2 +- .../Settings/RoomListActivityVisibility.swift | 2 +- .../Settings/TrackedUserDefaults.swift | 2 +- .../Settings/UserDefaultsProtocol.swift | 2 +- .../Application/Settings/UserPreference.swift | 18 +- .../Settings/VolatileUserDefaults.swift | 2 +- .../Application/TargetConfiguration.swift | 2 +- .../Windowing/WindowManagerProtocol.swift | 1 - .../AuthenticationFlowCoordinator.swift | 1 - .../Generated/Strings+Untranslated.swift | 4 +- ElementX/Sources/Generated/Strings.swift | 4 +- ElementX/Sources/Mocks/ClientProxyMock.swift | 8 +- .../Mocks/Generated/GeneratedMocks.swift | 4470 ++++++++--------- .../Mocks/RoomLiveLocationServiceMock.swift | 2 +- .../Sources/Mocks/RoomMemberProxyMock.swift | 2 +- .../RoomNotificationSettingsProxyMock.swift | 2 +- .../Mocks/RoomPowerLevelsProxyMock.swift | 2 +- .../Sources/Mocks/RoomPreviewProxyMock.swift | 2 +- .../Sources/Mocks/SDK/ClientSDKMock.swift | 6 +- .../Sources/Mocks/SDK/EventTimelineItem.swift | 4 +- .../SDK/IdentityResetHandleSDKMock.swift | 2 +- .../Mocks/SDK/LeaveSpaceHandleSDKMock.swift | 6 +- ...ssionVerificationControllerProxyMock.swift | 12 +- .../SignallingTimelineItemProviderMock.swift | 6 +- .../Mocks/SpaceRoomListProxyMock.swift | 2 +- .../Mocks/TimelineControllerMock.swift | 2 +- ElementX/Sources/Mocks/UserSessionMock.swift | 2 +- ElementX/Sources/Other/Avatars.swift | 4 +- ElementX/Sources/Other/CallIntent.swift | 4 +- .../CollapsibleReactionLayout.swift | 16 +- .../Sources/Other/CurrentValuePublisher.swift | 4 +- .../Other/EffectsScene/EffectsScene.swift | 4 +- .../AVMetadataMachineReadableCodeObject.swift | 12 +- ElementX/Sources/Other/Extensions/Array.swift | 4 +- .../Other/Extensions/AsyncSequence.swift | 5 +- .../Other/Extensions/AttributedString.swift | 2 +- .../Sources/Other/Extensions/Bundle.swift | 2 +- .../Other/Extensions/CharacterSet.swift | 2 +- .../Other/Extensions/ClientBuilder.swift | 2 +- .../Sources/Other/Extensions/Collection.swift | 2 +- ElementX/Sources/Other/Extensions/Date.swift | 8 +- .../Sources/Other/Extensions/Dictionary.swift | 2 +- .../Other/Extensions/FileManager.swift | 2 +- .../Other/Extensions/HTMLParserStyle.swift | 1 - .../Sources/Other/Extensions/ImageCache.swift | 2 +- .../Other/Extensions/NSRegularExpresion.swift | 2 +- .../Sources/Other/Extensions/Observable.swift | 36 +- .../Other/Extensions/ProcessInfo.swift | 2 +- .../Other/Extensions/ProposedViewSize.swift | 2 +- .../Sources/Other/Extensions/Publisher.swift | 4 +- .../Sources/Other/Extensions/String.swift | 16 +- .../Extensions/UNNotificationContent.swift | 4 +- ElementX/Sources/Other/Extensions/URL.swift | 24 +- .../Sources/Other/Extensions/URLSession.swift | 2 +- .../Sources/Other/Extensions/UTType.swift | 2 +- .../HTMLParsing/AttributedStringBuilder.swift | 12 +- .../AttributedStringBuilderProtocol.swift | 4 +- .../HTMLParsing/ElementXAttributeScope.swift | 4 +- .../Other/HTMLParsing/HTMLFixtures.swift | 2 +- .../Other/HTMLParsing/PhishingDetector.swift | 2 +- ElementX/Sources/Other/InfoPlistReader.swift | 2 +- .../Other/Logging/ExtensionLogger.swift | 2 +- ElementX/Sources/Other/Logging/LogLevel.swift | 2 +- ElementX/Sources/Other/Logging/MXLog.swift | 2 +- .../Sources/Other/Logging/TraceLogPack.swift | 4 +- ElementX/Sources/Other/Logging/Tracing.swift | 2 +- .../Other/MapLibre/MapLibreMapView.swift | 7 +- .../Sources/Other/MatrixEntityRegex.swift | 2 +- ElementX/Sources/Other/Pagination.swift | 2 +- .../Sources/Other/Pills/MentionBuilder.swift | 4 +- .../Sources/Other/Pills/MessageText.swift | 2 +- .../Pills/PillAttachmentViewProvider.swift | 70 +- .../Sources/Other/Pills/PillContext.swift | 1 - .../Other/Pills/PillTextAttachment.swift | 2 +- .../Other/Pills/PillTextAttachmentData.swift | 6 +- .../Sources/Other/Pills/PillUtilities.swift | 2 +- .../Other/Pills/PlainMentionBuilder.swift | 2 +- ElementX/Sources/Other/SDKListener.swift | 113 +- .../Other/ShareToMapsAppActivity.swift | 21 +- .../SwiftUI/Layout/FullscreenDialog.swift | 2 +- .../SwiftUI/Layout/ViewFrameReader.swift | 5 +- .../SwiftUI/ViewModel/BindableState.swift | 1 - .../ViewModel/StateStoreViewModel.swift | 2 - .../ViewModel/StateStoreViewModelV2.swift | 2 - .../Other/SwiftUI/Views/LoadableImage.swift | 17 +- .../SwiftUI/Views/RoomInviterLabel.swift | 1 - .../Other/SwiftUI/Views/ToolbarButton.swift | 1 - ElementX/Sources/Other/UserAgentBuilder.swift | 16 +- .../VoiceMessage/EstimatedWaveformView.swift | 4 +- .../AppLockScreenViewModelProtocol.swift | 1 - ...tupBiometricsScreenViewModelProtocol.swift | 1 - ...pLockSetupPINScreenViewModelProtocol.swift | 1 - ...SetupSettingsScreenViewModelProtocol.swift | 1 - .../LoginScreen/LoginMode.swift | 2 +- .../LoginScreenViewModelProtocol.swift | 1 - .../OAuthAuthenticationPresenter.swift | 1 - ...rConfirmationScreenViewModelProtocol.swift | 1 - ...rverSelectionScreenViewModelProtocol.swift | 1 - .../MockSoftLogoutScreenState.swift | 2 +- .../SoftLogoutScreenCoordinator.swift | 8 +- .../SoftLogoutScreenViewModel.swift | 2 +- .../SoftLogoutScreenViewModelProtocol.swift | 3 +- ...ticationStartScreenViewModelProtocol.swift | 1 - .../BlockedUsersScreenViewModel.swift | 20 +- .../BlockedUsersScreenViewModelProtocol.swift | 1 - .../BugReportScreenViewModelProtocol.swift | 1 - .../View/BugReportScreen.swift | 5 +- .../CallScreenViewModelProtocol.swift | 1 - .../Screens/CallScreen/View/CallScreen.swift | 4 +- ...sSpaceFiltersScreenViewModelProtocol.swift | 1 - .../View/ChatsSpaceFilterCell.swift | 2 +- .../PollFormScreenViewModelProtocol.swift | 1 - .../View/PollFormScreen.swift | 2 +- .../CreateRoomScreenViewModel.swift | 4 +- .../CreateRoomScreenViewModelProtocol.swift | 1 - ...clineAndBlockScreenViewModelProtocol.swift | 1 - ...itRoomAddressScreenViewModelProtocol.swift | 1 - .../EmojiPickerScreenViewModelProtocol.swift | 1 - ...ResetPasswordScreenViewModelProtocol.swift | 1 - ...cryptionResetScreenViewModelProtocol.swift | 1 - .../View/TimelineMediaPreviewController.swift | 5 +- .../GlobalSearchScreenCoordinator.swift | 1 - .../GlobalSearchScreenViewModelProtocol.swift | 1 - .../View/GlobalSearchScreenCell.swift | 2 +- .../HomeScreenViewModelProtocol.swift | 1 - .../View/HomeScreenInviteCell.swift | 2 - .../View/HomeScreenKnockedCell.swift | 2 - .../HomeScreen/View/HomeScreenRoomCell.swift | 6 +- .../InviteUsersScreenViewModel.swift | 8 +- .../InviteUsersScreenViewModelProtocol.swift | 1 - .../JoinRoomScreenViewModelProtocol.swift | 1 - .../JoinRoomScreen/View/JoinRoomScreen.swift | 1 - ...kRequestsListScreenViewModelProtocol.swift | 1 - .../View/KnockRequestCell.swift | 6 +- .../LabsScreenViewModelProtocol.swift | 1 - .../LinkNewDeviceScreenModels.swift | 2 +- .../LinkNewDeviceScreenViewModel.swift | 11 +- ...LinkNewDeviceScreenViewModelProtocol.swift | 1 - ...cationSharingScreenViewModelProtocol.swift | 1 - .../LogViewerScreenViewModelProtocol.swift | 1 - ...horizedSpacesScreenViewModelProtocol.swift | 1 - ...nageRoomMemberSheetViewModelProtocol.swift | 1 - ...ventsTimelineScreenViewModelProtocol.swift | 1 - .../MediaUploadPreviewScreenViewModel.swift | 2 +- ...UploadPreviewScreenViewModelProtocol.swift | 1 - ...ageForwardingScreenViewModelProtocol.swift | 1 - .../View/MessageForwardingScreen.swift | 2 +- ...alyticsPromptScreenViewModelProtocol.swift | 1 - ...yConfirmationScreenViewModelProtocol.swift | 1 - ...tityConfirmedScreenViewModelProtocol.swift | 1 - ...onPermissionsScreenViewModelProtocol.swift | 1 - ...nVerificationScreenViewModelProtocol.swift | 1 - ...ventsTimelineScreenViewModelProtocol.swift | 1 - .../QRCodeLoginScreenModels.swift | 14 +- .../QRCodeLoginScreenViewModelProtocol.swift | 1 - .../View/QRCodeScannerView.swift | 10 +- ...ReportContentScreenViewModelProtocol.swift | 1 - .../ReportRoomScreenViewModelProtocol.swift | 1 - ...rifiedUserSendFailureScreenViewModel.swift | 1 - ...erSendFailureScreenViewModelProtocol.swift | 1 - ...gePermissionsScreenViewModelProtocol.swift | 1 - .../RoomChangeRolesScreenViewModel.swift | 6 +- ...omChangeRolesScreenViewModelProtocol.swift | 1 - .../RoomDetailsEditScreenViewModel.swift | 26 +- ...omDetailsEditScreenViewModelProtocol.swift | 1 - .../RoomDetailsScreenViewModelProtocol.swift | 1 - ...ctorySearchScreenScreenModelProtocol.swift | 1 - .../RoomMemberDetailsScreenViewModel.swift | 3 +- ...MemberDetailsScreenViewModelProtocol.swift | 1 - .../RoomMembersListScreenModels.swift | 2 +- .../RoomMembersListScreenViewModel.swift | 22 +- ...omMembersListScreenViewModelProtocol.swift | 1 - .../View/RoomMembersListScreen.swift | 1 - ...ationSettingsScreenViewModelProtocol.swift | 1 - ...mPollsHistoryScreenViewModelProtocol.swift | 1 - ...omRolesAndPermissionsScreenViewModel.swift | 6 +- ...ndPermissionsScreenViewModelProtocol.swift | 1 - .../ComposerToolbarViewModel.swift | 4 +- .../ComposerToolbarViewModelProtocol.swift | 1 - .../View/FormattingToolbar.swift | 1 - .../Screens/RoomScreen/RoomScreenModels.swift | 2 - .../RoomScreenViewModelProtocol.swift | 1 - .../View/KnockRequestsBannerView.swift | 18 +- ...RoomSelectionScreenViewModelProtocol.swift | 1 - .../View/RoomSelectionScreen.swift | 2 +- ...oomThreadListScreenViewModelProtocol.swift | 1 - ...ckupKeyBackupScreenViewModelProtocol.swift | 1 - ...BackupLogoutConfirmationScreenModels.swift | 2 +- ...tConfirmationScreenViewModelProtocol.swift | 1 - ...upRecoveryKeyScreenViewModelProtocol.swift | 1 - .../SecureBackupScreenViewModelProtocol.swift | 1 - .../SecurityAndPrivacyScreenViewModel.swift | 3 + ...ityAndPrivacyScreenViewModelProtocol.swift | 1 - .../OAuthAccountSettingsPresenter.swift | 1 - ...ancedSettingsScreenViewModelProtocol.swift | 1 - ...yticsSettingsScreenViewModelProtocol.swift | 1 - ...tivateAccountScreenViewModelProtocol.swift | 1 - .../DeveloperOptionsScreenViewModel.swift | 2 +- ...eloperOptionsScreenViewModelProtocol.swift | 1 - ...alInformationScreenViewModelProtocol.swift | 1 - ...nSettingsEditScreenViewModelProtocol.swift | 1 - ...tificationSettingsEditScreenRoomCell.swift | 3 +- ...ationSettingsScreenViewModelProtocol.swift | 1 - .../SettingsScreenViewModelProtocol.swift | 1 - .../UserDetailsEditScreenViewModel.swift | 20 +- ...erDetailsEditScreenViewModelProtocol.swift | 1 - .../Screens/Spaces/Common/SpaceRoomCell.swift | 2 +- .../SpaceAddRoomsScreenModels.swift | 2 +- .../SpaceAddRoomsScreenViewModel.swift | 11 +- ...SpaceAddRoomsScreenViewModelProtocol.swift | 1 - .../View/SpaceAddRoomsScreen.swift | 2 +- .../SpaceScreenViewModelProtocol.swift | 1 - .../Spaces/SpaceScreen/View/SpaceScreen.swift | 2 +- .../SpacesScreenViewModelProtocol.swift | 1 - .../StartChatScreenViewModelProtocol.swift | 1 - ...hreadTimelineScreenViewModelProtocol.swift | 1 - .../Timeline/TimelineInteractionHandler.swift | 1 - .../TimelineTableViewController.swift | 2 +- .../Timeline/TimelineViewModelProtocol.swift | 1 - .../View/ItemMenu/TimelineItemMenu.swift | 1 - .../ItemMenu/TimelineItemMenuAction.swift | 1 - .../TimelineItemMenuActionProvider.swift | 1 - .../View/Style/TimelineBubbleLayout.swift | 2 +- .../Style/TimelineItemBubbledStylerView.swift | 1 - .../Style/TimelineItemSendInfoLabel.swift | 2 - .../Supplementary/TimelineReactionsView.swift | 1 - .../TextRoomTimelineView.swift | 16 +- .../Screens/Timeline/View/TimelineView.swift | 1 - .../UserProfileScreenViewModel.swift | 15 +- .../UserProfileScreenViewModelProtocol.swift | 1 - .../AlertTones/NotificationTone.swift | 2 +- .../AlertTones/NotificationToneManager.swift | 4 +- .../NotificationToneManagerProtocol.swift | 2 +- .../AppLock/AppLockServiceProtocol.swift | 1 - .../Services/AppLock/AppLockTimer.swift | 2 +- .../Services/AppLock/LAContextMock.swift | 2 +- .../Services/Audio/AudioConverter.swift | 2 +- .../Audio/AudioConverterProtocol.swift | 2 +- .../Services/Audio/AudioSessionProtocol.swift | 6 +- .../Services/Audio/Player/AudioPlayer.swift | 51 +- .../Audio/Player/AudioPlayerProtocol.swift | 2 +- .../Audio/Player/AudioPlayerState.swift | 1 - .../Audio/Recorder/AudioRecorder.swift | 17 +- .../Recorder/AudioRecorderProtocol.swift | 6 +- .../Audio/Recorder/AudioRecorderState.swift | 1 - .../AuthenticationService.swift | 6 +- .../ClassicApp/ClassicAppMXAccount.swift | 8 +- .../ClassicApp/ClassicAppMediaLoader.swift | 2 +- .../Authentication/LinkNewDeviceService.swift | 47 +- .../Services/BugReport/BugReportService.swift | 10 +- .../BugReport/BugReportServiceProtocol.swift | 2 +- .../Sources/Services/Client/ClientProxy.swift | 28 +- .../Services/Client/ClientProxyProtocol.swift | 2 +- .../ElementCall/ElementCallService.swift | 27 +- .../ElementCallServiceConstants.swift | 4 +- .../ElementCall/ElementCallWidgetDriver.swift | 13 +- .../Services/Emojis/EmojiProvider.swift | 4 +- .../Emojis/EmojiProviderProtocol.swift | 1 - .../Keychain/KeychainController.swift | 6 +- .../Keychain/KeychainControllerProtocol.swift | 2 +- .../Location/LiveLocationManager.swift | 1 - .../Location/RoomLiveLocationService.swift | 23 +- .../RoomLiveLocationServiceProtocol.swift | 2 +- .../Media/Provider/MediaFileHandleProxy.swift | 2 +- .../Services/Media/Provider/MediaLoader.swift | 2 +- .../Media/Provider/MediaLoaderProtocol.swift | 2 +- .../Media/Provider/MediaProvider.swift | 2 +- .../Provider/MediaProviderProtocol.swift | 2 +- .../Media/Provider/MediaSourceProxy.swift | 2 +- .../MediaPlayerProviderProtocol.swift | 1 - .../Manager/NotificationManager.swift | 19 +- .../Notification/NotificationConstants.swift | 2 +- .../NotificationSettingsProxy.swift | 21 +- .../RoomNotificationModeProxy.swift | 4 +- ...oomNotificationSettingsProxyProtocol.swift | 2 +- ElementX/Sources/Services/Room/JoinRule.swift | 4 +- .../Services/Room/JoinedRoomProxy.swift | 8 +- .../Services/Room/KnockRequestProxy.swift | 2 +- .../Room/KnockRequestProxyProtocol.swift | 4 +- .../Sources/Services/Room/RoomInfoProxy.swift | 4 +- .../Services/Room/RoomInfoProxyProtocol.swift | 4 +- .../Room/RoomMember/RoomMemberDetails.swift | 4 +- .../Room/RoomMember/RoomMemberProxy.swift | 2 +- .../RoomMember/RoomMemberProxyProtocol.swift | 8 +- .../Services/Room/RoomPermissions.swift | 2 +- .../Services/Room/RoomPowerLevel.swift | 4 +- .../Room/RoomPowerLevelProxyProtocol.swift | 2 +- .../Services/Room/RoomPowerLevelsProxy.swift | 2 +- .../RoomPreviewProxyProtocol.swift | 2 +- .../Services/Room/RoomProxyProtocol.swift | 2 +- ElementX/Sources/Services/Room/RoomRole.swift | 6 +- .../RoomSummary/RoomEventStringBuilder.swift | 2 +- .../RoomMessageEventStringBuilder.swift | 2 +- .../Room/RoomSummary/RoomSummary.swift | 2 +- .../RoomSummary/RoomSummaryProvider.swift | 143 +- .../Room/RoomThreadListServiceProxy.swift | 21 +- .../RoomDirectorySearchProxy.swift | 63 +- .../RoomDirectorySearchProxyProtocol.swift | 2 +- .../SecureBackup/SecureBackupController.swift | 15 +- .../SecureBackupControllerProtocol.swift | 4 +- .../Session/UserSessionProtocol.swift | 2 +- .../SessionVerificationControllerProxy.swift | 35 +- .../Services/Spaces/SpaceRoomListProxy.swift | 22 +- .../Spaces/SpaceRoomListProxyProtocol.swift | 2 +- .../Services/Spaces/SpaceServiceProxy.swift | 37 +- .../Sources/Services/Timeline/GeoURI.swift | 11 +- .../TimelineController.swift | 10 +- .../TimelineControllerFactoryProtocol.swift | 1 - .../AggregratedReaction.swift | 6 +- .../EncryptionAuthenticity.swift | 4 +- .../TimelineItemContent/ReadReceipt.swift | 4 +- .../RoomTimelineItemProperties.swift | 2 +- .../TimelineEventContent.swift | 2 +- .../TimelineItemKeyForwarder.swift | 2 +- .../TimelineItemReplyDetails.swift | 4 +- .../TimelineItemThreadSummary.swift | 2 +- .../Timeline/TimelineItemIdentifier.swift | 4 +- .../Timeline/TimelineItemProvider.swift | 39 +- .../TimelineItemProviderProtocol.swift | 5 +- .../Services/Timeline/TimelineItemProxy.swift | 76 +- .../Timeline/TimelineItemSender.swift | 2 +- .../DecorationTimelineItemProtocol.swift | 2 +- ...ventBasedMessageTimelineItemProtocol.swift | 6 +- .../EventBasedTimelineItemProtocol.swift | 4 +- .../Messages/AudioRoomTimelineItem.swift | 2 +- .../AudioRoomTimelineItemContent.swift | 2 +- .../Messages/EmoteRoomTimelineItem.swift | 2 +- .../EmoteRoomTimelineItemContent.swift | 2 +- .../Items/Messages/FileRoomTimelineItem.swift | 2 +- .../FileRoomTimelineItemContent.swift | 2 +- .../Messages/ImageRoomTimelineItem.swift | 2 +- .../ImageRoomTimelineItemContent.swift | 2 +- .../LiveLocationRoomTimelineItem.swift | 6 +- .../Messages/LocationRoomTimelineItem.swift | 2 +- .../LocationRoomTimelineItemContent.swift | 4 +- .../Messages/NoticeRoomTimelineItem.swift | 2 +- .../NoticeRoomTimelineItemContent.swift | 2 +- .../Items/Messages/TextRoomTimelineItem.swift | 2 +- .../TextRoomTimelineItemContent.swift | 2 +- .../Messages/VideoRoomTimelineItem.swift | 2 +- .../VideoRoomTimelineItemContent.swift | 2 +- .../VoiceMessageRoomTimelineItem.swift | 2 +- .../Other/CallInviteRoomTimelineItem.swift | 2 +- .../CallNotificationRoomTimelineItem.swift | 2 +- .../Items/Other/CollapsibleTimelineItem.swift | 2 +- .../Other/EncryptedRoomTimelineItem.swift | 2 +- .../Items/Other/PollRoomTimelineItem.swift | 4 +- .../Other/RedactedRoomTimelineItem.swift | 2 +- .../Items/Other/StateRoomTimelineItem.swift | 2 +- .../Items/Other/StickerRoomTimelineItem.swift | 2 +- .../Other/UnsupportedRoomTimelineItem.swift | 2 +- .../PaginationIndicatorRoomTimelineItem.swift | 2 +- .../Virtual/ReadMarkerRoomTimelineItem.swift | 2 +- .../Virtual/SeparatorRoomTimelineItem.swift | 2 +- .../TimelineStartRoomTimelineItem.swift | 2 +- .../RoomStateEventStringBuilder.swift | 2 +- .../RoomTimelineItemFactory.swift | 6 +- .../RoomTimelineItemFactoryProtocol.swift | 2 +- .../RoomTimelineItemProtocol.swift | 4 +- .../TextBasedRoomTimelineItem.swift | 2 +- .../Services/Timeline/TimelineProxy.swift | 47 +- .../Timeline/TimelineProxyProtocol.swift | 2 +- .../UserSession/RestorationToken.swift | 4 +- .../UserSession/SessionDirectories.swift | 6 +- .../UserSession/UserSessionStore.swift | 2 +- .../Services/Users/UserDiscoveryService.swift | 4 +- .../Services/Users/UserIdentityProxy.swift | 2 +- .../Users/UserIdentityProxyProtocol.swift | 4 +- .../Services/Users/UserProfileProxy.swift | 2 +- .../VoiceMessage/VoiceMessageCache.swift | 2 +- .../VoiceMessageCacheProtocol.swift | 4 +- .../VoiceMessageMediaManager.swift | 3 +- .../VoiceMessage/VoiceMessageRecorder.swift | 14 +- .../UITests/UITestsAppCoordinator.swift | 3 +- .../UITests/UITestsNotificationCenter.swift | 4 + .../Sources/UITests/UITestsSignalling.swift | 3 +- ElementX/SupportingFiles/target.yml | 3 + Enterprise | 2 +- NSE/Sources/BootDetectionManager.swift | 2 +- .../CommonSettings+NotificationName.swift | 2 +- NSE/Sources/NSEUserSession.swift | 6 +- NSE/Sources/NotificationContentBuilder.swift | 4 +- NSE/Sources/NotificationHandler.swift | 2 +- .../NotificationItemProxy.swift | 4 +- .../NotificationItemProxyProtocol.swift | 2 +- .../NotificationServiceExtension.swift | 2 +- Secrets/Secrets.pkl | 3 +- Secrets/Secrets.swift | 2 +- .../staticcode@1.0.1/staticcode@1.0.1.zip | Bin 12774 -> 0 bytes .../staticcode@1.1.0.json} | 8 +- .../staticcode@1.1.0/staticcode@1.1.0.zip | Bin 0 -> 13329 bytes Tools/Sourcery/AutoMockable.stencil | 35 +- ...ctured-swift5-element-untranslated.stencil | 4 +- .../Strings/structured-swift5-element.stencil | 4 +- UnitTests/Sources/AnalyticsTests.swift | 2 +- .../Sources/AppRouteURLParserTests.swift | 1 + UnitTests/Sources/BugReportServiceTests.swift | 3 +- .../ClassicAppAccountManagerTests.swift | 2 + .../Sources/ClassicAppMediaLoaderTests.swift | 2 + .../Sources/ElementCallServiceTests.swift | 10 +- .../Sources/HomeScreenViewModelTests.swift | 4 +- .../JoinRoomScreenViewModelTests.swift | 3 +- .../LocationSharingScreenViewModelTests.swift | 18 +- UnitTests/Sources/LoggingTests.swift | 1 + .../Sources/MapTilerURLBuilderTests.swift | 1 + .../Sources/RoomListFiltersStateTests.swift | 1 + UnitTests/Sources/RoomSummaryTests.swift | 1 + .../TestUtilities/WaitingConfirmation.swift | 23 +- UnitTests/Sources/TimelineStateTests.swift | 1 + UnitTests/Sources/UserPreferenceTests.swift | 26 +- .../Sources/Compound/List/ListRow.swift | 2 +- 444 files changed, 3677 insertions(+), 3361 deletions(-) delete mode 100644 Secrets/vendor/package-2/pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.0.1/staticcode@1.0.1.zip rename Secrets/vendor/package-2/pkg.pkl-lang.org/github.com/element-hq/pkl-tools/{staticcode@1.0.1/staticcode@1.0.1.json => staticcode@1.1.0/staticcode@1.1.0.json} (54%) create mode 100644 Secrets/vendor/package-2/pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.1.0/staticcode@1.1.0.zip diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index 928c30960..a6ae2f16d 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -9653,8 +9653,11 @@ PRODUCT_BUNDLE_IDENTIFIER = "$(BASE_BUNDLE_IDENTIFIER)"; PRODUCT_NAME = "$(APP_NAME)"; SDKROOT = iphoneos; + SWIFT_APPROACHABLE_CONCURRENCY = YES; + SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor; SWIFT_OBJC_BRIDGING_HEADER = "ElementX/SupportingFiles/ElementX-Bridging-Header.h"; SWIFT_OBJC_INTERFACE_HEADER_NAME = "GeneratedInterface-Swift.h"; + SWIFT_VERSION = 6.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -9685,8 +9688,11 @@ PRODUCT_BUNDLE_IDENTIFIER = "$(BASE_BUNDLE_IDENTIFIER)"; PRODUCT_NAME = "$(APP_NAME)"; SDKROOT = iphoneos; + SWIFT_APPROACHABLE_CONCURRENCY = YES; + SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor; SWIFT_OBJC_BRIDGING_HEADER = "ElementX/SupportingFiles/ElementX-Bridging-Header.h"; SWIFT_OBJC_INTERFACE_HEADER_NAME = "GeneratedInterface-Swift.h"; + SWIFT_VERSION = 6.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; diff --git a/ElementX.xcodeproj/xcshareddata/xcschemes/ElementX.xcscheme b/ElementX.xcodeproj/xcshareddata/xcschemes/ElementX.xcscheme index eb510f50c..b50acdfed 100644 --- a/ElementX.xcodeproj/xcshareddata/xcschemes/ElementX.xcscheme +++ b/ElementX.xcodeproj/xcshareddata/xcschemes/ElementX.xcscheme @@ -4,8 +4,7 @@ version = "1.7"> + buildImplicitDependencies = "YES"> - - - - - - - - + + + + - - - - diff --git a/ElementX.xcodeproj/xcshareddata/xcschemes/UnitTests.xcscheme b/ElementX.xcodeproj/xcshareddata/xcschemes/UnitTests.xcscheme index 4f9dcc92b..ab2421025 100644 --- a/ElementX.xcodeproj/xcshareddata/xcschemes/UnitTests.xcscheme +++ b/ElementX.xcodeproj/xcshareddata/xcschemes/UnitTests.xcscheme @@ -4,8 +4,7 @@ version = "1.7"> + buildImplicitDependencies = "YES"> - - - - - - - - + + + + - - - - AppSettings +nonisolated protocol AppSettingsHookProtocol: Sendable { + @MainActor func configure(_ appSettings: AppSettings) -> AppSettings } struct DefaultAppSettingsHook: AppSettingsHookProtocol { diff --git a/ElementX/Sources/AppHooks/Hooks/BugReportHook.swift b/ElementX/Sources/AppHooks/Hooks/BugReportHook.swift index 92231b5aa..cb4436adc 100644 --- a/ElementX/Sources/AppHooks/Hooks/BugReportHook.swift +++ b/ElementX/Sources/AppHooks/Hooks/BugReportHook.swift @@ -8,7 +8,7 @@ import Foundation -protocol BugReportHookProtocol { +nonisolated protocol BugReportHookProtocol: Sendable { func update(_ bugReport: BugReport) -> BugReport } diff --git a/ElementX/Sources/AppHooks/Hooks/ClientBuilderHook.swift b/ElementX/Sources/AppHooks/Hooks/ClientBuilderHook.swift index 7117fc17c..f90007f5b 100644 --- a/ElementX/Sources/AppHooks/Hooks/ClientBuilderHook.swift +++ b/ElementX/Sources/AppHooks/Hooks/ClientBuilderHook.swift @@ -8,11 +8,11 @@ import MatrixRustSDK -protocol ClientBuilderHookProtocol: Sendable { +nonisolated protocol ClientBuilderHookProtocol: Sendable { func configure(_ builder: ClientBuilder) -> ClientBuilder } -struct DefaultClientBuilderHook: ClientBuilderHookProtocol { +nonisolated struct DefaultClientBuilderHook: ClientBuilderHookProtocol { func configure(_ builder: ClientBuilder) -> ClientBuilder { builder } diff --git a/ElementX/Sources/AppHooks/Hooks/CompoundHook.swift b/ElementX/Sources/AppHooks/Hooks/CompoundHook.swift index 75d99bde1..75b66bddf 100644 --- a/ElementX/Sources/AppHooks/Hooks/CompoundHook.swift +++ b/ElementX/Sources/AppHooks/Hooks/CompoundHook.swift @@ -8,7 +8,7 @@ import Compound -protocol CompoundHookProtocol { +nonisolated protocol CompoundHookProtocol: Sendable { @MainActor func override(colors: CompoundColors, uiColors: CompoundUIColors) } diff --git a/ElementX/Sources/AppHooks/Hooks/DeveloperOptionsScreenHook.swift b/ElementX/Sources/AppHooks/Hooks/DeveloperOptionsScreenHook.swift index 3470db21a..470379503 100644 --- a/ElementX/Sources/AppHooks/Hooks/DeveloperOptionsScreenHook.swift +++ b/ElementX/Sources/AppHooks/Hooks/DeveloperOptionsScreenHook.swift @@ -7,7 +7,7 @@ import SwiftUI -protocol DeveloperOptionsScreenHookProtocol { +nonisolated protocol DeveloperOptionsScreenHookProtocol: Sendable { func generalSectionRows() -> AnyView? } diff --git a/ElementX/Sources/AppHooks/Hooks/OAuthPresenterHook.swift b/ElementX/Sources/AppHooks/Hooks/OAuthPresenterHook.swift index 738dac7a5..848e869a1 100644 --- a/ElementX/Sources/AppHooks/Hooks/OAuthPresenterHook.swift +++ b/ElementX/Sources/AppHooks/Hooks/OAuthPresenterHook.swift @@ -8,8 +8,8 @@ import Foundation -protocol OAuthPresenterHookProtocol { - func update(_ url: URL) -> URL +nonisolated protocol OAuthPresenterHookProtocol: Sendable { + @MainActor func update(_ url: URL) -> URL } struct DefaultOAuthPresenterHook: OAuthPresenterHookProtocol { diff --git a/ElementX/Sources/AppHooks/Hooks/RecoveryKeyScreenHook.swift b/ElementX/Sources/AppHooks/Hooks/RecoveryKeyScreenHook.swift index 2b90ed53d..365d76544 100644 --- a/ElementX/Sources/AppHooks/Hooks/RecoveryKeyScreenHook.swift +++ b/ElementX/Sources/AppHooks/Hooks/RecoveryKeyScreenHook.swift @@ -12,7 +12,7 @@ import SwiftUI var actions: AnyPublisher { get } } -protocol RecoveryKeyScreenHookProtocol { +nonisolated protocol RecoveryKeyScreenHookProtocol: Sendable { @MainActor func makeCoordinator(parameters: SecureBackupRecoveryKeyScreenCoordinatorParameters, homeserver: String) -> any SecureBackupRecoveryKeyCoordinatorProtocol } diff --git a/ElementX/Sources/AppHooks/Hooks/RoomScreenHook.swift b/ElementX/Sources/AppHooks/Hooks/RoomScreenHook.swift index 5eba9c507..8e17854aa 100644 --- a/ElementX/Sources/AppHooks/Hooks/RoomScreenHook.swift +++ b/ElementX/Sources/AppHooks/Hooks/RoomScreenHook.swift @@ -8,9 +8,9 @@ import Foundation -protocol RoomScreenHookProtocol { - func configure(with userSession: UserSessionProtocol?) async - func update(_ viewState: RoomScreenViewState) -> RoomScreenViewState +nonisolated protocol RoomScreenHookProtocol: Sendable { + @MainActor func configure(with userSession: UserSessionProtocol?) async + @MainActor func update(_ viewState: RoomScreenViewState) -> RoomScreenViewState } struct DefaultRoomScreenHook: RoomScreenHookProtocol { diff --git a/ElementX/Sources/AppHooks/Hooks/TracingHook.swift b/ElementX/Sources/AppHooks/Hooks/TracingHook.swift index f8279708f..9093ce6a9 100644 --- a/ElementX/Sources/AppHooks/Hooks/TracingHook.swift +++ b/ElementX/Sources/AppHooks/Hooks/TracingHook.swift @@ -8,10 +8,10 @@ import MatrixRustSDK -protocol TracingHookProtocol: Sendable { +nonisolated protocol TracingHookProtocol: Sendable { func update(_ configuration: TracingConfiguration, with rageshakeURL: RemotePreference) } -struct DefaultTracingHook: TracingHookProtocol { +nonisolated struct DefaultTracingHook: TracingHookProtocol { func update(_ configuration: TracingConfiguration, with rageshakeURL: RemotePreference) { } } diff --git a/ElementX/Sources/Application/AppCoordinator.swift b/ElementX/Sources/Application/AppCoordinator.swift index 2c47a25a1..237fcee5a 100644 --- a/ElementX/Sources/Application/AppCoordinator.swift +++ b/ElementX/Sources/Application/AppCoordinator.swift @@ -1262,6 +1262,9 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg // this does not crash on the main thread, even though the whole AppCoordinator is on the Main actor. As such, // we hop onto the main actor explicitly before pausing. // https://sentry.tools.element.io/organizations/element/issues/4477794/ + // BGTask isn't annotated but is documented as thread-safe, with + // setTaskCompleted(success:) being callable from any thread. + nonisolated(unsafe) let task = task task.expirationHandler = { @Sendable [weak self] in MXLog.info("Background app refresh task is about to expire.") diff --git a/ElementX/Sources/Application/AppCoordinatorProtocol.swift b/ElementX/Sources/Application/AppCoordinatorProtocol.swift index 785d0940f..c6b89cbc3 100644 --- a/ElementX/Sources/Application/AppCoordinatorProtocol.swift +++ b/ElementX/Sources/Application/AppCoordinatorProtocol.swift @@ -8,7 +8,6 @@ import Foundation -@MainActor protocol AppCoordinatorProtocol: CoordinatorProtocol { var windowManager: SecureWindowManagerProtocol { get } diff --git a/ElementX/Sources/Application/AppMediator.swift b/ElementX/Sources/Application/AppMediator.swift index df67f0622..207fc4d0e 100644 --- a/ElementX/Sources/Application/AppMediator.swift +++ b/ElementX/Sources/Application/AppMediator.swift @@ -36,7 +36,7 @@ class AppMediator: AppMediatorProtocol { } } - func beginBackgroundTask(expirationHandler handler: (() -> Void)?) -> UIBackgroundTaskIdentifier { + func beginBackgroundTask(expirationHandler handler: (@MainActor @Sendable () -> Void)?) -> UIBackgroundTaskIdentifier { application.beginBackgroundTask(expirationHandler: handler) } diff --git a/ElementX/Sources/Application/AppMediatorProtocol.swift b/ElementX/Sources/Application/AppMediatorProtocol.swift index 4267a73e7..c2401a18f 100644 --- a/ElementX/Sources/Application/AppMediatorProtocol.swift +++ b/ElementX/Sources/Application/AppMediatorProtocol.swift @@ -10,14 +10,13 @@ import Foundation import UIKit // sourcery: AutoMockable -@MainActor protocol AppMediatorProtocol { var windowManager: WindowManagerProtocol { get } var networkMonitor: NetworkMonitorProtocol { get } var appState: UIApplication.State { get } - func beginBackgroundTask(expirationHandler handler: (() -> Void)?) -> UIBackgroundTaskIdentifier + func beginBackgroundTask(expirationHandler handler: (@MainActor @Sendable () -> Void)?) -> UIBackgroundTaskIdentifier func endBackgroundTask(_ identifier: UIBackgroundTaskIdentifier) diff --git a/ElementX/Sources/Application/Application.swift b/ElementX/Sources/Application/Application.swift index 1bc86d567..f11bbd83f 100644 --- a/ElementX/Sources/Application/Application.swift +++ b/ElementX/Sources/Application/Application.swift @@ -14,6 +14,7 @@ struct Application: App { @Environment(\.openURL) private var openURL @Environment(\.openWindow) private var openWindow @Environment(\.dismissWindow) private var dismissWindow + @Environment(\.displayScale) private var displayScale private var appCoordinator: AppCoordinatorProtocol! @@ -51,6 +52,7 @@ struct Application: App { appCoordinator.handleUserActivity(userActivity) } .task { + UserAgentBuilder.displayScale = displayScale appCoordinator.start() appCoordinator.windowManager.configure(withOpenWindowAction: openWindow, dismissWindowAction: dismissWindow) diff --git a/ElementX/Sources/Application/CoordinatorProtocol.swift b/ElementX/Sources/Application/CoordinatorProtocol.swift index f6c0390b8..09e784036 100644 --- a/ElementX/Sources/Application/CoordinatorProtocol.swift +++ b/ElementX/Sources/Application/CoordinatorProtocol.swift @@ -8,7 +8,6 @@ import SwiftUI -@MainActor protocol CoordinatorProtocol: AnyObject { func start() func stop() diff --git a/ElementX/Sources/Application/FlowCoordinatorProtocol.swift b/ElementX/Sources/Application/FlowCoordinatorProtocol.swift index 818d79172..c31de9559 100644 --- a/ElementX/Sources/Application/FlowCoordinatorProtocol.swift +++ b/ElementX/Sources/Application/FlowCoordinatorProtocol.swift @@ -9,7 +9,6 @@ import Foundation // periphery:ignore - markdown protocol -@MainActor protocol FlowCoordinatorProtocol { func start(animated: Bool) func handleAppRoute(_ appRoute: AppRoute, animated: Bool) @@ -25,7 +24,6 @@ extension FlowCoordinatorProtocol { /// Core parameters that are shared across the main flows for easy dependency injection. /// /// Please do **not** pass this type directly to screen coordinators/view models. -@MainActor struct CommonFlowParameters { let userSession: UserSessionProtocol let bugReportService: BugReportServiceProtocol diff --git a/ElementX/Sources/Application/Navigation/NavigationModule.swift b/ElementX/Sources/Application/Navigation/NavigationModule.swift index c262d94de..956308078 100644 --- a/ElementX/Sources/Application/Navigation/NavigationModule.swift +++ b/ElementX/Sources/Application/Navigation/NavigationModule.swift @@ -10,7 +10,6 @@ import Foundation /// A CoordinatorProtocol wrapper and type erasing component that allows /// dynamically presenting arbitrary screens -@MainActor class NavigationModule: Identifiable, Hashable { let id = UUID() diff --git a/ElementX/Sources/Application/Navigation/NavigationTabCoordinator.swift b/ElementX/Sources/Application/Navigation/NavigationTabCoordinator.swift index ff7935add..0ada38c54 100644 --- a/ElementX/Sources/Application/Navigation/NavigationTabCoordinator.swift +++ b/ElementX/Sources/Application/Navigation/NavigationTabCoordinator.swift @@ -17,7 +17,6 @@ import SwiftUI var dismissalCallback: (() -> Void)? } - @MainActor @Observable class TabDetails { /// A unique tab that identifies the tab for selection. let tag: Tag @@ -58,7 +57,7 @@ import SwiftUI module.id } - @MainActor var coordinator: CoordinatorProtocol? { + var coordinator: CoordinatorProtocol? { module.coordinator } } diff --git a/ElementX/Sources/Application/Settings/AnalyticsConfiguration.swift b/ElementX/Sources/Application/Settings/AnalyticsConfiguration.swift index 036551d69..07aaa5da7 100644 --- a/ElementX/Sources/Application/Settings/AnalyticsConfiguration.swift +++ b/ElementX/Sources/Application/Settings/AnalyticsConfiguration.swift @@ -9,7 +9,7 @@ import Foundation /// A type that represents how to set up the analytics module in the app. -struct AnalyticsConfiguration { +nonisolated struct AnalyticsConfiguration { /// The host to use for PostHog analytics. let host: String /// The public key for submitting analytics. diff --git a/ElementX/Sources/Application/Settings/AnalyticsConsentState.swift b/ElementX/Sources/Application/Settings/AnalyticsConsentState.swift index 3ae760faa..35f7d20d4 100644 --- a/ElementX/Sources/Application/Settings/AnalyticsConsentState.swift +++ b/ElementX/Sources/Application/Settings/AnalyticsConsentState.swift @@ -8,7 +8,7 @@ import Foundation -enum AnalyticsConsentState: String, Codable { +nonisolated enum AnalyticsConsentState: String, Codable { case optedOut case optedIn case unknown diff --git a/ElementX/Sources/Application/Settings/AppAppearance.swift b/ElementX/Sources/Application/Settings/AppAppearance.swift index dab31796f..311e1a37a 100644 --- a/ElementX/Sources/Application/Settings/AppAppearance.swift +++ b/ElementX/Sources/Application/Settings/AppAppearance.swift @@ -9,7 +9,7 @@ import SwiftUI /// Used to specify the user's app specific appearance preference -enum AppAppearance: CaseIterable, Codable { +nonisolated enum AppAppearance: CaseIterable, Codable { case system case dark case light diff --git a/ElementX/Sources/Application/Settings/AppSettings.swift b/ElementX/Sources/Application/Settings/AppSettings.swift index 16f0947f0..9053a9d76 100644 --- a/ElementX/Sources/Application/Settings/AppSettings.swift +++ b/ElementX/Sources/Application/Settings/AppSettings.swift @@ -14,7 +14,7 @@ import Foundation import SwiftUI /// Common settings between app and NSE -protocol CommonSettingsProtocol: AnyObject, Sendable { +nonisolated protocol CommonSettingsProtocol: AnyObject, Sendable { var lastNotificationBootTime: TimeInterval? { get set } var selectedNotificationTone: NotificationTone? { get set } @@ -27,7 +27,7 @@ protocol CommonSettingsProtocol: AnyObject, Sendable { var hideQuietNotificationAlerts: Bool { get } } -enum AppBuildType { +nonisolated enum AppBuildType { case debug case nightly case release @@ -36,7 +36,7 @@ enum AppBuildType { /// Store Element specific app settings. /// /// State is persisted in `UserDefaults`, which is thread-safe per Apple's documentation, hence `@unchecked`. -final class AppSettings: @unchecked Sendable { +final nonisolated class AppSettings: @unchecked Sendable { fileprivate enum UserDefaultsKeys: String, PreferenceKeyable { case lastVersionLaunched case seenInvites @@ -173,16 +173,16 @@ final class AppSettings: @unchecked Sendable { /// used to detect when migrations should be run. When `nil` the app may have been /// deleted between runs so should clear data in the shared container and keychain. @UserPreference - var lastVersionLaunched: String? + nonisolated(unsafe) var lastVersionLaunched: String? /// The Set of room identifiers of invites that the user already saw in the invites list. /// This Set is being used to implement badges for unread invites. @UserPreference - var seenInvites: Set + nonisolated(unsafe) var seenInvites: Set /// Defaults to `true` for new users, and we use a migration to set it to `false` for existing users. @UserPreference - var hasSeenNewSoundBanner: Bool + nonisolated(unsafe) var hasSeenNewSoundBanner: Bool /// The initial set of account providers shown to the user in the authentication flow. /// @@ -227,7 +227,7 @@ final class AppSettings: @unchecked Sendable { let elementProAppStoreURL: URL = "https://apps.apple.com/app/element-pro-for-work/id6502951615" @UserPreference - var appAppearance: AppAppearance + nonisolated(unsafe) var appAppearance: AppAppearance // MARK: - Security @@ -239,7 +239,7 @@ final class AppSettings: @unchecked Sendable { let appLockPINCodeBlockList = ["0000", "1234"] /// The number of attempts the user has made to unlock the app with a PIN code (resets when unlocked). @UserPreference - var appLockNumberOfPINAttempts: Int + nonisolated(unsafe) var appLockNumberOfPINAttempts: Int // MARK: - Authentication @@ -247,15 +247,17 @@ final class AppSettings: @unchecked Sendable { let oAuthStaticRegistrations: [URL: String] = ["https://id.thirdroom.io/realms/thirdroom": "elementx"] /// The redirect URL used for OAuth. For the normal case we don't actually need the bundle ID as the web authentication session handles the redirect internally. /// However in the case where MAS sends the user to an external app, we need to make sure that the system will open the correct variant of the app (e.g. Nightly). - private(set) var oAuthRedirectURL: URL! = URL(string: "https://element.io/oauth/ios/\(InfoPlistReader.main.bundleIdentifier)") + private(set) nonisolated(unsafe) var oAuthRedirectURL: URL! = URL(string: "https://element.io/oauth/ios/\(InfoPlistReader.main.bundleIdentifier)") - private(set) lazy var oAuthConfiguration = OAuthConfiguration(clientName: InfoPlistReader.main.bundleDisplayName, - redirectURI: oAuthRedirectURL, - clientURI: websiteURL, - logoURI: logoURL, - tosURI: acceptableUseURL, - policyURI: privacyURL, - staticRegistrations: oAuthStaticRegistrations.mapKeys { $0.absoluteString }) + var oAuthConfiguration: OAuthConfiguration { + OAuthConfiguration(clientName: InfoPlistReader.main.bundleDisplayName, + redirectURI: oAuthRedirectURL, + clientURI: websiteURL, + logoURI: logoURL, + tosURI: acceptableUseURL, + policyURI: privacyURL, + staticRegistrations: oAuthStaticRegistrations.mapKeys { $0.absoluteString }) + } /// Whether or not the Create Account button is shown on the start screen. /// @@ -278,33 +280,33 @@ final class AppSettings: @unchecked Sendable { } @UserPreference - var enableNotifications: Bool + nonisolated(unsafe) var enableNotifications: Bool @UserPreference - var enableInAppNotifications: Bool + nonisolated(unsafe) var enableInAppNotifications: Bool @UserPreference - var hideQuietNotificationAlerts: Bool + nonisolated(unsafe) var hideQuietNotificationAlerts: Bool /// Tag describing which set of device specific rules a pusher executes. @UserPreference - var pusherProfileTag: String? + nonisolated(unsafe) var pusherProfileTag: String? /// The device's last boot time as recorded by the NSE. @UserPreference - var lastNotificationBootTime: TimeInterval? + nonisolated(unsafe) var lastNotificationBootTime: TimeInterval? /// The sound played when delivering noisy notifications. If nil, use the ElementX default @UserPreference - var selectedNotificationTone: NotificationTone? + nonisolated(unsafe) var selectedNotificationTone: NotificationTone? // MARK: - Logging @UserPreference - var logLevel: LogLevel + nonisolated(unsafe) var logLevel: LogLevel @UserPreference - var traceLogPacks: Set + nonisolated(unsafe) var traceLogPacks: Set // MARK: - Bug report @@ -332,46 +334,46 @@ final class AppSettings: @unchecked Sendable { /// Whether the user has opted in to send analytics. @UserPreference - var analyticsConsentState: AnalyticsConsentState + nonisolated(unsafe) var analyticsConsentState: AnalyticsConsentState @UserPreference - var hasRunNotificationPermissionsOnboarding: Bool + nonisolated(unsafe) var hasRunNotificationPermissionsOnboarding: Bool @UserPreference - var hasRunIdentityConfirmationOnboarding: Bool + nonisolated(unsafe) var hasRunIdentityConfirmationOnboarding: Bool @UserPreference - var hasRequestedLocationAlwaysLocationAuthorization: Bool + nonisolated(unsafe) var hasRequestedLocationAlwaysLocationAuthorization: Bool @UserPreference - var frequentlyUsedSystemEmojis: [FrequentlyUsedEmoji] + nonisolated(unsafe) var frequentlyUsedSystemEmojis: [FrequentlyUsedEmoji] // MARK: - Live Location @UserPreference - var liveLocationSharingSessionsByRoomID: [String: LiveLocationSession] + nonisolated(unsafe) var liveLocationSharingSessionsByRoomID: [String: LiveLocationSession] @UserPreference - var liveLocationMinimumDistanceUpdate: Int + nonisolated(unsafe) var liveLocationMinimumDistanceUpdate: Int @UserPreference - var liveLocationDisclaimerDisplayed: Bool + nonisolated(unsafe) var liveLocationDisclaimerDisplayed: Bool // MARK: - Home Screen @UserPreference - var roomListActivityVisibility: RoomListActivityVisibility + nonisolated(unsafe) var roomListActivityVisibility: RoomListActivityVisibility // MARK: - Room Screen @UserPreference - var viewSourceEnabled: Bool + nonisolated(unsafe) var viewSourceEnabled: Bool @UserPreference - var optimizeMediaUploads: Bool + nonisolated(unsafe) var optimizeMediaUploads: Bool @UserPreference - var voiceMessagePlaybackSpeed: AudioPlaybackSpeed + nonisolated(unsafe) var voiceMessagePlaybackSpeed: AudioPlaybackSpeed /// Whether or not to show a warning on the media caption composer so the user knows /// that captions might not be visible to users who are using other Matrix clients. @@ -390,7 +392,7 @@ final class AppSettings: @unchecked Sendable { let elementCallPosthogSentryDSN = "https://3bd2f95ba5554d4497da7153b552ffb5@sentry.tools.element.io/41" @UserPreference - var elementCallBaseURLOverride: URL? + nonisolated(unsafe) var elementCallBaseURLOverride: URL? // MARK: - Users @@ -413,50 +415,50 @@ final class AppSettings: @unchecked Sendable { // MARK: - Presence @UserPreference - var sharePresence: Bool + nonisolated(unsafe) var sharePresence: Bool // MARK: - Feature Flags /// Others @UserPreference - var fuzzyRoomListSearchEnabled: Bool + nonisolated(unsafe) var fuzzyRoomListSearchEnabled: Bool @UserPreference - var lowPriorityFilterEnabled: Bool + nonisolated(unsafe) var lowPriorityFilterEnabled: Bool /// Configuration to enable only signed device isolation mode for crypto. In this mode only devices signed by their owner will be considered in e2ee rooms. @UserPreference - var enableOnlySignedDeviceIsolationMode: Bool + nonisolated(unsafe) var enableOnlySignedDeviceIsolationMode: Bool @UserPreference - var knockingEnabled: Bool + nonisolated(unsafe) var knockingEnabled: Bool @UserPreference - var threadsEnabled: Bool + nonisolated(unsafe) var threadsEnabled: Bool @UserPreference - var roomThreadListEnabled: Bool + nonisolated(unsafe) var roomThreadListEnabled: Bool @UserPreference - var focusEventOnNotificationTap: Bool + nonisolated(unsafe) var focusEventOnNotificationTap: Bool @UserPreference - var linkPreviewsEnabled: Bool + nonisolated(unsafe) var linkPreviewsEnabled: Bool @UserPreference - var jumpToReadMarkerEnabled: Bool + nonisolated(unsafe) var jumpToReadMarkerEnabled: Bool @UserPreference - var linkNewDeviceEnabled: Bool + nonisolated(unsafe) var linkNewDeviceEnabled: Bool @UserPreference - var automaticBackPaginationEnabled: Bool + nonisolated(unsafe) var automaticBackPaginationEnabled: Bool @UserPreference - var clientPausingAndResumingEnabled: Bool + nonisolated(unsafe) var clientPausingAndResumingEnabled: Bool @UserPreference - var developerOptionsEnabled: Bool + nonisolated(unsafe) var developerOptionsEnabled: Bool init(store: UserDefaultsProtocol) { // UserDefaults to be used on reads and writes. @@ -509,9 +511,9 @@ final class AppSettings: @unchecked Sendable { } } -extension AppSettings: CommonSettingsProtocol { } +nonisolated extension AppSettings: CommonSettingsProtocol { } -private extension UserPreference { +private nonisolated extension UserPreference { convenience init(key: AppSettings.UserDefaultsKeys, defaultValue: T, storage backingStorage: UserDefaultsProtocol, mode: Mode = .localOverRemote) { self.init(key: key as any PreferenceKeyable, defaultValue: defaultValue, storage: backingStorage, mode: mode) } diff --git a/ElementX/Sources/Application/Settings/AudioPlaybackSpeed.swift b/ElementX/Sources/Application/Settings/AudioPlaybackSpeed.swift index 27f123613..6f5d062de 100644 --- a/ElementX/Sources/Application/Settings/AudioPlaybackSpeed.swift +++ b/ElementX/Sources/Application/Settings/AudioPlaybackSpeed.swift @@ -5,7 +5,7 @@ // Please see LICENSE files in the repository root for full details. // -enum AudioPlaybackSpeed: Float, CaseIterable, Codable { +nonisolated enum AudioPlaybackSpeed: Float, CaseIterable, Codable { case `default` = 1.0 case fast = 1.5 case fastest = 2.0 diff --git a/ElementX/Sources/Application/Settings/FrequentlyUsedEmoji.swift b/ElementX/Sources/Application/Settings/FrequentlyUsedEmoji.swift index 40700d804..8f7ef3b2b 100644 --- a/ElementX/Sources/Application/Settings/FrequentlyUsedEmoji.swift +++ b/ElementX/Sources/Application/Settings/FrequentlyUsedEmoji.swift @@ -6,7 +6,7 @@ // Please see LICENSE files in the repository root for full details. // -struct FrequentlyUsedEmoji: Codable, Hashable { +nonisolated struct FrequentlyUsedEmoji: Codable, Hashable { let count: UInt let key: String diff --git a/ElementX/Sources/Application/Settings/LiveLocationSession.swift b/ElementX/Sources/Application/Settings/LiveLocationSession.swift index cd60b8f52..26c97dcfe 100644 --- a/ElementX/Sources/Application/Settings/LiveLocationSession.swift +++ b/ElementX/Sources/Application/Settings/LiveLocationSession.swift @@ -7,7 +7,7 @@ import Foundation -struct LiveLocationSession: Codable, Equatable { +nonisolated struct LiveLocationSession: Codable, Equatable { let eventID: String let expirationDate: Date } diff --git a/ElementX/Sources/Application/Settings/MapTilerSettings.swift b/ElementX/Sources/Application/Settings/MapTilerSettings.swift index cb74d4e78..8de9052da 100644 --- a/ElementX/Sources/Application/Settings/MapTilerSettings.swift +++ b/ElementX/Sources/Application/Settings/MapTilerSettings.swift @@ -12,7 +12,7 @@ import Foundation /// /// Either resolves to a locally-bundled MapTiler configuration, or to a remote /// `style.json` URL -enum MapTilerSettings: Equatable { +nonisolated enum MapTilerSettings: Equatable { /// All of the configuration necessary to use MapTiler maps. /// /// The style IDs need to be generated with the account that the API key belongs to. For more information read diff --git a/ElementX/Sources/Application/Settings/OAuthConfiguration.swift b/ElementX/Sources/Application/Settings/OAuthConfiguration.swift index 7b0030741..8932145ff 100644 --- a/ElementX/Sources/Application/Settings/OAuthConfiguration.swift +++ b/ElementX/Sources/Application/Settings/OAuthConfiguration.swift @@ -9,7 +9,7 @@ import Foundation import MatrixRustSDK -struct OAuthConfiguration { +nonisolated struct OAuthConfiguration { let clientName: String let redirectURI: URL let clientURI: URL @@ -22,7 +22,7 @@ struct OAuthConfiguration { #if canImport(MatrixRustSDK) import MatrixRustSDK -extension OAuthConfiguration { +nonisolated extension OAuthConfiguration { var rustValue: MatrixRustSDK.OAuthConfiguration { MatrixRustSDK.OAuthConfiguration(clientName: clientName, redirectUri: redirectURI.absoluteString, diff --git a/ElementX/Sources/Application/Settings/RageshakeConfiguration.swift b/ElementX/Sources/Application/Settings/RageshakeConfiguration.swift index 9232be54c..5dac88273 100644 --- a/ElementX/Sources/Application/Settings/RageshakeConfiguration.swift +++ b/ElementX/Sources/Application/Settings/RageshakeConfiguration.swift @@ -9,7 +9,7 @@ import Foundation /// A type that represents how rageshakes are collected by the app. -enum RageshakeConfiguration: Equatable, Codable { +nonisolated enum RageshakeConfiguration: Equatable, Codable { /// Rageshakes should be sent to the provided URL case url(URL) /// Rageshakes are disabled. diff --git a/ElementX/Sources/Application/Settings/RemotePreference.swift b/ElementX/Sources/Application/Settings/RemotePreference.swift index eea8ac740..33dc2f809 100644 --- a/ElementX/Sources/Application/Settings/RemotePreference.swift +++ b/ElementX/Sources/Application/Settings/RemotePreference.swift @@ -13,7 +13,7 @@ import Combine /// /// Unlike ``UserPreference``, this type of setting isn't settable by the user, nor is the /// remote value persisted between app launches. -class RemotePreference { +nonisolated class RemotePreference { private let defaultValue: T private let subject: CurrentValueSubject var publisher: CurrentValuePublisher { diff --git a/ElementX/Sources/Application/Settings/RoomListActivityVisibility.swift b/ElementX/Sources/Application/Settings/RoomListActivityVisibility.swift index 40fca1a37..d74cbdd75 100644 --- a/ElementX/Sources/Application/Settings/RoomListActivityVisibility.swift +++ b/ElementX/Sources/Application/Settings/RoomListActivityVisibility.swift @@ -5,7 +5,7 @@ // Please see LICENSE files in the repository root for full details. // -enum RoomListActivityVisibility: String, CaseIterable, Codable { +nonisolated enum RoomListActivityVisibility: String, CaseIterable, Codable { /// Show unread badges for all unread messages (the default). case current /// Don't show badges but bold unread room names and their latest message diff --git a/ElementX/Sources/Application/Settings/TrackedUserDefaults.swift b/ElementX/Sources/Application/Settings/TrackedUserDefaults.swift index 2d222fb5d..cb917fe1e 100644 --- a/ElementX/Sources/Application/Settings/TrackedUserDefaults.swift +++ b/ElementX/Sources/Application/Settings/TrackedUserDefaults.swift @@ -7,7 +7,7 @@ import Foundation -final class TrackedUserDefaults: UserDefaults, UserDefaultsProtocol { +final nonisolated class TrackedUserDefaults: UserDefaults, UserDefaultsProtocol { private let lock = NSLock() private nonisolated(unsafe) var _trackedSuites: [String] = [] diff --git a/ElementX/Sources/Application/Settings/UserDefaultsProtocol.swift b/ElementX/Sources/Application/Settings/UserDefaultsProtocol.swift index 35a4b0763..80544ac65 100644 --- a/ElementX/Sources/Application/Settings/UserDefaultsProtocol.swift +++ b/ElementX/Sources/Application/Settings/UserDefaultsProtocol.swift @@ -8,7 +8,7 @@ import Foundation -public protocol UserDefaultsProtocol: AnyObject { +public nonisolated protocol UserDefaultsProtocol: AnyObject { func data(forKey key: String) -> Data? func object(forKey key: String) -> Any? func removeObject(forKey key: String) diff --git a/ElementX/Sources/Application/Settings/UserPreference.swift b/ElementX/Sources/Application/Settings/UserPreference.swift index 488a111e6..53fea0b9f 100644 --- a/ElementX/Sources/Application/Settings/UserPreference.swift +++ b/ElementX/Sources/Application/Settings/UserPreference.swift @@ -13,7 +13,7 @@ import Foundation /// to listen for value changes. The publisher does not skip consecutive duplicates, as there is no /// `Equatable` enforcement at this level. @propertyWrapper -final class UserPreference { +final nonisolated class UserPreference { static var remotePrefix: String { "remote-" } @@ -94,7 +94,7 @@ final class UserPreference { // MARK: - UserPreference convenience initializers -extension UserPreference { +nonisolated extension UserPreference { convenience init(key: any PreferenceKeyable, defaultValue: T, storage backingStorage: UserDefaultsProtocol, mode: Mode = .localOverRemote) { let storage: any KeyedStorage = UserDefaultsStorage(userDefaults: backingStorage) @@ -108,11 +108,11 @@ extension UserPreference { // MARK: - Keys -protocol PreferenceKeyable: RawRepresentable where RawValue == String { } +nonisolated protocol PreferenceKeyable: RawRepresentable where RawValue == String { } // MARK: - Storage -protocol KeyedStorage { +nonisolated protocol KeyedStorage { associatedtype Value: Codable subscript(key: String) -> Value? { get set } @@ -122,7 +122,7 @@ protocol KeyedStorage { /// /// When used with a `Value` that conforms to `PlistRepresentable` the Codable encode/decode /// phase is skipped, and values are stored natively in the plist. -final class UserDefaultsStorage: KeyedStorage { +final nonisolated class UserDefaultsStorage: KeyedStorage { private let userDefaults: UserDefaultsProtocol init(userDefaults: UserDefaultsProtocol) { @@ -181,11 +181,11 @@ final class UserDefaultsStorage: KeyedStorage { } } -private protocol Nullable { +private nonisolated protocol Nullable { var isNil: Bool { get } } -extension Optional: Nullable { +nonisolated extension Optional: Nullable { var isNil: Bool { switch self { case .none: @@ -198,13 +198,13 @@ extension Optional: Nullable { } } -extension Dictionary: KeyedStorage where Key == String, Value: Codable { } +nonisolated extension Dictionary: KeyedStorage where Key == String, Value: Codable { } // MARK: - PlistRepresentable /// A protocol to mark types as being plist compliant. /// UserDefaultsStorage uses this protocol to avoid to encode/decode with Codable plist compliant values. -protocol PlistRepresentable { } +nonisolated protocol PlistRepresentable { } extension Bool: PlistRepresentable { } extension String: PlistRepresentable { } diff --git a/ElementX/Sources/Application/Settings/VolatileUserDefaults.swift b/ElementX/Sources/Application/Settings/VolatileUserDefaults.swift index 8e0224d09..f9dcc71fa 100644 --- a/ElementX/Sources/Application/Settings/VolatileUserDefaults.swift +++ b/ElementX/Sources/Application/Settings/VolatileUserDefaults.swift @@ -7,7 +7,7 @@ import Foundation -public final class VolatileUserDefaults: UserDefaultsProtocol, Sendable { +public final nonisolated class VolatileUserDefaults: UserDefaultsProtocol, Sendable { private let lock = NSLock() private nonisolated(unsafe) var _storage: [String: Any] diff --git a/ElementX/Sources/Application/TargetConfiguration.swift b/ElementX/Sources/Application/TargetConfiguration.swift index 8c829c594..c58226727 100644 --- a/ElementX/Sources/Application/TargetConfiguration.swift +++ b/ElementX/Sources/Application/TargetConfiguration.swift @@ -11,7 +11,7 @@ import Foundation import MapLibre import MatrixRustSDK -enum Target: String { +nonisolated enum Target: String { case mainApp = "elementx" case nse case shareExtension = "shareextension" diff --git a/ElementX/Sources/Application/Windowing/WindowManagerProtocol.swift b/ElementX/Sources/Application/Windowing/WindowManagerProtocol.swift index a5b2a314c..d96e98d96 100644 --- a/ElementX/Sources/Application/Windowing/WindowManagerProtocol.swift +++ b/ElementX/Sources/Application/Windowing/WindowManagerProtocol.swift @@ -18,7 +18,6 @@ protocol SecureWindowManagerDelegate: AnyObject { func windowManagerDidConfigureWindows(_ windowManager: SecureWindowManagerProtocol) } -@MainActor protocol SecureWindowManagerProtocol: WindowManagerProtocol { var delegate: SecureWindowManagerDelegate? { get set } diff --git a/ElementX/Sources/FlowCoordinators/AuthenticationFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/AuthenticationFlowCoordinator.swift index 5a935d54d..b5105b786 100644 --- a/ElementX/Sources/FlowCoordinators/AuthenticationFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/AuthenticationFlowCoordinator.swift @@ -10,7 +10,6 @@ import Combine import SwiftState import SwiftUI -@MainActor protocol AuthenticationFlowCoordinatorDelegate: AnyObject { func authenticationFlowCoordinator(didLoginWithSession userSession: UserSessionProtocol) } diff --git a/ElementX/Sources/Generated/Strings+Untranslated.swift b/ElementX/Sources/Generated/Strings+Untranslated.swift index 55cfabb3e..ef372cbae 100644 --- a/ElementX/Sources/Generated/Strings+Untranslated.swift +++ b/ElementX/Sources/Generated/Strings+Untranslated.swift @@ -9,7 +9,7 @@ import Foundation // swiftlint:disable explicit_type_interface function_parameter_count identifier_name line_length // swiftlint:disable nesting type_body_length type_name vertical_whitespace_opening_braces -internal enum UntranslatedL10n { +internal nonisolated enum UntranslatedL10n { /// Clear all data currently stored on this device? /// Sign in again to access your account data and messages. internal static var softLogoutClearDataDialogContent: String { return UntranslatedL10n.tr("Untranslated", "soft_logout_clear_data_dialog_content") } @@ -43,7 +43,7 @@ internal enum UntranslatedL10n { // MARK: - Implementation Details -extension UntranslatedL10n { +nonisolated extension UntranslatedL10n { static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String { // No need to check languages, we always default to en for untranslated strings guard let bundle = Bundle.lprojBundle(for: "en") else { return key } diff --git a/ElementX/Sources/Generated/Strings.swift b/ElementX/Sources/Generated/Strings.swift index f81ab6f3f..4a460ce61 100644 --- a/ElementX/Sources/Generated/Strings.swift +++ b/ElementX/Sources/Generated/Strings.swift @@ -9,7 +9,7 @@ import Foundation // swiftlint:disable explicit_type_interface function_parameter_count identifier_name line_length // swiftlint:disable nesting type_body_length type_name vertical_whitespace_opening_braces -internal enum L10n { +internal nonisolated enum L10n { /// Add avatar internal static var a11yAddAvatar: String { return L10n.tr("Localizable", "a11y_add_avatar") } /// Add reaction: %1$@ @@ -3973,7 +3973,7 @@ internal enum L10n { // MARK: - Implementation Details -extension L10n { +nonisolated extension L10n { static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String { // Use preferredLocalizations to get a language that is in the bundle and the user's preferred list of languages. let languages = Bundle.overrideLocalizations ?? Bundle.app.preferredLocalizations diff --git a/ElementX/Sources/Mocks/ClientProxyMock.swift b/ElementX/Sources/Mocks/ClientProxyMock.swift index 0436d406f..a34a79401 100644 --- a/ElementX/Sources/Mocks/ClientProxyMock.swift +++ b/ElementX/Sources/Mocks/ClientProxyMock.swift @@ -122,18 +122,18 @@ extension ClientProxyMock { let joinedRoomIDs = configuration.overrides.joinedRoomIDs switch room.joinRequestType { case .invite where !joinedRoomIDs.contains(room.id): - let roomProxy = await InvitedRoomProxyMock(.init(id: room.id, name: room.name, isSpace: room.isSpace)) + let roomProxy = InvitedRoomProxyMock(.init(id: room.id, name: room.name, isSpace: room.isSpace)) return .invited(roomProxy) case .knock where !joinedRoomIDs.contains(room.id): - let roomProxy = await KnockedRoomProxyMock(.init(id: room.id, name: room.name)) + let roomProxy = KnockedRoomProxyMock(.init(id: room.id, name: room.name)) return .knocked(roomProxy) default: - let roomProxy = await JoinedRoomProxyMock(.init(id: room.id, name: room.name, isSpace: room.isSpace, members: configuration.defaultRoomMembers)) + let roomProxy = JoinedRoomProxyMock(.init(id: room.id, name: room.name, isSpace: room.isSpace, members: configuration.defaultRoomMembers)) roomProxy.loadOrFetchEventDetailsForReturnValue = .success(TimelineEventSDKMock()) return .joined(roomProxy) } } else if let spaceServiceRoom = configuration.spaceServiceConfiguration.topLevelSpaces.first(where: { $0.id == identifier }) { - let roomProxy = await JoinedRoomProxyMock(.init(id: spaceServiceRoom.id, name: spaceServiceRoom.name, isSpace: spaceServiceRoom.isSpace, members: configuration.defaultRoomMembers)) + let roomProxy = JoinedRoomProxyMock(.init(id: spaceServiceRoom.id, name: spaceServiceRoom.name, isSpace: spaceServiceRoom.isSpace, members: configuration.defaultRoomMembers)) roomProxy.loadOrFetchEventDetailsForReturnValue = .success(TimelineEventSDKMock()) return .joined(roomProxy) } else { diff --git a/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift b/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift index b405816a0..1501ef653 100644 --- a/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift +++ b/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift @@ -14,17 +14,17 @@ import Foundation import LocalAuthentication import Photos -class AnalyticsClientMock: AnalyticsClientProtocol, @unchecked Sendable { +nonisolated class AnalyticsClientMock: AnalyticsClientProtocol, @unchecked Sendable { var isRunning: Bool { get { return underlyingIsRunning } set(value) { underlyingIsRunning = value } } - var underlyingIsRunning: Bool! + nonisolated(unsafe) var underlyingIsRunning: Bool! //MARK: - start private let startAnalyticsConfigurationCallsCountLock = NSLock() - private var startAnalyticsConfigurationUnderlyingCallsCount = 0 + private nonisolated(unsafe) var startAnalyticsConfigurationUnderlyingCallsCount = 0 var startAnalyticsConfigurationCallsCount: Int { get { startAnalyticsConfigurationCallsCountLock.withLock { startAnalyticsConfigurationUnderlyingCallsCount } } set { startAnalyticsConfigurationCallsCountLock.withLock { startAnalyticsConfigurationUnderlyingCallsCount = newValue } } @@ -33,18 +33,18 @@ class AnalyticsClientMock: AnalyticsClientProtocol, @unchecked Sendable { return startAnalyticsConfigurationCallsCount > 0 } private let startAnalyticsConfigurationReceivedAnalyticsConfigurationLock = NSLock() - private var startAnalyticsConfigurationUnderlyingReceivedAnalyticsConfiguration: AnalyticsConfiguration? + private nonisolated(unsafe) var startAnalyticsConfigurationUnderlyingReceivedAnalyticsConfiguration: AnalyticsConfiguration? var startAnalyticsConfigurationReceivedAnalyticsConfiguration: AnalyticsConfiguration? { get { startAnalyticsConfigurationReceivedAnalyticsConfigurationLock.withLock { startAnalyticsConfigurationUnderlyingReceivedAnalyticsConfiguration } } set { startAnalyticsConfigurationReceivedAnalyticsConfigurationLock.withLock { startAnalyticsConfigurationUnderlyingReceivedAnalyticsConfiguration = newValue } } } private let startAnalyticsConfigurationReceivedInvocationsLock = NSLock() - private var startAnalyticsConfigurationUnderlyingReceivedInvocations: [AnalyticsConfiguration] = [] + private nonisolated(unsafe) var startAnalyticsConfigurationUnderlyingReceivedInvocations: [AnalyticsConfiguration] = [] var startAnalyticsConfigurationReceivedInvocations: [AnalyticsConfiguration] { get { startAnalyticsConfigurationReceivedInvocationsLock.withLock { startAnalyticsConfigurationUnderlyingReceivedInvocations } } set { startAnalyticsConfigurationReceivedInvocationsLock.withLock { startAnalyticsConfigurationUnderlyingReceivedInvocations = newValue } } } - var startAnalyticsConfigurationClosure: ((AnalyticsConfiguration) -> Void)? + nonisolated(unsafe) var startAnalyticsConfigurationClosure: ((AnalyticsConfiguration) -> Void)? func start(analyticsConfiguration: AnalyticsConfiguration) { startAnalyticsConfigurationCallsCountLock.withLock { startAnalyticsConfigurationUnderlyingCallsCount += 1 } @@ -55,7 +55,7 @@ class AnalyticsClientMock: AnalyticsClientProtocol, @unchecked Sendable { //MARK: - reset private let resetCallsCountLock = NSLock() - private var resetUnderlyingCallsCount = 0 + private nonisolated(unsafe) var resetUnderlyingCallsCount = 0 var resetCallsCount: Int { get { resetCallsCountLock.withLock { resetUnderlyingCallsCount } } set { resetCallsCountLock.withLock { resetUnderlyingCallsCount = newValue } } @@ -63,7 +63,7 @@ class AnalyticsClientMock: AnalyticsClientProtocol, @unchecked Sendable { var resetCalled: Bool { return resetCallsCount > 0 } - var resetClosure: (() -> Void)? + nonisolated(unsafe) var resetClosure: (() -> Void)? func reset() { resetCallsCountLock.withLock { resetUnderlyingCallsCount += 1 } @@ -72,7 +72,7 @@ class AnalyticsClientMock: AnalyticsClientProtocol, @unchecked Sendable { //MARK: - stop private let stopCallsCountLock = NSLock() - private var stopUnderlyingCallsCount = 0 + private nonisolated(unsafe) var stopUnderlyingCallsCount = 0 var stopCallsCount: Int { get { stopCallsCountLock.withLock { stopUnderlyingCallsCount } } set { stopCallsCountLock.withLock { stopUnderlyingCallsCount = newValue } } @@ -80,7 +80,7 @@ class AnalyticsClientMock: AnalyticsClientProtocol, @unchecked Sendable { var stopCalled: Bool { return stopCallsCount > 0 } - var stopClosure: (() -> Void)? + nonisolated(unsafe) var stopClosure: (() -> Void)? func stop() { stopCallsCountLock.withLock { stopUnderlyingCallsCount += 1 } @@ -89,7 +89,7 @@ class AnalyticsClientMock: AnalyticsClientProtocol, @unchecked Sendable { //MARK: - capture private let captureCallsCountLock = NSLock() - private var captureUnderlyingCallsCount = 0 + private nonisolated(unsafe) var captureUnderlyingCallsCount = 0 var captureCallsCount: Int { get { captureCallsCountLock.withLock { captureUnderlyingCallsCount } } set { captureCallsCountLock.withLock { captureUnderlyingCallsCount = newValue } } @@ -98,18 +98,18 @@ class AnalyticsClientMock: AnalyticsClientProtocol, @unchecked Sendable { return captureCallsCount > 0 } private let captureReceivedEventLock = NSLock() - private var captureUnderlyingReceivedEvent: AnalyticsEventProtocol? + private nonisolated(unsafe) var captureUnderlyingReceivedEvent: AnalyticsEventProtocol? var captureReceivedEvent: AnalyticsEventProtocol? { get { captureReceivedEventLock.withLock { captureUnderlyingReceivedEvent } } set { captureReceivedEventLock.withLock { captureUnderlyingReceivedEvent = newValue } } } private let captureReceivedInvocationsLock = NSLock() - private var captureUnderlyingReceivedInvocations: [AnalyticsEventProtocol] = [] + private nonisolated(unsafe) var captureUnderlyingReceivedInvocations: [AnalyticsEventProtocol] = [] var captureReceivedInvocations: [AnalyticsEventProtocol] { get { captureReceivedInvocationsLock.withLock { captureUnderlyingReceivedInvocations } } set { captureReceivedInvocationsLock.withLock { captureUnderlyingReceivedInvocations = newValue } } } - var captureClosure: ((AnalyticsEventProtocol) -> Void)? + nonisolated(unsafe) var captureClosure: ((AnalyticsEventProtocol) -> Void)? func capture(_ event: AnalyticsEventProtocol) { captureCallsCountLock.withLock { captureUnderlyingCallsCount += 1 } @@ -120,7 +120,7 @@ class AnalyticsClientMock: AnalyticsClientProtocol, @unchecked Sendable { //MARK: - screen private let screenCallsCountLock = NSLock() - private var screenUnderlyingCallsCount = 0 + private nonisolated(unsafe) var screenUnderlyingCallsCount = 0 var screenCallsCount: Int { get { screenCallsCountLock.withLock { screenUnderlyingCallsCount } } set { screenCallsCountLock.withLock { screenUnderlyingCallsCount = newValue } } @@ -129,18 +129,18 @@ class AnalyticsClientMock: AnalyticsClientProtocol, @unchecked Sendable { return screenCallsCount > 0 } private let screenReceivedEventLock = NSLock() - private var screenUnderlyingReceivedEvent: AnalyticsScreenProtocol? + private nonisolated(unsafe) var screenUnderlyingReceivedEvent: AnalyticsScreenProtocol? var screenReceivedEvent: AnalyticsScreenProtocol? { get { screenReceivedEventLock.withLock { screenUnderlyingReceivedEvent } } set { screenReceivedEventLock.withLock { screenUnderlyingReceivedEvent = newValue } } } private let screenReceivedInvocationsLock = NSLock() - private var screenUnderlyingReceivedInvocations: [AnalyticsScreenProtocol] = [] + private nonisolated(unsafe) var screenUnderlyingReceivedInvocations: [AnalyticsScreenProtocol] = [] var screenReceivedInvocations: [AnalyticsScreenProtocol] { get { screenReceivedInvocationsLock.withLock { screenUnderlyingReceivedInvocations } } set { screenReceivedInvocationsLock.withLock { screenUnderlyingReceivedInvocations = newValue } } } - var screenClosure: ((AnalyticsScreenProtocol) -> Void)? + nonisolated(unsafe) var screenClosure: ((AnalyticsScreenProtocol) -> Void)? func screen(_ event: AnalyticsScreenProtocol) { screenCallsCountLock.withLock { screenUnderlyingCallsCount += 1 } @@ -151,7 +151,7 @@ class AnalyticsClientMock: AnalyticsClientProtocol, @unchecked Sendable { //MARK: - updateUserProperties private let updateUserPropertiesCallsCountLock = NSLock() - private var updateUserPropertiesUnderlyingCallsCount = 0 + private nonisolated(unsafe) var updateUserPropertiesUnderlyingCallsCount = 0 var updateUserPropertiesCallsCount: Int { get { updateUserPropertiesCallsCountLock.withLock { updateUserPropertiesUnderlyingCallsCount } } set { updateUserPropertiesCallsCountLock.withLock { updateUserPropertiesUnderlyingCallsCount = newValue } } @@ -160,18 +160,18 @@ class AnalyticsClientMock: AnalyticsClientProtocol, @unchecked Sendable { return updateUserPropertiesCallsCount > 0 } private let updateUserPropertiesReceivedEventLock = NSLock() - private var updateUserPropertiesUnderlyingReceivedEvent: AnalyticsEvent.UserProperties? + private nonisolated(unsafe) var updateUserPropertiesUnderlyingReceivedEvent: AnalyticsEvent.UserProperties? var updateUserPropertiesReceivedEvent: AnalyticsEvent.UserProperties? { get { updateUserPropertiesReceivedEventLock.withLock { updateUserPropertiesUnderlyingReceivedEvent } } set { updateUserPropertiesReceivedEventLock.withLock { updateUserPropertiesUnderlyingReceivedEvent = newValue } } } private let updateUserPropertiesReceivedInvocationsLock = NSLock() - private var updateUserPropertiesUnderlyingReceivedInvocations: [AnalyticsEvent.UserProperties] = [] + private nonisolated(unsafe) var updateUserPropertiesUnderlyingReceivedInvocations: [AnalyticsEvent.UserProperties] = [] var updateUserPropertiesReceivedInvocations: [AnalyticsEvent.UserProperties] { get { updateUserPropertiesReceivedInvocationsLock.withLock { updateUserPropertiesUnderlyingReceivedInvocations } } set { updateUserPropertiesReceivedInvocationsLock.withLock { updateUserPropertiesUnderlyingReceivedInvocations = newValue } } } - var updateUserPropertiesClosure: ((AnalyticsEvent.UserProperties) -> Void)? + nonisolated(unsafe) var updateUserPropertiesClosure: ((AnalyticsEvent.UserProperties) -> Void)? func updateUserProperties(_ event: AnalyticsEvent.UserProperties) { updateUserPropertiesCallsCountLock.withLock { updateUserPropertiesUnderlyingCallsCount += 1 } @@ -180,27 +180,27 @@ class AnalyticsClientMock: AnalyticsClientProtocol, @unchecked Sendable { updateUserPropertiesClosure?(event) } } -class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { +nonisolated class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { var signpost: Signposter { get { return underlyingSignpost } set(value) { underlyingSignpost = value } } - var underlyingSignpost: Signposter! + nonisolated(unsafe) var underlyingSignpost: Signposter! var shouldShowAnalyticsPrompt: Bool { get { return underlyingShouldShowAnalyticsPrompt } set(value) { underlyingShouldShowAnalyticsPrompt = value } } - var underlyingShouldShowAnalyticsPrompt: Bool! + nonisolated(unsafe) var underlyingShouldShowAnalyticsPrompt: Bool! var isEnabled: Bool { get { return underlyingIsEnabled } set(value) { underlyingIsEnabled = value } } - var underlyingIsEnabled: Bool! + nonisolated(unsafe) var underlyingIsEnabled: Bool! //MARK: - optIn private let optInCallsCountLock = NSLock() - private var optInUnderlyingCallsCount = 0 + private nonisolated(unsafe) var optInUnderlyingCallsCount = 0 var optInCallsCount: Int { get { optInCallsCountLock.withLock { optInUnderlyingCallsCount } } set { optInCallsCountLock.withLock { optInUnderlyingCallsCount = newValue } } @@ -208,7 +208,7 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { var optInCalled: Bool { return optInCallsCount > 0 } - var optInClosure: (() -> Void)? + nonisolated(unsafe) var optInClosure: (() -> Void)? func optIn() { optInCallsCountLock.withLock { optInUnderlyingCallsCount += 1 } @@ -217,7 +217,7 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { //MARK: - optOut private let optOutCallsCountLock = NSLock() - private var optOutUnderlyingCallsCount = 0 + private nonisolated(unsafe) var optOutUnderlyingCallsCount = 0 var optOutCallsCount: Int { get { optOutCallsCountLock.withLock { optOutUnderlyingCallsCount } } set { optOutCallsCountLock.withLock { optOutUnderlyingCallsCount = newValue } } @@ -225,7 +225,7 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { var optOutCalled: Bool { return optOutCallsCount > 0 } - var optOutClosure: (() -> Void)? + nonisolated(unsafe) var optOutClosure: (() -> Void)? func optOut() { optOutCallsCountLock.withLock { optOutUnderlyingCallsCount += 1 } @@ -234,7 +234,7 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { //MARK: - startIfEnabled private let startIfEnabledCallsCountLock = NSLock() - private var startIfEnabledUnderlyingCallsCount = 0 + private nonisolated(unsafe) var startIfEnabledUnderlyingCallsCount = 0 var startIfEnabledCallsCount: Int { get { startIfEnabledCallsCountLock.withLock { startIfEnabledUnderlyingCallsCount } } set { startIfEnabledCallsCountLock.withLock { startIfEnabledUnderlyingCallsCount = newValue } } @@ -242,7 +242,7 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { var startIfEnabledCalled: Bool { return startIfEnabledCallsCount > 0 } - var startIfEnabledClosure: (() -> Void)? + nonisolated(unsafe) var startIfEnabledClosure: (() -> Void)? func startIfEnabled() { startIfEnabledCallsCountLock.withLock { startIfEnabledUnderlyingCallsCount += 1 } @@ -251,7 +251,7 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { //MARK: - reset private let resetCallsCountLock = NSLock() - private var resetUnderlyingCallsCount = 0 + private nonisolated(unsafe) var resetUnderlyingCallsCount = 0 var resetCallsCount: Int { get { resetCallsCountLock.withLock { resetUnderlyingCallsCount } } set { resetCallsCountLock.withLock { resetUnderlyingCallsCount = newValue } } @@ -259,7 +259,7 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { var resetCalled: Bool { return resetCallsCount > 0 } - var resetClosure: (() -> Void)? + nonisolated(unsafe) var resetClosure: (() -> Void)? func reset() { resetCallsCountLock.withLock { resetUnderlyingCallsCount += 1 } @@ -268,7 +268,7 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { //MARK: - resetConsentState private let resetConsentStateCallsCountLock = NSLock() - private var resetConsentStateUnderlyingCallsCount = 0 + private nonisolated(unsafe) var resetConsentStateUnderlyingCallsCount = 0 var resetConsentStateCallsCount: Int { get { resetConsentStateCallsCountLock.withLock { resetConsentStateUnderlyingCallsCount } } set { resetConsentStateCallsCountLock.withLock { resetConsentStateUnderlyingCallsCount = newValue } } @@ -276,7 +276,7 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { var resetConsentStateCalled: Bool { return resetConsentStateCallsCount > 0 } - var resetConsentStateClosure: (() -> Void)? + nonisolated(unsafe) var resetConsentStateClosure: (() -> Void)? func resetConsentState() { resetConsentStateCallsCountLock.withLock { resetConsentStateUnderlyingCallsCount += 1 } @@ -285,7 +285,7 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { //MARK: - track private let trackScreenDurationCallsCountLock = NSLock() - private var trackScreenDurationUnderlyingCallsCount = 0 + private nonisolated(unsafe) var trackScreenDurationUnderlyingCallsCount = 0 var trackScreenDurationCallsCount: Int { get { trackScreenDurationCallsCountLock.withLock { trackScreenDurationUnderlyingCallsCount } } set { trackScreenDurationCallsCountLock.withLock { trackScreenDurationUnderlyingCallsCount = newValue } } @@ -294,18 +294,18 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { return trackScreenDurationCallsCount > 0 } private let trackScreenDurationReceivedArgumentsLock = NSLock() - private var trackScreenDurationUnderlyingReceivedArguments: (screen: AnalyticsEvent.MobileScreen.ScreenName, milliseconds: Int?)? + private nonisolated(unsafe) var trackScreenDurationUnderlyingReceivedArguments: (screen: AnalyticsEvent.MobileScreen.ScreenName, milliseconds: Int?)? var trackScreenDurationReceivedArguments: (screen: AnalyticsEvent.MobileScreen.ScreenName, milliseconds: Int?)? { get { trackScreenDurationReceivedArgumentsLock.withLock { trackScreenDurationUnderlyingReceivedArguments } } set { trackScreenDurationReceivedArgumentsLock.withLock { trackScreenDurationUnderlyingReceivedArguments = newValue } } } private let trackScreenDurationReceivedInvocationsLock = NSLock() - private var trackScreenDurationUnderlyingReceivedInvocations: [(screen: AnalyticsEvent.MobileScreen.ScreenName, milliseconds: Int?)] = [] + private nonisolated(unsafe) var trackScreenDurationUnderlyingReceivedInvocations: [(screen: AnalyticsEvent.MobileScreen.ScreenName, milliseconds: Int?)] = [] var trackScreenDurationReceivedInvocations: [(screen: AnalyticsEvent.MobileScreen.ScreenName, milliseconds: Int?)] { get { trackScreenDurationReceivedInvocationsLock.withLock { trackScreenDurationUnderlyingReceivedInvocations } } set { trackScreenDurationReceivedInvocationsLock.withLock { trackScreenDurationUnderlyingReceivedInvocations = newValue } } } - var trackScreenDurationClosure: ((AnalyticsEvent.MobileScreen.ScreenName, Int?) -> Void)? + nonisolated(unsafe) var trackScreenDurationClosure: ((AnalyticsEvent.MobileScreen.ScreenName, Int?) -> Void)? func track(screen: AnalyticsEvent.MobileScreen.ScreenName, duration milliseconds: Int?) { trackScreenDurationCallsCountLock.withLock { trackScreenDurationUnderlyingCallsCount += 1 } @@ -316,7 +316,7 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { //MARK: - trackInteraction private let trackInteractionIndexNameCallsCountLock = NSLock() - private var trackInteractionIndexNameUnderlyingCallsCount = 0 + private nonisolated(unsafe) var trackInteractionIndexNameUnderlyingCallsCount = 0 var trackInteractionIndexNameCallsCount: Int { get { trackInteractionIndexNameCallsCountLock.withLock { trackInteractionIndexNameUnderlyingCallsCount } } set { trackInteractionIndexNameCallsCountLock.withLock { trackInteractionIndexNameUnderlyingCallsCount = newValue } } @@ -325,18 +325,18 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { return trackInteractionIndexNameCallsCount > 0 } private let trackInteractionIndexNameReceivedArgumentsLock = NSLock() - private var trackInteractionIndexNameUnderlyingReceivedArguments: (index: Int?, name: AnalyticsEvent.Interaction.Name)? + private nonisolated(unsafe) var trackInteractionIndexNameUnderlyingReceivedArguments: (index: Int?, name: AnalyticsEvent.Interaction.Name)? var trackInteractionIndexNameReceivedArguments: (index: Int?, name: AnalyticsEvent.Interaction.Name)? { get { trackInteractionIndexNameReceivedArgumentsLock.withLock { trackInteractionIndexNameUnderlyingReceivedArguments } } set { trackInteractionIndexNameReceivedArgumentsLock.withLock { trackInteractionIndexNameUnderlyingReceivedArguments = newValue } } } private let trackInteractionIndexNameReceivedInvocationsLock = NSLock() - private var trackInteractionIndexNameUnderlyingReceivedInvocations: [(index: Int?, name: AnalyticsEvent.Interaction.Name)] = [] + private nonisolated(unsafe) var trackInteractionIndexNameUnderlyingReceivedInvocations: [(index: Int?, name: AnalyticsEvent.Interaction.Name)] = [] var trackInteractionIndexNameReceivedInvocations: [(index: Int?, name: AnalyticsEvent.Interaction.Name)] { get { trackInteractionIndexNameReceivedInvocationsLock.withLock { trackInteractionIndexNameUnderlyingReceivedInvocations } } set { trackInteractionIndexNameReceivedInvocationsLock.withLock { trackInteractionIndexNameUnderlyingReceivedInvocations = newValue } } } - var trackInteractionIndexNameClosure: ((Int?, AnalyticsEvent.Interaction.Name) -> Void)? + nonisolated(unsafe) var trackInteractionIndexNameClosure: ((Int?, AnalyticsEvent.Interaction.Name) -> Void)? func trackInteraction(index: Int?, name: AnalyticsEvent.Interaction.Name) { trackInteractionIndexNameCallsCountLock.withLock { trackInteractionIndexNameUnderlyingCallsCount += 1 } @@ -347,7 +347,7 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { //MARK: - trackError private let trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserCallsCountLock = NSLock() - private var trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserUnderlyingCallsCount = 0 + private nonisolated(unsafe) var trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserUnderlyingCallsCount = 0 var trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserCallsCount: Int { get { trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserCallsCountLock.withLock { trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserUnderlyingCallsCount } } set { trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserCallsCountLock.withLock { trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserUnderlyingCallsCount = newValue } } @@ -356,18 +356,18 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { return trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserCallsCount > 0 } private let trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserReceivedArgumentsLock = NSLock() - private var trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserUnderlyingReceivedArguments: (context: String?, domain: AnalyticsEvent.Error.Domain, name: AnalyticsEvent.Error.Name, timeToDecryptMillis: Int?, eventLocalAgeMillis: Int?, isFederated: Bool?, isMatrixDotOrg: Bool?, userTrustsOwnIdentity: Bool?, wasVisibleToUser: Bool?)? + private nonisolated(unsafe) var trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserUnderlyingReceivedArguments: (context: String?, domain: AnalyticsEvent.Error.Domain, name: AnalyticsEvent.Error.Name, timeToDecryptMillis: Int?, eventLocalAgeMillis: Int?, isFederated: Bool?, isMatrixDotOrg: Bool?, userTrustsOwnIdentity: Bool?, wasVisibleToUser: Bool?)? var trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserReceivedArguments: (context: String?, domain: AnalyticsEvent.Error.Domain, name: AnalyticsEvent.Error.Name, timeToDecryptMillis: Int?, eventLocalAgeMillis: Int?, isFederated: Bool?, isMatrixDotOrg: Bool?, userTrustsOwnIdentity: Bool?, wasVisibleToUser: Bool?)? { get { trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserReceivedArgumentsLock.withLock { trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserUnderlyingReceivedArguments } } set { trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserReceivedArgumentsLock.withLock { trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserUnderlyingReceivedArguments = newValue } } } private let trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserReceivedInvocationsLock = NSLock() - private var trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserUnderlyingReceivedInvocations: [(context: String?, domain: AnalyticsEvent.Error.Domain, name: AnalyticsEvent.Error.Name, timeToDecryptMillis: Int?, eventLocalAgeMillis: Int?, isFederated: Bool?, isMatrixDotOrg: Bool?, userTrustsOwnIdentity: Bool?, wasVisibleToUser: Bool?)] = [] + private nonisolated(unsafe) var trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserUnderlyingReceivedInvocations: [(context: String?, domain: AnalyticsEvent.Error.Domain, name: AnalyticsEvent.Error.Name, timeToDecryptMillis: Int?, eventLocalAgeMillis: Int?, isFederated: Bool?, isMatrixDotOrg: Bool?, userTrustsOwnIdentity: Bool?, wasVisibleToUser: Bool?)] = [] var trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserReceivedInvocations: [(context: String?, domain: AnalyticsEvent.Error.Domain, name: AnalyticsEvent.Error.Name, timeToDecryptMillis: Int?, eventLocalAgeMillis: Int?, isFederated: Bool?, isMatrixDotOrg: Bool?, userTrustsOwnIdentity: Bool?, wasVisibleToUser: Bool?)] { get { trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserReceivedInvocationsLock.withLock { trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserUnderlyingReceivedInvocations } } set { trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserReceivedInvocationsLock.withLock { trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserUnderlyingReceivedInvocations = newValue } } } - var trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserClosure: ((String?, AnalyticsEvent.Error.Domain, AnalyticsEvent.Error.Name, Int?, Int?, Bool?, Bool?, Bool?, Bool?) -> Void)? + nonisolated(unsafe) var trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserClosure: ((String?, AnalyticsEvent.Error.Domain, AnalyticsEvent.Error.Name, Int?, Int?, Bool?, Bool?, Bool?, Bool?) -> Void)? func trackError(context: String?, domain: AnalyticsEvent.Error.Domain, name: AnalyticsEvent.Error.Name, timeToDecryptMillis: Int?, eventLocalAgeMillis: Int?, isFederated: Bool?, isMatrixDotOrg: Bool?, userTrustsOwnIdentity: Bool?, wasVisibleToUser: Bool?) { trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserCallsCountLock.withLock { trackErrorContextDomainNameTimeToDecryptMillisEventLocalAgeMillisIsFederatedIsMatrixDotOrgUserTrustsOwnIdentityWasVisibleToUserUnderlyingCallsCount += 1 } @@ -378,7 +378,7 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { //MARK: - trackCreatedRoom private let trackCreatedRoomIsDMCallsCountLock = NSLock() - private var trackCreatedRoomIsDMUnderlyingCallsCount = 0 + private nonisolated(unsafe) var trackCreatedRoomIsDMUnderlyingCallsCount = 0 var trackCreatedRoomIsDMCallsCount: Int { get { trackCreatedRoomIsDMCallsCountLock.withLock { trackCreatedRoomIsDMUnderlyingCallsCount } } set { trackCreatedRoomIsDMCallsCountLock.withLock { trackCreatedRoomIsDMUnderlyingCallsCount = newValue } } @@ -387,18 +387,18 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { return trackCreatedRoomIsDMCallsCount > 0 } private let trackCreatedRoomIsDMReceivedIsDMLock = NSLock() - private var trackCreatedRoomIsDMUnderlyingReceivedIsDM: Bool? + private nonisolated(unsafe) var trackCreatedRoomIsDMUnderlyingReceivedIsDM: Bool? var trackCreatedRoomIsDMReceivedIsDM: Bool? { get { trackCreatedRoomIsDMReceivedIsDMLock.withLock { trackCreatedRoomIsDMUnderlyingReceivedIsDM } } set { trackCreatedRoomIsDMReceivedIsDMLock.withLock { trackCreatedRoomIsDMUnderlyingReceivedIsDM = newValue } } } private let trackCreatedRoomIsDMReceivedInvocationsLock = NSLock() - private var trackCreatedRoomIsDMUnderlyingReceivedInvocations: [Bool] = [] + private nonisolated(unsafe) var trackCreatedRoomIsDMUnderlyingReceivedInvocations: [Bool] = [] var trackCreatedRoomIsDMReceivedInvocations: [Bool] { get { trackCreatedRoomIsDMReceivedInvocationsLock.withLock { trackCreatedRoomIsDMUnderlyingReceivedInvocations } } set { trackCreatedRoomIsDMReceivedInvocationsLock.withLock { trackCreatedRoomIsDMUnderlyingReceivedInvocations = newValue } } } - var trackCreatedRoomIsDMClosure: ((Bool) -> Void)? + nonisolated(unsafe) var trackCreatedRoomIsDMClosure: ((Bool) -> Void)? func trackCreatedRoom(isDM: Bool) { trackCreatedRoomIsDMCallsCountLock.withLock { trackCreatedRoomIsDMUnderlyingCallsCount += 1 } @@ -409,7 +409,7 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { //MARK: - trackComposer private let trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadCallsCountLock = NSLock() - private var trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadUnderlyingCallsCount = 0 + private nonisolated(unsafe) var trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadUnderlyingCallsCount = 0 var trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadCallsCount: Int { get { trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadCallsCountLock.withLock { trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadUnderlyingCallsCount } } set { trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadCallsCountLock.withLock { trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadUnderlyingCallsCount = newValue } } @@ -418,18 +418,18 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { return trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadCallsCount > 0 } private let trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadReceivedArgumentsLock = NSLock() - private var trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadUnderlyingReceivedArguments: (inThread: Bool, isEditing: Bool, isReply: Bool, messageType: AnalyticsEvent.Composer.MessageType, startsThread: Bool?)? + private nonisolated(unsafe) var trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadUnderlyingReceivedArguments: (inThread: Bool, isEditing: Bool, isReply: Bool, messageType: AnalyticsEvent.Composer.MessageType, startsThread: Bool?)? var trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadReceivedArguments: (inThread: Bool, isEditing: Bool, isReply: Bool, messageType: AnalyticsEvent.Composer.MessageType, startsThread: Bool?)? { get { trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadReceivedArgumentsLock.withLock { trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadUnderlyingReceivedArguments } } set { trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadReceivedArgumentsLock.withLock { trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadUnderlyingReceivedArguments = newValue } } } private let trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadReceivedInvocationsLock = NSLock() - private var trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadUnderlyingReceivedInvocations: [(inThread: Bool, isEditing: Bool, isReply: Bool, messageType: AnalyticsEvent.Composer.MessageType, startsThread: Bool?)] = [] + private nonisolated(unsafe) var trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadUnderlyingReceivedInvocations: [(inThread: Bool, isEditing: Bool, isReply: Bool, messageType: AnalyticsEvent.Composer.MessageType, startsThread: Bool?)] = [] var trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadReceivedInvocations: [(inThread: Bool, isEditing: Bool, isReply: Bool, messageType: AnalyticsEvent.Composer.MessageType, startsThread: Bool?)] { get { trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadReceivedInvocationsLock.withLock { trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadUnderlyingReceivedInvocations } } set { trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadReceivedInvocationsLock.withLock { trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadUnderlyingReceivedInvocations = newValue } } } - var trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadClosure: ((Bool, Bool, Bool, AnalyticsEvent.Composer.MessageType, Bool?) -> Void)? + nonisolated(unsafe) var trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadClosure: ((Bool, Bool, Bool, AnalyticsEvent.Composer.MessageType, Bool?) -> Void)? func trackComposer(inThread: Bool, isEditing: Bool, isReply: Bool, messageType: AnalyticsEvent.Composer.MessageType, startsThread: Bool?) { trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadCallsCountLock.withLock { trackComposerInThreadIsEditingIsReplyMessageTypeStartsThreadUnderlyingCallsCount += 1 } @@ -440,7 +440,7 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { //MARK: - trackViewRoom private let trackViewRoomIsDMIsSpaceCallsCountLock = NSLock() - private var trackViewRoomIsDMIsSpaceUnderlyingCallsCount = 0 + private nonisolated(unsafe) var trackViewRoomIsDMIsSpaceUnderlyingCallsCount = 0 var trackViewRoomIsDMIsSpaceCallsCount: Int { get { trackViewRoomIsDMIsSpaceCallsCountLock.withLock { trackViewRoomIsDMIsSpaceUnderlyingCallsCount } } set { trackViewRoomIsDMIsSpaceCallsCountLock.withLock { trackViewRoomIsDMIsSpaceUnderlyingCallsCount = newValue } } @@ -449,18 +449,18 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { return trackViewRoomIsDMIsSpaceCallsCount > 0 } private let trackViewRoomIsDMIsSpaceReceivedArgumentsLock = NSLock() - private var trackViewRoomIsDMIsSpaceUnderlyingReceivedArguments: (isDM: Bool, isSpace: Bool)? + private nonisolated(unsafe) var trackViewRoomIsDMIsSpaceUnderlyingReceivedArguments: (isDM: Bool, isSpace: Bool)? var trackViewRoomIsDMIsSpaceReceivedArguments: (isDM: Bool, isSpace: Bool)? { get { trackViewRoomIsDMIsSpaceReceivedArgumentsLock.withLock { trackViewRoomIsDMIsSpaceUnderlyingReceivedArguments } } set { trackViewRoomIsDMIsSpaceReceivedArgumentsLock.withLock { trackViewRoomIsDMIsSpaceUnderlyingReceivedArguments = newValue } } } private let trackViewRoomIsDMIsSpaceReceivedInvocationsLock = NSLock() - private var trackViewRoomIsDMIsSpaceUnderlyingReceivedInvocations: [(isDM: Bool, isSpace: Bool)] = [] + private nonisolated(unsafe) var trackViewRoomIsDMIsSpaceUnderlyingReceivedInvocations: [(isDM: Bool, isSpace: Bool)] = [] var trackViewRoomIsDMIsSpaceReceivedInvocations: [(isDM: Bool, isSpace: Bool)] { get { trackViewRoomIsDMIsSpaceReceivedInvocationsLock.withLock { trackViewRoomIsDMIsSpaceUnderlyingReceivedInvocations } } set { trackViewRoomIsDMIsSpaceReceivedInvocationsLock.withLock { trackViewRoomIsDMIsSpaceUnderlyingReceivedInvocations = newValue } } } - var trackViewRoomIsDMIsSpaceClosure: ((Bool, Bool) -> Void)? + nonisolated(unsafe) var trackViewRoomIsDMIsSpaceClosure: ((Bool, Bool) -> Void)? func trackViewRoom(isDM: Bool, isSpace: Bool) { trackViewRoomIsDMIsSpaceCallsCountLock.withLock { trackViewRoomIsDMIsSpaceUnderlyingCallsCount += 1 } @@ -471,7 +471,7 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { //MARK: - trackJoinedRoom private let trackJoinedRoomIsDMIsSpaceActiveMemberCountCallsCountLock = NSLock() - private var trackJoinedRoomIsDMIsSpaceActiveMemberCountUnderlyingCallsCount = 0 + private nonisolated(unsafe) var trackJoinedRoomIsDMIsSpaceActiveMemberCountUnderlyingCallsCount = 0 var trackJoinedRoomIsDMIsSpaceActiveMemberCountCallsCount: Int { get { trackJoinedRoomIsDMIsSpaceActiveMemberCountCallsCountLock.withLock { trackJoinedRoomIsDMIsSpaceActiveMemberCountUnderlyingCallsCount } } set { trackJoinedRoomIsDMIsSpaceActiveMemberCountCallsCountLock.withLock { trackJoinedRoomIsDMIsSpaceActiveMemberCountUnderlyingCallsCount = newValue } } @@ -480,18 +480,18 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { return trackJoinedRoomIsDMIsSpaceActiveMemberCountCallsCount > 0 } private let trackJoinedRoomIsDMIsSpaceActiveMemberCountReceivedArgumentsLock = NSLock() - private var trackJoinedRoomIsDMIsSpaceActiveMemberCountUnderlyingReceivedArguments: (isDM: Bool, isSpace: Bool, activeMemberCount: UInt)? + private nonisolated(unsafe) var trackJoinedRoomIsDMIsSpaceActiveMemberCountUnderlyingReceivedArguments: (isDM: Bool, isSpace: Bool, activeMemberCount: UInt)? var trackJoinedRoomIsDMIsSpaceActiveMemberCountReceivedArguments: (isDM: Bool, isSpace: Bool, activeMemberCount: UInt)? { get { trackJoinedRoomIsDMIsSpaceActiveMemberCountReceivedArgumentsLock.withLock { trackJoinedRoomIsDMIsSpaceActiveMemberCountUnderlyingReceivedArguments } } set { trackJoinedRoomIsDMIsSpaceActiveMemberCountReceivedArgumentsLock.withLock { trackJoinedRoomIsDMIsSpaceActiveMemberCountUnderlyingReceivedArguments = newValue } } } private let trackJoinedRoomIsDMIsSpaceActiveMemberCountReceivedInvocationsLock = NSLock() - private var trackJoinedRoomIsDMIsSpaceActiveMemberCountUnderlyingReceivedInvocations: [(isDM: Bool, isSpace: Bool, activeMemberCount: UInt)] = [] + private nonisolated(unsafe) var trackJoinedRoomIsDMIsSpaceActiveMemberCountUnderlyingReceivedInvocations: [(isDM: Bool, isSpace: Bool, activeMemberCount: UInt)] = [] var trackJoinedRoomIsDMIsSpaceActiveMemberCountReceivedInvocations: [(isDM: Bool, isSpace: Bool, activeMemberCount: UInt)] { get { trackJoinedRoomIsDMIsSpaceActiveMemberCountReceivedInvocationsLock.withLock { trackJoinedRoomIsDMIsSpaceActiveMemberCountUnderlyingReceivedInvocations } } set { trackJoinedRoomIsDMIsSpaceActiveMemberCountReceivedInvocationsLock.withLock { trackJoinedRoomIsDMIsSpaceActiveMemberCountUnderlyingReceivedInvocations = newValue } } } - var trackJoinedRoomIsDMIsSpaceActiveMemberCountClosure: ((Bool, Bool, UInt) -> Void)? + nonisolated(unsafe) var trackJoinedRoomIsDMIsSpaceActiveMemberCountClosure: ((Bool, Bool, UInt) -> Void)? func trackJoinedRoom(isDM: Bool, isSpace: Bool, activeMemberCount: UInt) { trackJoinedRoomIsDMIsSpaceActiveMemberCountCallsCountLock.withLock { trackJoinedRoomIsDMIsSpaceActiveMemberCountUnderlyingCallsCount += 1 } @@ -502,7 +502,7 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { //MARK: - trackPollCreated private let trackPollCreatedIsUndisclosedNumberOfAnswersCallsCountLock = NSLock() - private var trackPollCreatedIsUndisclosedNumberOfAnswersUnderlyingCallsCount = 0 + private nonisolated(unsafe) var trackPollCreatedIsUndisclosedNumberOfAnswersUnderlyingCallsCount = 0 var trackPollCreatedIsUndisclosedNumberOfAnswersCallsCount: Int { get { trackPollCreatedIsUndisclosedNumberOfAnswersCallsCountLock.withLock { trackPollCreatedIsUndisclosedNumberOfAnswersUnderlyingCallsCount } } set { trackPollCreatedIsUndisclosedNumberOfAnswersCallsCountLock.withLock { trackPollCreatedIsUndisclosedNumberOfAnswersUnderlyingCallsCount = newValue } } @@ -511,18 +511,18 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { return trackPollCreatedIsUndisclosedNumberOfAnswersCallsCount > 0 } private let trackPollCreatedIsUndisclosedNumberOfAnswersReceivedArgumentsLock = NSLock() - private var trackPollCreatedIsUndisclosedNumberOfAnswersUnderlyingReceivedArguments: (isUndisclosed: Bool, numberOfAnswers: Int)? + private nonisolated(unsafe) var trackPollCreatedIsUndisclosedNumberOfAnswersUnderlyingReceivedArguments: (isUndisclosed: Bool, numberOfAnswers: Int)? var trackPollCreatedIsUndisclosedNumberOfAnswersReceivedArguments: (isUndisclosed: Bool, numberOfAnswers: Int)? { get { trackPollCreatedIsUndisclosedNumberOfAnswersReceivedArgumentsLock.withLock { trackPollCreatedIsUndisclosedNumberOfAnswersUnderlyingReceivedArguments } } set { trackPollCreatedIsUndisclosedNumberOfAnswersReceivedArgumentsLock.withLock { trackPollCreatedIsUndisclosedNumberOfAnswersUnderlyingReceivedArguments = newValue } } } private let trackPollCreatedIsUndisclosedNumberOfAnswersReceivedInvocationsLock = NSLock() - private var trackPollCreatedIsUndisclosedNumberOfAnswersUnderlyingReceivedInvocations: [(isUndisclosed: Bool, numberOfAnswers: Int)] = [] + private nonisolated(unsafe) var trackPollCreatedIsUndisclosedNumberOfAnswersUnderlyingReceivedInvocations: [(isUndisclosed: Bool, numberOfAnswers: Int)] = [] var trackPollCreatedIsUndisclosedNumberOfAnswersReceivedInvocations: [(isUndisclosed: Bool, numberOfAnswers: Int)] { get { trackPollCreatedIsUndisclosedNumberOfAnswersReceivedInvocationsLock.withLock { trackPollCreatedIsUndisclosedNumberOfAnswersUnderlyingReceivedInvocations } } set { trackPollCreatedIsUndisclosedNumberOfAnswersReceivedInvocationsLock.withLock { trackPollCreatedIsUndisclosedNumberOfAnswersUnderlyingReceivedInvocations = newValue } } } - var trackPollCreatedIsUndisclosedNumberOfAnswersClosure: ((Bool, Int) -> Void)? + nonisolated(unsafe) var trackPollCreatedIsUndisclosedNumberOfAnswersClosure: ((Bool, Int) -> Void)? func trackPollCreated(isUndisclosed: Bool, numberOfAnswers: Int) { trackPollCreatedIsUndisclosedNumberOfAnswersCallsCountLock.withLock { trackPollCreatedIsUndisclosedNumberOfAnswersUnderlyingCallsCount += 1 } @@ -533,7 +533,7 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { //MARK: - trackPollVote private let trackPollVoteCallsCountLock = NSLock() - private var trackPollVoteUnderlyingCallsCount = 0 + private nonisolated(unsafe) var trackPollVoteUnderlyingCallsCount = 0 var trackPollVoteCallsCount: Int { get { trackPollVoteCallsCountLock.withLock { trackPollVoteUnderlyingCallsCount } } set { trackPollVoteCallsCountLock.withLock { trackPollVoteUnderlyingCallsCount = newValue } } @@ -541,7 +541,7 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { var trackPollVoteCalled: Bool { return trackPollVoteCallsCount > 0 } - var trackPollVoteClosure: (() -> Void)? + nonisolated(unsafe) var trackPollVoteClosure: (() -> Void)? func trackPollVote() { trackPollVoteCallsCountLock.withLock { trackPollVoteUnderlyingCallsCount += 1 } @@ -550,7 +550,7 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { //MARK: - trackPollEnd private let trackPollEndCallsCountLock = NSLock() - private var trackPollEndUnderlyingCallsCount = 0 + private nonisolated(unsafe) var trackPollEndUnderlyingCallsCount = 0 var trackPollEndCallsCount: Int { get { trackPollEndCallsCountLock.withLock { trackPollEndUnderlyingCallsCount } } set { trackPollEndCallsCountLock.withLock { trackPollEndUnderlyingCallsCount = newValue } } @@ -558,7 +558,7 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { var trackPollEndCalled: Bool { return trackPollEndCallsCount > 0 } - var trackPollEndClosure: (() -> Void)? + nonisolated(unsafe) var trackPollEndClosure: (() -> Void)? func trackPollEnd() { trackPollEndCallsCountLock.withLock { trackPollEndUnderlyingCallsCount += 1 } @@ -567,7 +567,7 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { //MARK: - trackRoomModeration private let trackRoomModerationActionRoleCallsCountLock = NSLock() - private var trackRoomModerationActionRoleUnderlyingCallsCount = 0 + private nonisolated(unsafe) var trackRoomModerationActionRoleUnderlyingCallsCount = 0 var trackRoomModerationActionRoleCallsCount: Int { get { trackRoomModerationActionRoleCallsCountLock.withLock { trackRoomModerationActionRoleUnderlyingCallsCount } } set { trackRoomModerationActionRoleCallsCountLock.withLock { trackRoomModerationActionRoleUnderlyingCallsCount = newValue } } @@ -576,18 +576,18 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { return trackRoomModerationActionRoleCallsCount > 0 } private let trackRoomModerationActionRoleReceivedArgumentsLock = NSLock() - private var trackRoomModerationActionRoleUnderlyingReceivedArguments: (action: AnalyticsEvent.RoomModeration.Action, role: RoomRole?)? + private nonisolated(unsafe) var trackRoomModerationActionRoleUnderlyingReceivedArguments: (action: AnalyticsEvent.RoomModeration.Action, role: RoomRole?)? var trackRoomModerationActionRoleReceivedArguments: (action: AnalyticsEvent.RoomModeration.Action, role: RoomRole?)? { get { trackRoomModerationActionRoleReceivedArgumentsLock.withLock { trackRoomModerationActionRoleUnderlyingReceivedArguments } } set { trackRoomModerationActionRoleReceivedArgumentsLock.withLock { trackRoomModerationActionRoleUnderlyingReceivedArguments = newValue } } } private let trackRoomModerationActionRoleReceivedInvocationsLock = NSLock() - private var trackRoomModerationActionRoleUnderlyingReceivedInvocations: [(action: AnalyticsEvent.RoomModeration.Action, role: RoomRole?)] = [] + private nonisolated(unsafe) var trackRoomModerationActionRoleUnderlyingReceivedInvocations: [(action: AnalyticsEvent.RoomModeration.Action, role: RoomRole?)] = [] var trackRoomModerationActionRoleReceivedInvocations: [(action: AnalyticsEvent.RoomModeration.Action, role: RoomRole?)] { get { trackRoomModerationActionRoleReceivedInvocationsLock.withLock { trackRoomModerationActionRoleUnderlyingReceivedInvocations } } set { trackRoomModerationActionRoleReceivedInvocationsLock.withLock { trackRoomModerationActionRoleUnderlyingReceivedInvocations = newValue } } } - var trackRoomModerationActionRoleClosure: ((AnalyticsEvent.RoomModeration.Action, RoomRole?) -> Void)? + nonisolated(unsafe) var trackRoomModerationActionRoleClosure: ((AnalyticsEvent.RoomModeration.Action, RoomRole?) -> Void)? func trackRoomModeration(action: AnalyticsEvent.RoomModeration.Action, role: RoomRole?) { trackRoomModerationActionRoleCallsCountLock.withLock { trackRoomModerationActionRoleUnderlyingCallsCount += 1 } @@ -598,7 +598,7 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { //MARK: - trackSessionSecurityState private let trackSessionSecurityStateCallsCountLock = NSLock() - private var trackSessionSecurityStateUnderlyingCallsCount = 0 + private nonisolated(unsafe) var trackSessionSecurityStateUnderlyingCallsCount = 0 var trackSessionSecurityStateCallsCount: Int { get { trackSessionSecurityStateCallsCountLock.withLock { trackSessionSecurityStateUnderlyingCallsCount } } set { trackSessionSecurityStateCallsCountLock.withLock { trackSessionSecurityStateUnderlyingCallsCount = newValue } } @@ -607,18 +607,18 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { return trackSessionSecurityStateCallsCount > 0 } private let trackSessionSecurityStateReceivedStateLock = NSLock() - private var trackSessionSecurityStateUnderlyingReceivedState: SessionSecurityState? + private nonisolated(unsafe) var trackSessionSecurityStateUnderlyingReceivedState: SessionSecurityState? var trackSessionSecurityStateReceivedState: SessionSecurityState? { get { trackSessionSecurityStateReceivedStateLock.withLock { trackSessionSecurityStateUnderlyingReceivedState } } set { trackSessionSecurityStateReceivedStateLock.withLock { trackSessionSecurityStateUnderlyingReceivedState = newValue } } } private let trackSessionSecurityStateReceivedInvocationsLock = NSLock() - private var trackSessionSecurityStateUnderlyingReceivedInvocations: [SessionSecurityState] = [] + private nonisolated(unsafe) var trackSessionSecurityStateUnderlyingReceivedInvocations: [SessionSecurityState] = [] var trackSessionSecurityStateReceivedInvocations: [SessionSecurityState] { get { trackSessionSecurityStateReceivedInvocationsLock.withLock { trackSessionSecurityStateUnderlyingReceivedInvocations } } set { trackSessionSecurityStateReceivedInvocationsLock.withLock { trackSessionSecurityStateUnderlyingReceivedInvocations = newValue } } } - var trackSessionSecurityStateClosure: ((SessionSecurityState) -> Void)? + nonisolated(unsafe) var trackSessionSecurityStateClosure: ((SessionSecurityState) -> Void)? func trackSessionSecurityState(_ state: SessionSecurityState) { trackSessionSecurityStateCallsCountLock.withLock { trackSessionSecurityStateUnderlyingCallsCount += 1 } @@ -629,7 +629,7 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { //MARK: - updateUserProperties private let updateUserPropertiesCallsCountLock = NSLock() - private var updateUserPropertiesUnderlyingCallsCount = 0 + private nonisolated(unsafe) var updateUserPropertiesUnderlyingCallsCount = 0 var updateUserPropertiesCallsCount: Int { get { updateUserPropertiesCallsCountLock.withLock { updateUserPropertiesUnderlyingCallsCount } } set { updateUserPropertiesCallsCountLock.withLock { updateUserPropertiesUnderlyingCallsCount = newValue } } @@ -638,18 +638,18 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { return updateUserPropertiesCallsCount > 0 } private let updateUserPropertiesReceivedUserPropertiesLock = NSLock() - private var updateUserPropertiesUnderlyingReceivedUserProperties: AnalyticsEvent.UserProperties? + private nonisolated(unsafe) var updateUserPropertiesUnderlyingReceivedUserProperties: AnalyticsEvent.UserProperties? var updateUserPropertiesReceivedUserProperties: AnalyticsEvent.UserProperties? { get { updateUserPropertiesReceivedUserPropertiesLock.withLock { updateUserPropertiesUnderlyingReceivedUserProperties } } set { updateUserPropertiesReceivedUserPropertiesLock.withLock { updateUserPropertiesUnderlyingReceivedUserProperties = newValue } } } private let updateUserPropertiesReceivedInvocationsLock = NSLock() - private var updateUserPropertiesUnderlyingReceivedInvocations: [AnalyticsEvent.UserProperties] = [] + private nonisolated(unsafe) var updateUserPropertiesUnderlyingReceivedInvocations: [AnalyticsEvent.UserProperties] = [] var updateUserPropertiesReceivedInvocations: [AnalyticsEvent.UserProperties] { get { updateUserPropertiesReceivedInvocationsLock.withLock { updateUserPropertiesUnderlyingReceivedInvocations } } set { updateUserPropertiesReceivedInvocationsLock.withLock { updateUserPropertiesUnderlyingReceivedInvocations = newValue } } } - var updateUserPropertiesClosure: ((AnalyticsEvent.UserProperties) -> Void)? + nonisolated(unsafe) var updateUserPropertiesClosure: ((AnalyticsEvent.UserProperties) -> Void)? func updateUserProperties(_ userProperties: AnalyticsEvent.UserProperties) { updateUserPropertiesCallsCountLock.withLock { updateUserPropertiesUnderlyingCallsCount += 1 } @@ -660,7 +660,7 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { //MARK: - trackPinUnpinEvent private let trackPinUnpinEventCallsCountLock = NSLock() - private var trackPinUnpinEventUnderlyingCallsCount = 0 + private nonisolated(unsafe) var trackPinUnpinEventUnderlyingCallsCount = 0 var trackPinUnpinEventCallsCount: Int { get { trackPinUnpinEventCallsCountLock.withLock { trackPinUnpinEventUnderlyingCallsCount } } set { trackPinUnpinEventCallsCountLock.withLock { trackPinUnpinEventUnderlyingCallsCount = newValue } } @@ -669,18 +669,18 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { return trackPinUnpinEventCallsCount > 0 } private let trackPinUnpinEventReceivedEventLock = NSLock() - private var trackPinUnpinEventUnderlyingReceivedEvent: AnalyticsEvent.PinUnpinAction? + private nonisolated(unsafe) var trackPinUnpinEventUnderlyingReceivedEvent: AnalyticsEvent.PinUnpinAction? var trackPinUnpinEventReceivedEvent: AnalyticsEvent.PinUnpinAction? { get { trackPinUnpinEventReceivedEventLock.withLock { trackPinUnpinEventUnderlyingReceivedEvent } } set { trackPinUnpinEventReceivedEventLock.withLock { trackPinUnpinEventUnderlyingReceivedEvent = newValue } } } private let trackPinUnpinEventReceivedInvocationsLock = NSLock() - private var trackPinUnpinEventUnderlyingReceivedInvocations: [AnalyticsEvent.PinUnpinAction] = [] + private nonisolated(unsafe) var trackPinUnpinEventUnderlyingReceivedInvocations: [AnalyticsEvent.PinUnpinAction] = [] var trackPinUnpinEventReceivedInvocations: [AnalyticsEvent.PinUnpinAction] { get { trackPinUnpinEventReceivedInvocationsLock.withLock { trackPinUnpinEventUnderlyingReceivedInvocations } } set { trackPinUnpinEventReceivedInvocationsLock.withLock { trackPinUnpinEventUnderlyingReceivedInvocations = newValue } } } - var trackPinUnpinEventClosure: ((AnalyticsEvent.PinUnpinAction) -> Void)? + nonisolated(unsafe) var trackPinUnpinEventClosure: ((AnalyticsEvent.PinUnpinAction) -> Void)? func trackPinUnpinEvent(_ event: AnalyticsEvent.PinUnpinAction) { trackPinUnpinEventCallsCountLock.withLock { trackPinUnpinEventUnderlyingCallsCount += 1 } @@ -689,47 +689,47 @@ class AnalyticsServiceMock: AnalyticsServiceProtocol, @unchecked Sendable { trackPinUnpinEventClosure?(event) } } -class AppLockServiceMock: AppLockServiceProtocol, @unchecked Sendable { +nonisolated class AppLockServiceMock: AppLockServiceProtocol, @unchecked Sendable { var isMandatory: Bool { get { return underlyingIsMandatory } set(value) { underlyingIsMandatory = value } } - var underlyingIsMandatory: Bool! + nonisolated(unsafe) var underlyingIsMandatory: Bool! var isEnabled: Bool { get { return underlyingIsEnabled } set(value) { underlyingIsEnabled = value } } - var underlyingIsEnabled: Bool! + nonisolated(unsafe) var underlyingIsEnabled: Bool! var isEnabledPublisher: AnyPublisher { get { return underlyingIsEnabledPublisher } set(value) { underlyingIsEnabledPublisher = value } } - var underlyingIsEnabledPublisher: AnyPublisher! + nonisolated(unsafe) var underlyingIsEnabledPublisher: AnyPublisher! var biometryType: LABiometryType { get { return underlyingBiometryType } set(value) { underlyingBiometryType = value } } - var underlyingBiometryType: LABiometryType! + nonisolated(unsafe) var underlyingBiometryType: LABiometryType! var biometricUnlockEnabled: Bool { get { return underlyingBiometricUnlockEnabled } set(value) { underlyingBiometricUnlockEnabled = value } } - var underlyingBiometricUnlockEnabled: Bool! + nonisolated(unsafe) var underlyingBiometricUnlockEnabled: Bool! var biometricUnlockTrusted: Bool { get { return underlyingBiometricUnlockTrusted } set(value) { underlyingBiometricUnlockTrusted = value } } - var underlyingBiometricUnlockTrusted: Bool! + nonisolated(unsafe) var underlyingBiometricUnlockTrusted: Bool! var numberOfPINAttempts: AnyPublisher { get { return underlyingNumberOfPINAttempts } set(value) { underlyingNumberOfPINAttempts = value } } - var underlyingNumberOfPINAttempts: AnyPublisher! + nonisolated(unsafe) var underlyingNumberOfPINAttempts: AnyPublisher! //MARK: - setupPINCode private let setupPINCodeCallsCountLock = NSLock() - private var setupPINCodeUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setupPINCodeUnderlyingCallsCount = 0 var setupPINCodeCallsCount: Int { get { setupPINCodeCallsCountLock.withLock { setupPINCodeUnderlyingCallsCount } } set { setupPINCodeCallsCountLock.withLock { setupPINCodeUnderlyingCallsCount = newValue } } @@ -738,25 +738,25 @@ class AppLockServiceMock: AppLockServiceProtocol, @unchecked Sendable { return setupPINCodeCallsCount > 0 } private let setupPINCodeReceivedPinCodeLock = NSLock() - private var setupPINCodeUnderlyingReceivedPinCode: String? + private nonisolated(unsafe) var setupPINCodeUnderlyingReceivedPinCode: String? var setupPINCodeReceivedPinCode: String? { get { setupPINCodeReceivedPinCodeLock.withLock { setupPINCodeUnderlyingReceivedPinCode } } set { setupPINCodeReceivedPinCodeLock.withLock { setupPINCodeUnderlyingReceivedPinCode = newValue } } } private let setupPINCodeReceivedInvocationsLock = NSLock() - private var setupPINCodeUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var setupPINCodeUnderlyingReceivedInvocations: [String] = [] var setupPINCodeReceivedInvocations: [String] { get { setupPINCodeReceivedInvocationsLock.withLock { setupPINCodeUnderlyingReceivedInvocations } } set { setupPINCodeReceivedInvocationsLock.withLock { setupPINCodeUnderlyingReceivedInvocations = newValue } } } private let setupPINCodeReturnValueLock = NSLock() - private var setupPINCodeUnderlyingReturnValue: Result! + private nonisolated(unsafe) var setupPINCodeUnderlyingReturnValue: Result! var setupPINCodeReturnValue: Result! { get { setupPINCodeReturnValueLock.withLock { setupPINCodeUnderlyingReturnValue } } set { setupPINCodeReturnValueLock.withLock { setupPINCodeUnderlyingReturnValue = newValue } } } - var setupPINCodeClosure: ((String) -> Result)? + nonisolated(unsafe) var setupPINCodeClosure: ((String) -> Result)? func setupPINCode(_ pinCode: String) -> Result { setupPINCodeCallsCountLock.withLock { setupPINCodeUnderlyingCallsCount += 1 } @@ -771,7 +771,7 @@ class AppLockServiceMock: AppLockServiceProtocol, @unchecked Sendable { //MARK: - validate private let validateCallsCountLock = NSLock() - private var validateUnderlyingCallsCount = 0 + private nonisolated(unsafe) var validateUnderlyingCallsCount = 0 var validateCallsCount: Int { get { validateCallsCountLock.withLock { validateUnderlyingCallsCount } } set { validateCallsCountLock.withLock { validateUnderlyingCallsCount = newValue } } @@ -780,25 +780,25 @@ class AppLockServiceMock: AppLockServiceProtocol, @unchecked Sendable { return validateCallsCount > 0 } private let validateReceivedPinCodeLock = NSLock() - private var validateUnderlyingReceivedPinCode: String? + private nonisolated(unsafe) var validateUnderlyingReceivedPinCode: String? var validateReceivedPinCode: String? { get { validateReceivedPinCodeLock.withLock { validateUnderlyingReceivedPinCode } } set { validateReceivedPinCodeLock.withLock { validateUnderlyingReceivedPinCode = newValue } } } private let validateReceivedInvocationsLock = NSLock() - private var validateUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var validateUnderlyingReceivedInvocations: [String] = [] var validateReceivedInvocations: [String] { get { validateReceivedInvocationsLock.withLock { validateUnderlyingReceivedInvocations } } set { validateReceivedInvocationsLock.withLock { validateUnderlyingReceivedInvocations = newValue } } } private let validateReturnValueLock = NSLock() - private var validateUnderlyingReturnValue: Result! + private nonisolated(unsafe) var validateUnderlyingReturnValue: Result! var validateReturnValue: Result! { get { validateReturnValueLock.withLock { validateUnderlyingReturnValue } } set { validateReturnValueLock.withLock { validateUnderlyingReturnValue = newValue } } } - var validateClosure: ((String) -> Result)? + nonisolated(unsafe) var validateClosure: ((String) -> Result)? func validate(_ pinCode: String) -> Result { validateCallsCountLock.withLock { validateUnderlyingCallsCount += 1 } @@ -813,7 +813,7 @@ class AppLockServiceMock: AppLockServiceProtocol, @unchecked Sendable { //MARK: - enableBiometricUnlock private let enableBiometricUnlockCallsCountLock = NSLock() - private var enableBiometricUnlockUnderlyingCallsCount = 0 + private nonisolated(unsafe) var enableBiometricUnlockUnderlyingCallsCount = 0 var enableBiometricUnlockCallsCount: Int { get { enableBiometricUnlockCallsCountLock.withLock { enableBiometricUnlockUnderlyingCallsCount } } set { enableBiometricUnlockCallsCountLock.withLock { enableBiometricUnlockUnderlyingCallsCount = newValue } } @@ -823,12 +823,12 @@ class AppLockServiceMock: AppLockServiceProtocol, @unchecked Sendable { } private let enableBiometricUnlockReturnValueLock = NSLock() - private var enableBiometricUnlockUnderlyingReturnValue: Result! + private nonisolated(unsafe) var enableBiometricUnlockUnderlyingReturnValue: Result! var enableBiometricUnlockReturnValue: Result! { get { enableBiometricUnlockReturnValueLock.withLock { enableBiometricUnlockUnderlyingReturnValue } } set { enableBiometricUnlockReturnValueLock.withLock { enableBiometricUnlockUnderlyingReturnValue = newValue } } } - var enableBiometricUnlockClosure: (() -> Result)? + nonisolated(unsafe) var enableBiometricUnlockClosure: (() -> Result)? func enableBiometricUnlock() -> Result { enableBiometricUnlockCallsCountLock.withLock { enableBiometricUnlockUnderlyingCallsCount += 1 } @@ -841,7 +841,7 @@ class AppLockServiceMock: AppLockServiceProtocol, @unchecked Sendable { //MARK: - disableBiometricUnlock private let disableBiometricUnlockCallsCountLock = NSLock() - private var disableBiometricUnlockUnderlyingCallsCount = 0 + private nonisolated(unsafe) var disableBiometricUnlockUnderlyingCallsCount = 0 var disableBiometricUnlockCallsCount: Int { get { disableBiometricUnlockCallsCountLock.withLock { disableBiometricUnlockUnderlyingCallsCount } } set { disableBiometricUnlockCallsCountLock.withLock { disableBiometricUnlockUnderlyingCallsCount = newValue } } @@ -849,7 +849,7 @@ class AppLockServiceMock: AppLockServiceProtocol, @unchecked Sendable { var disableBiometricUnlockCalled: Bool { return disableBiometricUnlockCallsCount > 0 } - var disableBiometricUnlockClosure: (() -> Void)? + nonisolated(unsafe) var disableBiometricUnlockClosure: (() -> Void)? func disableBiometricUnlock() { disableBiometricUnlockCallsCountLock.withLock { disableBiometricUnlockUnderlyingCallsCount += 1 } @@ -858,7 +858,7 @@ class AppLockServiceMock: AppLockServiceProtocol, @unchecked Sendable { //MARK: - disable private let disableCallsCountLock = NSLock() - private var disableUnderlyingCallsCount = 0 + private nonisolated(unsafe) var disableUnderlyingCallsCount = 0 var disableCallsCount: Int { get { disableCallsCountLock.withLock { disableUnderlyingCallsCount } } set { disableCallsCountLock.withLock { disableUnderlyingCallsCount = newValue } } @@ -866,7 +866,7 @@ class AppLockServiceMock: AppLockServiceProtocol, @unchecked Sendable { var disableCalled: Bool { return disableCallsCount > 0 } - var disableClosure: (() -> Void)? + nonisolated(unsafe) var disableClosure: (() -> Void)? func disable() { disableCallsCountLock.withLock { disableUnderlyingCallsCount += 1 } @@ -875,7 +875,7 @@ class AppLockServiceMock: AppLockServiceProtocol, @unchecked Sendable { //MARK: - applicationDidEnterBackground private let applicationDidEnterBackgroundCallsCountLock = NSLock() - private var applicationDidEnterBackgroundUnderlyingCallsCount = 0 + private nonisolated(unsafe) var applicationDidEnterBackgroundUnderlyingCallsCount = 0 var applicationDidEnterBackgroundCallsCount: Int { get { applicationDidEnterBackgroundCallsCountLock.withLock { applicationDidEnterBackgroundUnderlyingCallsCount } } set { applicationDidEnterBackgroundCallsCountLock.withLock { applicationDidEnterBackgroundUnderlyingCallsCount = newValue } } @@ -883,7 +883,7 @@ class AppLockServiceMock: AppLockServiceProtocol, @unchecked Sendable { var applicationDidEnterBackgroundCalled: Bool { return applicationDidEnterBackgroundCallsCount > 0 } - var applicationDidEnterBackgroundClosure: (() -> Void)? + nonisolated(unsafe) var applicationDidEnterBackgroundClosure: (() -> Void)? func applicationDidEnterBackground() { applicationDidEnterBackgroundCallsCountLock.withLock { applicationDidEnterBackgroundUnderlyingCallsCount += 1 } @@ -892,7 +892,7 @@ class AppLockServiceMock: AppLockServiceProtocol, @unchecked Sendable { //MARK: - computeNeedsUnlock private let computeNeedsUnlockDidBecomeActiveAtCallsCountLock = NSLock() - private var computeNeedsUnlockDidBecomeActiveAtUnderlyingCallsCount = 0 + private nonisolated(unsafe) var computeNeedsUnlockDidBecomeActiveAtUnderlyingCallsCount = 0 var computeNeedsUnlockDidBecomeActiveAtCallsCount: Int { get { computeNeedsUnlockDidBecomeActiveAtCallsCountLock.withLock { computeNeedsUnlockDidBecomeActiveAtUnderlyingCallsCount } } set { computeNeedsUnlockDidBecomeActiveAtCallsCountLock.withLock { computeNeedsUnlockDidBecomeActiveAtUnderlyingCallsCount = newValue } } @@ -901,25 +901,25 @@ class AppLockServiceMock: AppLockServiceProtocol, @unchecked Sendable { return computeNeedsUnlockDidBecomeActiveAtCallsCount > 0 } private let computeNeedsUnlockDidBecomeActiveAtReceivedDateLock = NSLock() - private var computeNeedsUnlockDidBecomeActiveAtUnderlyingReceivedDate: Date? + private nonisolated(unsafe) var computeNeedsUnlockDidBecomeActiveAtUnderlyingReceivedDate: Date? var computeNeedsUnlockDidBecomeActiveAtReceivedDate: Date? { get { computeNeedsUnlockDidBecomeActiveAtReceivedDateLock.withLock { computeNeedsUnlockDidBecomeActiveAtUnderlyingReceivedDate } } set { computeNeedsUnlockDidBecomeActiveAtReceivedDateLock.withLock { computeNeedsUnlockDidBecomeActiveAtUnderlyingReceivedDate = newValue } } } private let computeNeedsUnlockDidBecomeActiveAtReceivedInvocationsLock = NSLock() - private var computeNeedsUnlockDidBecomeActiveAtUnderlyingReceivedInvocations: [Date] = [] + private nonisolated(unsafe) var computeNeedsUnlockDidBecomeActiveAtUnderlyingReceivedInvocations: [Date] = [] var computeNeedsUnlockDidBecomeActiveAtReceivedInvocations: [Date] { get { computeNeedsUnlockDidBecomeActiveAtReceivedInvocationsLock.withLock { computeNeedsUnlockDidBecomeActiveAtUnderlyingReceivedInvocations } } set { computeNeedsUnlockDidBecomeActiveAtReceivedInvocationsLock.withLock { computeNeedsUnlockDidBecomeActiveAtUnderlyingReceivedInvocations = newValue } } } private let computeNeedsUnlockDidBecomeActiveAtReturnValueLock = NSLock() - private var computeNeedsUnlockDidBecomeActiveAtUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var computeNeedsUnlockDidBecomeActiveAtUnderlyingReturnValue: Bool! var computeNeedsUnlockDidBecomeActiveAtReturnValue: Bool! { get { computeNeedsUnlockDidBecomeActiveAtReturnValueLock.withLock { computeNeedsUnlockDidBecomeActiveAtUnderlyingReturnValue } } set { computeNeedsUnlockDidBecomeActiveAtReturnValueLock.withLock { computeNeedsUnlockDidBecomeActiveAtUnderlyingReturnValue = newValue } } } - var computeNeedsUnlockDidBecomeActiveAtClosure: ((Date) -> Bool)? + nonisolated(unsafe) var computeNeedsUnlockDidBecomeActiveAtClosure: ((Date) -> Bool)? func computeNeedsUnlock(didBecomeActiveAt date: Date) -> Bool { computeNeedsUnlockDidBecomeActiveAtCallsCountLock.withLock { computeNeedsUnlockDidBecomeActiveAtUnderlyingCallsCount += 1 } @@ -934,7 +934,7 @@ class AppLockServiceMock: AppLockServiceProtocol, @unchecked Sendable { //MARK: - unlock private let unlockWithCallsCountLock = NSLock() - private var unlockWithUnderlyingCallsCount = 0 + private nonisolated(unsafe) var unlockWithUnderlyingCallsCount = 0 var unlockWithCallsCount: Int { get { unlockWithCallsCountLock.withLock { unlockWithUnderlyingCallsCount } } set { unlockWithCallsCountLock.withLock { unlockWithUnderlyingCallsCount = newValue } } @@ -943,25 +943,25 @@ class AppLockServiceMock: AppLockServiceProtocol, @unchecked Sendable { return unlockWithCallsCount > 0 } private let unlockWithReceivedPinCodeLock = NSLock() - private var unlockWithUnderlyingReceivedPinCode: String? + private nonisolated(unsafe) var unlockWithUnderlyingReceivedPinCode: String? var unlockWithReceivedPinCode: String? { get { unlockWithReceivedPinCodeLock.withLock { unlockWithUnderlyingReceivedPinCode } } set { unlockWithReceivedPinCodeLock.withLock { unlockWithUnderlyingReceivedPinCode = newValue } } } private let unlockWithReceivedInvocationsLock = NSLock() - private var unlockWithUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var unlockWithUnderlyingReceivedInvocations: [String] = [] var unlockWithReceivedInvocations: [String] { get { unlockWithReceivedInvocationsLock.withLock { unlockWithUnderlyingReceivedInvocations } } set { unlockWithReceivedInvocationsLock.withLock { unlockWithUnderlyingReceivedInvocations = newValue } } } private let unlockWithReturnValueLock = NSLock() - private var unlockWithUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var unlockWithUnderlyingReturnValue: Bool! var unlockWithReturnValue: Bool! { get { unlockWithReturnValueLock.withLock { unlockWithUnderlyingReturnValue } } set { unlockWithReturnValueLock.withLock { unlockWithUnderlyingReturnValue = newValue } } } - var unlockWithClosure: ((String) -> Bool)? + nonisolated(unsafe) var unlockWithClosure: ((String) -> Bool)? func unlock(with pinCode: String) -> Bool { unlockWithCallsCountLock.withLock { unlockWithUnderlyingCallsCount += 1 } @@ -976,7 +976,7 @@ class AppLockServiceMock: AppLockServiceProtocol, @unchecked Sendable { //MARK: - unlockWithBiometrics private let unlockWithBiometricsCallsCountLock = NSLock() - private var unlockWithBiometricsUnderlyingCallsCount = 0 + private nonisolated(unsafe) var unlockWithBiometricsUnderlyingCallsCount = 0 var unlockWithBiometricsCallsCount: Int { get { unlockWithBiometricsCallsCountLock.withLock { unlockWithBiometricsUnderlyingCallsCount } } set { unlockWithBiometricsCallsCountLock.withLock { unlockWithBiometricsUnderlyingCallsCount = newValue } } @@ -986,14 +986,14 @@ class AppLockServiceMock: AppLockServiceProtocol, @unchecked Sendable { } private let unlockWithBiometricsReturnValueLock = NSLock() - private var unlockWithBiometricsUnderlyingReturnValue: AppLockServiceBiometricResult! + private nonisolated(unsafe) var unlockWithBiometricsUnderlyingReturnValue: AppLockServiceBiometricResult! var unlockWithBiometricsReturnValue: AppLockServiceBiometricResult! { get { unlockWithBiometricsReturnValueLock.withLock { unlockWithBiometricsUnderlyingReturnValue } } set { unlockWithBiometricsReturnValueLock.withLock { unlockWithBiometricsUnderlyingReturnValue = newValue } } } - var unlockWithBiometricsClosure: (() async -> AppLockServiceBiometricResult)? + nonisolated(unsafe) var unlockWithBiometricsClosure: (() async -> AppLockServiceBiometricResult)? - func unlockWithBiometrics() async -> AppLockServiceBiometricResult { + @concurrent func unlockWithBiometrics() async -> AppLockServiceBiometricResult { unlockWithBiometricsCallsCountLock.withLock { unlockWithBiometricsUnderlyingCallsCount += 1 } if let unlockWithBiometricsClosure = unlockWithBiometricsClosure { return await unlockWithBiometricsClosure() @@ -1002,27 +1002,27 @@ class AppLockServiceMock: AppLockServiceProtocol, @unchecked Sendable { } } } -class AppMediatorMock: AppMediatorProtocol, @unchecked Sendable { +nonisolated class AppMediatorMock: AppMediatorProtocol, @unchecked Sendable { var windowManager: WindowManagerProtocol { get { return underlyingWindowManager } set(value) { underlyingWindowManager = value } } - var underlyingWindowManager: WindowManagerProtocol! + nonisolated(unsafe) var underlyingWindowManager: WindowManagerProtocol! var networkMonitor: NetworkMonitorProtocol { get { return underlyingNetworkMonitor } set(value) { underlyingNetworkMonitor = value } } - var underlyingNetworkMonitor: NetworkMonitorProtocol! + nonisolated(unsafe) var underlyingNetworkMonitor: NetworkMonitorProtocol! var appState: UIApplication.State { get { return underlyingAppState } set(value) { underlyingAppState = value } } - var underlyingAppState: UIApplication.State! + nonisolated(unsafe) var underlyingAppState: UIApplication.State! //MARK: - beginBackgroundTask private let beginBackgroundTaskExpirationHandlerCallsCountLock = NSLock() - private var beginBackgroundTaskExpirationHandlerUnderlyingCallsCount = 0 + private nonisolated(unsafe) var beginBackgroundTaskExpirationHandlerUnderlyingCallsCount = 0 var beginBackgroundTaskExpirationHandlerCallsCount: Int { get { beginBackgroundTaskExpirationHandlerCallsCountLock.withLock { beginBackgroundTaskExpirationHandlerUnderlyingCallsCount } } set { beginBackgroundTaskExpirationHandlerCallsCountLock.withLock { beginBackgroundTaskExpirationHandlerUnderlyingCallsCount = newValue } } @@ -1032,14 +1032,14 @@ class AppMediatorMock: AppMediatorProtocol, @unchecked Sendable { } private let beginBackgroundTaskExpirationHandlerReturnValueLock = NSLock() - private var beginBackgroundTaskExpirationHandlerUnderlyingReturnValue: UIBackgroundTaskIdentifier! + private nonisolated(unsafe) var beginBackgroundTaskExpirationHandlerUnderlyingReturnValue: UIBackgroundTaskIdentifier! var beginBackgroundTaskExpirationHandlerReturnValue: UIBackgroundTaskIdentifier! { get { beginBackgroundTaskExpirationHandlerReturnValueLock.withLock { beginBackgroundTaskExpirationHandlerUnderlyingReturnValue } } set { beginBackgroundTaskExpirationHandlerReturnValueLock.withLock { beginBackgroundTaskExpirationHandlerUnderlyingReturnValue = newValue } } } - var beginBackgroundTaskExpirationHandlerClosure: (((() -> Void)?) -> UIBackgroundTaskIdentifier)? + nonisolated(unsafe) var beginBackgroundTaskExpirationHandlerClosure: (((@MainActor @Sendable () -> Void)?) -> UIBackgroundTaskIdentifier)? - func beginBackgroundTask(expirationHandler handler: (() -> Void)?) -> UIBackgroundTaskIdentifier { + func beginBackgroundTask(expirationHandler handler: (@MainActor @Sendable () -> Void)?) -> UIBackgroundTaskIdentifier { beginBackgroundTaskExpirationHandlerCallsCountLock.withLock { beginBackgroundTaskExpirationHandlerUnderlyingCallsCount += 1 } if let beginBackgroundTaskExpirationHandlerClosure = beginBackgroundTaskExpirationHandlerClosure { return beginBackgroundTaskExpirationHandlerClosure(handler) @@ -1050,7 +1050,7 @@ class AppMediatorMock: AppMediatorProtocol, @unchecked Sendable { //MARK: - endBackgroundTask private let endBackgroundTaskCallsCountLock = NSLock() - private var endBackgroundTaskUnderlyingCallsCount = 0 + private nonisolated(unsafe) var endBackgroundTaskUnderlyingCallsCount = 0 var endBackgroundTaskCallsCount: Int { get { endBackgroundTaskCallsCountLock.withLock { endBackgroundTaskUnderlyingCallsCount } } set { endBackgroundTaskCallsCountLock.withLock { endBackgroundTaskUnderlyingCallsCount = newValue } } @@ -1059,18 +1059,18 @@ class AppMediatorMock: AppMediatorProtocol, @unchecked Sendable { return endBackgroundTaskCallsCount > 0 } private let endBackgroundTaskReceivedIdentifierLock = NSLock() - private var endBackgroundTaskUnderlyingReceivedIdentifier: UIBackgroundTaskIdentifier? + private nonisolated(unsafe) var endBackgroundTaskUnderlyingReceivedIdentifier: UIBackgroundTaskIdentifier? var endBackgroundTaskReceivedIdentifier: UIBackgroundTaskIdentifier? { get { endBackgroundTaskReceivedIdentifierLock.withLock { endBackgroundTaskUnderlyingReceivedIdentifier } } set { endBackgroundTaskReceivedIdentifierLock.withLock { endBackgroundTaskUnderlyingReceivedIdentifier = newValue } } } private let endBackgroundTaskReceivedInvocationsLock = NSLock() - private var endBackgroundTaskUnderlyingReceivedInvocations: [UIBackgroundTaskIdentifier] = [] + private nonisolated(unsafe) var endBackgroundTaskUnderlyingReceivedInvocations: [UIBackgroundTaskIdentifier] = [] var endBackgroundTaskReceivedInvocations: [UIBackgroundTaskIdentifier] { get { endBackgroundTaskReceivedInvocationsLock.withLock { endBackgroundTaskUnderlyingReceivedInvocations } } set { endBackgroundTaskReceivedInvocationsLock.withLock { endBackgroundTaskUnderlyingReceivedInvocations = newValue } } } - var endBackgroundTaskClosure: ((UIBackgroundTaskIdentifier) -> Void)? + nonisolated(unsafe) var endBackgroundTaskClosure: ((UIBackgroundTaskIdentifier) -> Void)? func endBackgroundTask(_ identifier: UIBackgroundTaskIdentifier) { endBackgroundTaskCallsCountLock.withLock { endBackgroundTaskUnderlyingCallsCount += 1 } @@ -1081,7 +1081,7 @@ class AppMediatorMock: AppMediatorProtocol, @unchecked Sendable { //MARK: - open private let openCallsCountLock = NSLock() - private var openUnderlyingCallsCount = 0 + private nonisolated(unsafe) var openUnderlyingCallsCount = 0 var openCallsCount: Int { get { openCallsCountLock.withLock { openUnderlyingCallsCount } } set { openCallsCountLock.withLock { openUnderlyingCallsCount = newValue } } @@ -1090,18 +1090,18 @@ class AppMediatorMock: AppMediatorProtocol, @unchecked Sendable { return openCallsCount > 0 } private let openReceivedUrlLock = NSLock() - private var openUnderlyingReceivedUrl: URL? + private nonisolated(unsafe) var openUnderlyingReceivedUrl: URL? var openReceivedUrl: URL? { get { openReceivedUrlLock.withLock { openUnderlyingReceivedUrl } } set { openReceivedUrlLock.withLock { openUnderlyingReceivedUrl = newValue } } } private let openReceivedInvocationsLock = NSLock() - private var openUnderlyingReceivedInvocations: [URL] = [] + private nonisolated(unsafe) var openUnderlyingReceivedInvocations: [URL] = [] var openReceivedInvocations: [URL] { get { openReceivedInvocationsLock.withLock { openUnderlyingReceivedInvocations } } set { openReceivedInvocationsLock.withLock { openUnderlyingReceivedInvocations = newValue } } } - var openClosure: ((URL) -> Void)? + nonisolated(unsafe) var openClosure: ((URL) -> Void)? func open(_ url: URL) { openCallsCountLock.withLock { openUnderlyingCallsCount += 1 } @@ -1112,7 +1112,7 @@ class AppMediatorMock: AppMediatorProtocol, @unchecked Sendable { //MARK: - openAppSettings private let openAppSettingsCallsCountLock = NSLock() - private var openAppSettingsUnderlyingCallsCount = 0 + private nonisolated(unsafe) var openAppSettingsUnderlyingCallsCount = 0 var openAppSettingsCallsCount: Int { get { openAppSettingsCallsCountLock.withLock { openAppSettingsUnderlyingCallsCount } } set { openAppSettingsCallsCountLock.withLock { openAppSettingsUnderlyingCallsCount = newValue } } @@ -1120,7 +1120,7 @@ class AppMediatorMock: AppMediatorProtocol, @unchecked Sendable { var openAppSettingsCalled: Bool { return openAppSettingsCallsCount > 0 } - var openAppSettingsClosure: (() -> Void)? + nonisolated(unsafe) var openAppSettingsClosure: (() -> Void)? func openAppSettings() { openAppSettingsCallsCountLock.withLock { openAppSettingsUnderlyingCallsCount += 1 } @@ -1129,7 +1129,7 @@ class AppMediatorMock: AppMediatorProtocol, @unchecked Sendable { //MARK: - setIdleTimerDisabled private let setIdleTimerDisabledCallsCountLock = NSLock() - private var setIdleTimerDisabledUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setIdleTimerDisabledUnderlyingCallsCount = 0 var setIdleTimerDisabledCallsCount: Int { get { setIdleTimerDisabledCallsCountLock.withLock { setIdleTimerDisabledUnderlyingCallsCount } } set { setIdleTimerDisabledCallsCountLock.withLock { setIdleTimerDisabledUnderlyingCallsCount = newValue } } @@ -1138,18 +1138,18 @@ class AppMediatorMock: AppMediatorProtocol, @unchecked Sendable { return setIdleTimerDisabledCallsCount > 0 } private let setIdleTimerDisabledReceivedDisabledLock = NSLock() - private var setIdleTimerDisabledUnderlyingReceivedDisabled: Bool? + private nonisolated(unsafe) var setIdleTimerDisabledUnderlyingReceivedDisabled: Bool? var setIdleTimerDisabledReceivedDisabled: Bool? { get { setIdleTimerDisabledReceivedDisabledLock.withLock { setIdleTimerDisabledUnderlyingReceivedDisabled } } set { setIdleTimerDisabledReceivedDisabledLock.withLock { setIdleTimerDisabledUnderlyingReceivedDisabled = newValue } } } private let setIdleTimerDisabledReceivedInvocationsLock = NSLock() - private var setIdleTimerDisabledUnderlyingReceivedInvocations: [Bool] = [] + private nonisolated(unsafe) var setIdleTimerDisabledUnderlyingReceivedInvocations: [Bool] = [] var setIdleTimerDisabledReceivedInvocations: [Bool] { get { setIdleTimerDisabledReceivedInvocationsLock.withLock { setIdleTimerDisabledUnderlyingReceivedInvocations } } set { setIdleTimerDisabledReceivedInvocationsLock.withLock { setIdleTimerDisabledUnderlyingReceivedInvocations = newValue } } } - var setIdleTimerDisabledClosure: ((Bool) -> Void)? + nonisolated(unsafe) var setIdleTimerDisabledClosure: ((Bool) -> Void)? func setIdleTimerDisabled(_ disabled: Bool) { setIdleTimerDisabledCallsCountLock.withLock { setIdleTimerDisabledUnderlyingCallsCount += 1 } @@ -1160,7 +1160,7 @@ class AppMediatorMock: AppMediatorProtocol, @unchecked Sendable { //MARK: - requestAuthorizationIfNeeded private let requestAuthorizationIfNeededCallsCountLock = NSLock() - private var requestAuthorizationIfNeededUnderlyingCallsCount = 0 + private nonisolated(unsafe) var requestAuthorizationIfNeededUnderlyingCallsCount = 0 var requestAuthorizationIfNeededCallsCount: Int { get { requestAuthorizationIfNeededCallsCountLock.withLock { requestAuthorizationIfNeededUnderlyingCallsCount } } set { requestAuthorizationIfNeededCallsCountLock.withLock { requestAuthorizationIfNeededUnderlyingCallsCount = newValue } } @@ -1170,14 +1170,14 @@ class AppMediatorMock: AppMediatorProtocol, @unchecked Sendable { } private let requestAuthorizationIfNeededReturnValueLock = NSLock() - private var requestAuthorizationIfNeededUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var requestAuthorizationIfNeededUnderlyingReturnValue: Bool! var requestAuthorizationIfNeededReturnValue: Bool! { get { requestAuthorizationIfNeededReturnValueLock.withLock { requestAuthorizationIfNeededUnderlyingReturnValue } } set { requestAuthorizationIfNeededReturnValueLock.withLock { requestAuthorizationIfNeededUnderlyingReturnValue = newValue } } } - var requestAuthorizationIfNeededClosure: (() async -> Bool)? + nonisolated(unsafe) var requestAuthorizationIfNeededClosure: (() async -> Bool)? - func requestAuthorizationIfNeeded() async -> Bool { + @concurrent func requestAuthorizationIfNeeded() async -> Bool { requestAuthorizationIfNeededCallsCountLock.withLock { requestAuthorizationIfNeededUnderlyingCallsCount += 1 } if let requestAuthorizationIfNeededClosure = requestAuthorizationIfNeededClosure { return await requestAuthorizationIfNeededClosure() @@ -1186,13 +1186,13 @@ class AppMediatorMock: AppMediatorProtocol, @unchecked Sendable { } } } -class AudioConverterMock: AudioConverterProtocol, @unchecked Sendable { +nonisolated class AudioConverterMock: AudioConverterProtocol, @unchecked Sendable { //MARK: - convertToOpusOgg - var convertToOpusOggSourceURLDestinationURLThrowableError: Error? + nonisolated(unsafe) var convertToOpusOggSourceURLDestinationURLThrowableError: Error? private let convertToOpusOggSourceURLDestinationURLCallsCountLock = NSLock() - private var convertToOpusOggSourceURLDestinationURLUnderlyingCallsCount = 0 + private nonisolated(unsafe) var convertToOpusOggSourceURLDestinationURLUnderlyingCallsCount = 0 var convertToOpusOggSourceURLDestinationURLCallsCount: Int { get { convertToOpusOggSourceURLDestinationURLCallsCountLock.withLock { convertToOpusOggSourceURLDestinationURLUnderlyingCallsCount } } set { convertToOpusOggSourceURLDestinationURLCallsCountLock.withLock { convertToOpusOggSourceURLDestinationURLUnderlyingCallsCount = newValue } } @@ -1201,18 +1201,18 @@ class AudioConverterMock: AudioConverterProtocol, @unchecked Sendable { return convertToOpusOggSourceURLDestinationURLCallsCount > 0 } private let convertToOpusOggSourceURLDestinationURLReceivedArgumentsLock = NSLock() - private var convertToOpusOggSourceURLDestinationURLUnderlyingReceivedArguments: (sourceURL: URL, destinationURL: URL)? + private nonisolated(unsafe) var convertToOpusOggSourceURLDestinationURLUnderlyingReceivedArguments: (sourceURL: URL, destinationURL: URL)? var convertToOpusOggSourceURLDestinationURLReceivedArguments: (sourceURL: URL, destinationURL: URL)? { get { convertToOpusOggSourceURLDestinationURLReceivedArgumentsLock.withLock { convertToOpusOggSourceURLDestinationURLUnderlyingReceivedArguments } } set { convertToOpusOggSourceURLDestinationURLReceivedArgumentsLock.withLock { convertToOpusOggSourceURLDestinationURLUnderlyingReceivedArguments = newValue } } } private let convertToOpusOggSourceURLDestinationURLReceivedInvocationsLock = NSLock() - private var convertToOpusOggSourceURLDestinationURLUnderlyingReceivedInvocations: [(sourceURL: URL, destinationURL: URL)] = [] + private nonisolated(unsafe) var convertToOpusOggSourceURLDestinationURLUnderlyingReceivedInvocations: [(sourceURL: URL, destinationURL: URL)] = [] var convertToOpusOggSourceURLDestinationURLReceivedInvocations: [(sourceURL: URL, destinationURL: URL)] { get { convertToOpusOggSourceURLDestinationURLReceivedInvocationsLock.withLock { convertToOpusOggSourceURLDestinationURLUnderlyingReceivedInvocations } } set { convertToOpusOggSourceURLDestinationURLReceivedInvocationsLock.withLock { convertToOpusOggSourceURLDestinationURLUnderlyingReceivedInvocations = newValue } } } - var convertToOpusOggSourceURLDestinationURLClosure: ((URL, URL) throws -> Void)? + nonisolated(unsafe) var convertToOpusOggSourceURLDestinationURLClosure: ((URL, URL) throws -> Void)? func convertToOpusOgg(sourceURL: URL, destinationURL: URL) throws { if let error = convertToOpusOggSourceURLDestinationURLThrowableError { @@ -1225,9 +1225,9 @@ class AudioConverterMock: AudioConverterProtocol, @unchecked Sendable { } //MARK: - convertToMPEG4AAC - var convertToMPEG4AACSourceURLDestinationURLThrowableError: Error? + nonisolated(unsafe) var convertToMPEG4AACSourceURLDestinationURLThrowableError: Error? private let convertToMPEG4AACSourceURLDestinationURLCallsCountLock = NSLock() - private var convertToMPEG4AACSourceURLDestinationURLUnderlyingCallsCount = 0 + private nonisolated(unsafe) var convertToMPEG4AACSourceURLDestinationURLUnderlyingCallsCount = 0 var convertToMPEG4AACSourceURLDestinationURLCallsCount: Int { get { convertToMPEG4AACSourceURLDestinationURLCallsCountLock.withLock { convertToMPEG4AACSourceURLDestinationURLUnderlyingCallsCount } } set { convertToMPEG4AACSourceURLDestinationURLCallsCountLock.withLock { convertToMPEG4AACSourceURLDestinationURLUnderlyingCallsCount = newValue } } @@ -1236,18 +1236,18 @@ class AudioConverterMock: AudioConverterProtocol, @unchecked Sendable { return convertToMPEG4AACSourceURLDestinationURLCallsCount > 0 } private let convertToMPEG4AACSourceURLDestinationURLReceivedArgumentsLock = NSLock() - private var convertToMPEG4AACSourceURLDestinationURLUnderlyingReceivedArguments: (sourceURL: URL, destinationURL: URL)? + private nonisolated(unsafe) var convertToMPEG4AACSourceURLDestinationURLUnderlyingReceivedArguments: (sourceURL: URL, destinationURL: URL)? var convertToMPEG4AACSourceURLDestinationURLReceivedArguments: (sourceURL: URL, destinationURL: URL)? { get { convertToMPEG4AACSourceURLDestinationURLReceivedArgumentsLock.withLock { convertToMPEG4AACSourceURLDestinationURLUnderlyingReceivedArguments } } set { convertToMPEG4AACSourceURLDestinationURLReceivedArgumentsLock.withLock { convertToMPEG4AACSourceURLDestinationURLUnderlyingReceivedArguments = newValue } } } private let convertToMPEG4AACSourceURLDestinationURLReceivedInvocationsLock = NSLock() - private var convertToMPEG4AACSourceURLDestinationURLUnderlyingReceivedInvocations: [(sourceURL: URL, destinationURL: URL)] = [] + private nonisolated(unsafe) var convertToMPEG4AACSourceURLDestinationURLUnderlyingReceivedInvocations: [(sourceURL: URL, destinationURL: URL)] = [] var convertToMPEG4AACSourceURLDestinationURLReceivedInvocations: [(sourceURL: URL, destinationURL: URL)] { get { convertToMPEG4AACSourceURLDestinationURLReceivedInvocationsLock.withLock { convertToMPEG4AACSourceURLDestinationURLUnderlyingReceivedInvocations } } set { convertToMPEG4AACSourceURLDestinationURLReceivedInvocationsLock.withLock { convertToMPEG4AACSourceURLDestinationURLUnderlyingReceivedInvocations = newValue } } } - var convertToMPEG4AACSourceURLDestinationURLClosure: ((URL, URL) throws -> Void)? + nonisolated(unsafe) var convertToMPEG4AACSourceURLDestinationURLClosure: ((URL, URL) throws -> Void)? func convertToMPEG4AAC(sourceURL: URL, destinationURL: URL) throws { if let error = convertToMPEG4AACSourceURLDestinationURLThrowableError { @@ -1259,39 +1259,39 @@ class AudioConverterMock: AudioConverterProtocol, @unchecked Sendable { try convertToMPEG4AACSourceURLDestinationURLClosure?(sourceURL, destinationURL) } } -class AudioPlayerMock: AudioPlayerProtocol, @unchecked Sendable { - var sourceURL: URL? +nonisolated class AudioPlayerMock: AudioPlayerProtocol, @unchecked Sendable { + nonisolated(unsafe) var sourceURL: URL? var duration: TimeInterval { get { return underlyingDuration } set(value) { underlyingDuration = value } } - var underlyingDuration: TimeInterval! + nonisolated(unsafe) var underlyingDuration: TimeInterval! var currentTime: TimeInterval { get { return underlyingCurrentTime } set(value) { underlyingCurrentTime = value } } - var underlyingCurrentTime: TimeInterval! - var playbackURL: URL? + nonisolated(unsafe) var underlyingCurrentTime: TimeInterval! + nonisolated(unsafe) var playbackURL: URL? var state: MediaPlayerState { get { return underlyingState } set(value) { underlyingState = value } } - var underlyingState: MediaPlayerState! + nonisolated(unsafe) var underlyingState: MediaPlayerState! var playbackSpeed: Float { get { return underlyingPlaybackSpeed } set(value) { underlyingPlaybackSpeed = value } } - var underlyingPlaybackSpeed: Float! + nonisolated(unsafe) var underlyingPlaybackSpeed: Float! var actions: AnyPublisher { get { return underlyingActions } set(value) { underlyingActions = value } } - var underlyingActions: AnyPublisher! + nonisolated(unsafe) var underlyingActions: AnyPublisher! //MARK: - load private let loadSourceURLPlaybackURLAutoplayCallsCountLock = NSLock() - private var loadSourceURLPlaybackURLAutoplayUnderlyingCallsCount = 0 + private nonisolated(unsafe) var loadSourceURLPlaybackURLAutoplayUnderlyingCallsCount = 0 var loadSourceURLPlaybackURLAutoplayCallsCount: Int { get { loadSourceURLPlaybackURLAutoplayCallsCountLock.withLock { loadSourceURLPlaybackURLAutoplayUnderlyingCallsCount } } set { loadSourceURLPlaybackURLAutoplayCallsCountLock.withLock { loadSourceURLPlaybackURLAutoplayUnderlyingCallsCount = newValue } } @@ -1300,18 +1300,18 @@ class AudioPlayerMock: AudioPlayerProtocol, @unchecked Sendable { return loadSourceURLPlaybackURLAutoplayCallsCount > 0 } private let loadSourceURLPlaybackURLAutoplayReceivedArgumentsLock = NSLock() - private var loadSourceURLPlaybackURLAutoplayUnderlyingReceivedArguments: (sourceURL: URL, playbackURL: URL, autoplay: Bool)? + private nonisolated(unsafe) var loadSourceURLPlaybackURLAutoplayUnderlyingReceivedArguments: (sourceURL: URL, playbackURL: URL, autoplay: Bool)? var loadSourceURLPlaybackURLAutoplayReceivedArguments: (sourceURL: URL, playbackURL: URL, autoplay: Bool)? { get { loadSourceURLPlaybackURLAutoplayReceivedArgumentsLock.withLock { loadSourceURLPlaybackURLAutoplayUnderlyingReceivedArguments } } set { loadSourceURLPlaybackURLAutoplayReceivedArgumentsLock.withLock { loadSourceURLPlaybackURLAutoplayUnderlyingReceivedArguments = newValue } } } private let loadSourceURLPlaybackURLAutoplayReceivedInvocationsLock = NSLock() - private var loadSourceURLPlaybackURLAutoplayUnderlyingReceivedInvocations: [(sourceURL: URL, playbackURL: URL, autoplay: Bool)] = [] + private nonisolated(unsafe) var loadSourceURLPlaybackURLAutoplayUnderlyingReceivedInvocations: [(sourceURL: URL, playbackURL: URL, autoplay: Bool)] = [] var loadSourceURLPlaybackURLAutoplayReceivedInvocations: [(sourceURL: URL, playbackURL: URL, autoplay: Bool)] { get { loadSourceURLPlaybackURLAutoplayReceivedInvocationsLock.withLock { loadSourceURLPlaybackURLAutoplayUnderlyingReceivedInvocations } } set { loadSourceURLPlaybackURLAutoplayReceivedInvocationsLock.withLock { loadSourceURLPlaybackURLAutoplayUnderlyingReceivedInvocations = newValue } } } - var loadSourceURLPlaybackURLAutoplayClosure: ((URL, URL, Bool) -> Void)? + nonisolated(unsafe) var loadSourceURLPlaybackURLAutoplayClosure: ((URL, URL, Bool) -> Void)? func load(sourceURL: URL, playbackURL: URL, autoplay: Bool) { loadSourceURLPlaybackURLAutoplayCallsCountLock.withLock { loadSourceURLPlaybackURLAutoplayUnderlyingCallsCount += 1 } @@ -1322,7 +1322,7 @@ class AudioPlayerMock: AudioPlayerProtocol, @unchecked Sendable { //MARK: - reset private let resetCallsCountLock = NSLock() - private var resetUnderlyingCallsCount = 0 + private nonisolated(unsafe) var resetUnderlyingCallsCount = 0 var resetCallsCount: Int { get { resetCallsCountLock.withLock { resetUnderlyingCallsCount } } set { resetCallsCountLock.withLock { resetUnderlyingCallsCount = newValue } } @@ -1330,7 +1330,7 @@ class AudioPlayerMock: AudioPlayerProtocol, @unchecked Sendable { var resetCalled: Bool { return resetCallsCount > 0 } - var resetClosure: (() -> Void)? + nonisolated(unsafe) var resetClosure: (() -> Void)? func reset() { resetCallsCountLock.withLock { resetUnderlyingCallsCount += 1 } @@ -1339,7 +1339,7 @@ class AudioPlayerMock: AudioPlayerProtocol, @unchecked Sendable { //MARK: - play private let playCallsCountLock = NSLock() - private var playUnderlyingCallsCount = 0 + private nonisolated(unsafe) var playUnderlyingCallsCount = 0 var playCallsCount: Int { get { playCallsCountLock.withLock { playUnderlyingCallsCount } } set { playCallsCountLock.withLock { playUnderlyingCallsCount = newValue } } @@ -1347,7 +1347,7 @@ class AudioPlayerMock: AudioPlayerProtocol, @unchecked Sendable { var playCalled: Bool { return playCallsCount > 0 } - var playClosure: (() -> Void)? + nonisolated(unsafe) var playClosure: (() -> Void)? func play() { playCallsCountLock.withLock { playUnderlyingCallsCount += 1 } @@ -1356,7 +1356,7 @@ class AudioPlayerMock: AudioPlayerProtocol, @unchecked Sendable { //MARK: - pause private let pauseCallsCountLock = NSLock() - private var pauseUnderlyingCallsCount = 0 + private nonisolated(unsafe) var pauseUnderlyingCallsCount = 0 var pauseCallsCount: Int { get { pauseCallsCountLock.withLock { pauseUnderlyingCallsCount } } set { pauseCallsCountLock.withLock { pauseUnderlyingCallsCount = newValue } } @@ -1364,7 +1364,7 @@ class AudioPlayerMock: AudioPlayerProtocol, @unchecked Sendable { var pauseCalled: Bool { return pauseCallsCount > 0 } - var pauseClosure: (() -> Void)? + nonisolated(unsafe) var pauseClosure: (() -> Void)? func pause() { pauseCallsCountLock.withLock { pauseUnderlyingCallsCount += 1 } @@ -1373,7 +1373,7 @@ class AudioPlayerMock: AudioPlayerProtocol, @unchecked Sendable { //MARK: - stop private let stopCallsCountLock = NSLock() - private var stopUnderlyingCallsCount = 0 + private nonisolated(unsafe) var stopUnderlyingCallsCount = 0 var stopCallsCount: Int { get { stopCallsCountLock.withLock { stopUnderlyingCallsCount } } set { stopCallsCountLock.withLock { stopUnderlyingCallsCount = newValue } } @@ -1381,7 +1381,7 @@ class AudioPlayerMock: AudioPlayerProtocol, @unchecked Sendable { var stopCalled: Bool { return stopCallsCount > 0 } - var stopClosure: (() -> Void)? + nonisolated(unsafe) var stopClosure: (() -> Void)? func stop() { stopCallsCountLock.withLock { stopUnderlyingCallsCount += 1 } @@ -1390,7 +1390,7 @@ class AudioPlayerMock: AudioPlayerProtocol, @unchecked Sendable { //MARK: - seek private let seekToCallsCountLock = NSLock() - private var seekToUnderlyingCallsCount = 0 + private nonisolated(unsafe) var seekToUnderlyingCallsCount = 0 var seekToCallsCount: Int { get { seekToCallsCountLock.withLock { seekToUnderlyingCallsCount } } set { seekToCallsCountLock.withLock { seekToUnderlyingCallsCount = newValue } } @@ -1399,20 +1399,20 @@ class AudioPlayerMock: AudioPlayerProtocol, @unchecked Sendable { return seekToCallsCount > 0 } private let seekToReceivedProgressLock = NSLock() - private var seekToUnderlyingReceivedProgress: Double? + private nonisolated(unsafe) var seekToUnderlyingReceivedProgress: Double? var seekToReceivedProgress: Double? { get { seekToReceivedProgressLock.withLock { seekToUnderlyingReceivedProgress } } set { seekToReceivedProgressLock.withLock { seekToUnderlyingReceivedProgress = newValue } } } private let seekToReceivedInvocationsLock = NSLock() - private var seekToUnderlyingReceivedInvocations: [Double] = [] + private nonisolated(unsafe) var seekToUnderlyingReceivedInvocations: [Double] = [] var seekToReceivedInvocations: [Double] { get { seekToReceivedInvocationsLock.withLock { seekToUnderlyingReceivedInvocations } } set { seekToReceivedInvocationsLock.withLock { seekToUnderlyingReceivedInvocations = newValue } } } - var seekToClosure: ((Double) async -> Void)? + nonisolated(unsafe) var seekToClosure: ((Double) async -> Void)? - func seek(to progress: Double) async { + @concurrent func seek(to progress: Double) async { seekToCallsCountLock.withLock { seekToUnderlyingCallsCount += 1 } seekToReceivedProgress = progress seekToReceivedInvocationsLock.withLock { seekToUnderlyingReceivedInvocations.append(progress) } @@ -1421,7 +1421,7 @@ class AudioPlayerMock: AudioPlayerProtocol, @unchecked Sendable { //MARK: - setPlaybackSpeed private let setPlaybackSpeedCallsCountLock = NSLock() - private var setPlaybackSpeedUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setPlaybackSpeedUnderlyingCallsCount = 0 var setPlaybackSpeedCallsCount: Int { get { setPlaybackSpeedCallsCountLock.withLock { setPlaybackSpeedUnderlyingCallsCount } } set { setPlaybackSpeedCallsCountLock.withLock { setPlaybackSpeedUnderlyingCallsCount = newValue } } @@ -1430,18 +1430,18 @@ class AudioPlayerMock: AudioPlayerProtocol, @unchecked Sendable { return setPlaybackSpeedCallsCount > 0 } private let setPlaybackSpeedReceivedSpeedLock = NSLock() - private var setPlaybackSpeedUnderlyingReceivedSpeed: Float? + private nonisolated(unsafe) var setPlaybackSpeedUnderlyingReceivedSpeed: Float? var setPlaybackSpeedReceivedSpeed: Float? { get { setPlaybackSpeedReceivedSpeedLock.withLock { setPlaybackSpeedUnderlyingReceivedSpeed } } set { setPlaybackSpeedReceivedSpeedLock.withLock { setPlaybackSpeedUnderlyingReceivedSpeed = newValue } } } private let setPlaybackSpeedReceivedInvocationsLock = NSLock() - private var setPlaybackSpeedUnderlyingReceivedInvocations: [Float] = [] + private nonisolated(unsafe) var setPlaybackSpeedUnderlyingReceivedInvocations: [Float] = [] var setPlaybackSpeedReceivedInvocations: [Float] { get { setPlaybackSpeedReceivedInvocationsLock.withLock { setPlaybackSpeedUnderlyingReceivedInvocations } } set { setPlaybackSpeedReceivedInvocationsLock.withLock { setPlaybackSpeedUnderlyingReceivedInvocations = newValue } } } - var setPlaybackSpeedClosure: ((Float) -> Void)? + nonisolated(unsafe) var setPlaybackSpeedClosure: ((Float) -> Void)? func setPlaybackSpeed(_ speed: Float) { setPlaybackSpeedCallsCountLock.withLock { setPlaybackSpeedUnderlyingCallsCount += 1 } @@ -1450,28 +1450,28 @@ class AudioPlayerMock: AudioPlayerProtocol, @unchecked Sendable { setPlaybackSpeedClosure?(speed) } } -class AudioRecorderMock: AudioRecorderProtocol, @unchecked Sendable { +nonisolated class AudioRecorderMock: AudioRecorderProtocol, @unchecked Sendable { var actions: AnyPublisher { get { return underlyingActions } set(value) { underlyingActions = value } } - var underlyingActions: AnyPublisher! + nonisolated(unsafe) var underlyingActions: AnyPublisher! var currentTime: TimeInterval { get { return underlyingCurrentTime } set(value) { underlyingCurrentTime = value } } - var underlyingCurrentTime: TimeInterval! + nonisolated(unsafe) var underlyingCurrentTime: TimeInterval! var isRecording: Bool { get { return underlyingIsRecording } set(value) { underlyingIsRecording = value } } - var underlyingIsRecording: Bool! - var audioFileURL: URL? + nonisolated(unsafe) var underlyingIsRecording: Bool! + nonisolated(unsafe) var audioFileURL: URL? //MARK: - record private let recordAudioFileURLCallsCountLock = NSLock() - private var recordAudioFileURLUnderlyingCallsCount = 0 + private nonisolated(unsafe) var recordAudioFileURLUnderlyingCallsCount = 0 var recordAudioFileURLCallsCount: Int { get { recordAudioFileURLCallsCountLock.withLock { recordAudioFileURLUnderlyingCallsCount } } set { recordAudioFileURLCallsCountLock.withLock { recordAudioFileURLUnderlyingCallsCount = newValue } } @@ -1480,20 +1480,20 @@ class AudioRecorderMock: AudioRecorderProtocol, @unchecked Sendable { return recordAudioFileURLCallsCount > 0 } private let recordAudioFileURLReceivedAudioFileURLLock = NSLock() - private var recordAudioFileURLUnderlyingReceivedAudioFileURL: URL? + private nonisolated(unsafe) var recordAudioFileURLUnderlyingReceivedAudioFileURL: URL? var recordAudioFileURLReceivedAudioFileURL: URL? { get { recordAudioFileURLReceivedAudioFileURLLock.withLock { recordAudioFileURLUnderlyingReceivedAudioFileURL } } set { recordAudioFileURLReceivedAudioFileURLLock.withLock { recordAudioFileURLUnderlyingReceivedAudioFileURL = newValue } } } private let recordAudioFileURLReceivedInvocationsLock = NSLock() - private var recordAudioFileURLUnderlyingReceivedInvocations: [URL] = [] + private nonisolated(unsafe) var recordAudioFileURLUnderlyingReceivedInvocations: [URL] = [] var recordAudioFileURLReceivedInvocations: [URL] { get { recordAudioFileURLReceivedInvocationsLock.withLock { recordAudioFileURLUnderlyingReceivedInvocations } } set { recordAudioFileURLReceivedInvocationsLock.withLock { recordAudioFileURLUnderlyingReceivedInvocations = newValue } } } - var recordAudioFileURLClosure: ((URL) async -> Void)? + nonisolated(unsafe) var recordAudioFileURLClosure: ((URL) async -> Void)? - func record(audioFileURL: URL) async { + @concurrent func record(audioFileURL: URL) async { recordAudioFileURLCallsCountLock.withLock { recordAudioFileURLUnderlyingCallsCount += 1 } recordAudioFileURLReceivedAudioFileURL = audioFileURL recordAudioFileURLReceivedInvocationsLock.withLock { recordAudioFileURLUnderlyingReceivedInvocations.append(audioFileURL) } @@ -1502,7 +1502,7 @@ class AudioRecorderMock: AudioRecorderProtocol, @unchecked Sendable { //MARK: - stopRecording private let stopRecordingCallsCountLock = NSLock() - private var stopRecordingUnderlyingCallsCount = 0 + private nonisolated(unsafe) var stopRecordingUnderlyingCallsCount = 0 var stopRecordingCallsCount: Int { get { stopRecordingCallsCountLock.withLock { stopRecordingUnderlyingCallsCount } } set { stopRecordingCallsCountLock.withLock { stopRecordingUnderlyingCallsCount = newValue } } @@ -1510,16 +1510,16 @@ class AudioRecorderMock: AudioRecorderProtocol, @unchecked Sendable { var stopRecordingCalled: Bool { return stopRecordingCallsCount > 0 } - var stopRecordingClosure: (() async -> Void)? + nonisolated(unsafe) var stopRecordingClosure: (() async -> Void)? - func stopRecording() async { + @concurrent func stopRecording() async { stopRecordingCallsCountLock.withLock { stopRecordingUnderlyingCallsCount += 1 } await stopRecordingClosure?() } //MARK: - deleteRecording private let deleteRecordingCallsCountLock = NSLock() - private var deleteRecordingUnderlyingCallsCount = 0 + private nonisolated(unsafe) var deleteRecordingUnderlyingCallsCount = 0 var deleteRecordingCallsCount: Int { get { deleteRecordingCallsCountLock.withLock { deleteRecordingUnderlyingCallsCount } } set { deleteRecordingCallsCountLock.withLock { deleteRecordingUnderlyingCallsCount = newValue } } @@ -1527,16 +1527,16 @@ class AudioRecorderMock: AudioRecorderProtocol, @unchecked Sendable { var deleteRecordingCalled: Bool { return deleteRecordingCallsCount > 0 } - var deleteRecordingClosure: (() async -> Void)? + nonisolated(unsafe) var deleteRecordingClosure: (() async -> Void)? - func deleteRecording() async { + @concurrent func deleteRecording() async { deleteRecordingCallsCountLock.withLock { deleteRecordingUnderlyingCallsCount += 1 } await deleteRecordingClosure?() } //MARK: - averagePower private let averagePowerCallsCountLock = NSLock() - private var averagePowerUnderlyingCallsCount = 0 + private nonisolated(unsafe) var averagePowerUnderlyingCallsCount = 0 var averagePowerCallsCount: Int { get { averagePowerCallsCountLock.withLock { averagePowerUnderlyingCallsCount } } set { averagePowerCallsCountLock.withLock { averagePowerUnderlyingCallsCount = newValue } } @@ -1546,12 +1546,12 @@ class AudioRecorderMock: AudioRecorderProtocol, @unchecked Sendable { } private let averagePowerReturnValueLock = NSLock() - private var averagePowerUnderlyingReturnValue: Float! + private nonisolated(unsafe) var averagePowerUnderlyingReturnValue: Float! var averagePowerReturnValue: Float! { get { averagePowerReturnValueLock.withLock { averagePowerUnderlyingReturnValue } } set { averagePowerReturnValueLock.withLock { averagePowerUnderlyingReturnValue = newValue } } } - var averagePowerClosure: (() -> Float)? + nonisolated(unsafe) var averagePowerClosure: (() -> Float)? func averagePower() -> Float { averagePowerCallsCountLock.withLock { averagePowerUnderlyingCallsCount += 1 } @@ -1562,12 +1562,12 @@ class AudioRecorderMock: AudioRecorderProtocol, @unchecked Sendable { } } } -class AudioSessionMock: AudioSessionProtocol, @unchecked Sendable { +nonisolated class AudioSessionMock: AudioSessionProtocol, @unchecked Sendable { //MARK: - requestRecordPermission private let requestRecordPermissionCallsCountLock = NSLock() - private var requestRecordPermissionUnderlyingCallsCount = 0 + private nonisolated(unsafe) var requestRecordPermissionUnderlyingCallsCount = 0 var requestRecordPermissionCallsCount: Int { get { requestRecordPermissionCallsCountLock.withLock { requestRecordPermissionUnderlyingCallsCount } } set { requestRecordPermissionCallsCountLock.withLock { requestRecordPermissionUnderlyingCallsCount = newValue } } @@ -1576,18 +1576,18 @@ class AudioSessionMock: AudioSessionProtocol, @unchecked Sendable { return requestRecordPermissionCallsCount > 0 } private let requestRecordPermissionReceivedResponseLock = NSLock() - private var requestRecordPermissionUnderlyingReceivedResponse: ((Bool) -> Void)? + private nonisolated(unsafe) var requestRecordPermissionUnderlyingReceivedResponse: ((Bool) -> Void)? var requestRecordPermissionReceivedResponse: ((Bool) -> Void)? { get { requestRecordPermissionReceivedResponseLock.withLock { requestRecordPermissionUnderlyingReceivedResponse } } set { requestRecordPermissionReceivedResponseLock.withLock { requestRecordPermissionUnderlyingReceivedResponse = newValue } } } private let requestRecordPermissionReceivedInvocationsLock = NSLock() - private var requestRecordPermissionUnderlyingReceivedInvocations: [((Bool) -> Void)] = [] + private nonisolated(unsafe) var requestRecordPermissionUnderlyingReceivedInvocations: [((Bool) -> Void)] = [] var requestRecordPermissionReceivedInvocations: [((Bool) -> Void)] { get { requestRecordPermissionReceivedInvocationsLock.withLock { requestRecordPermissionUnderlyingReceivedInvocations } } set { requestRecordPermissionReceivedInvocationsLock.withLock { requestRecordPermissionUnderlyingReceivedInvocations = newValue } } } - var requestRecordPermissionClosure: ((@escaping (Bool) -> Void) -> Void)? + nonisolated(unsafe) var requestRecordPermissionClosure: ((@escaping (Bool) -> Void) -> Void)? func requestRecordPermission(_ response: @escaping (Bool) -> Void) { requestRecordPermissionCallsCountLock.withLock { requestRecordPermissionUnderlyingCallsCount += 1 } @@ -1597,9 +1597,9 @@ class AudioSessionMock: AudioSessionProtocol, @unchecked Sendable { } //MARK: - setAllowHapticsAndSystemSoundsDuringRecording - var setAllowHapticsAndSystemSoundsDuringRecordingThrowableError: Error? + nonisolated(unsafe) var setAllowHapticsAndSystemSoundsDuringRecordingThrowableError: Error? private let setAllowHapticsAndSystemSoundsDuringRecordingCallsCountLock = NSLock() - private var setAllowHapticsAndSystemSoundsDuringRecordingUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setAllowHapticsAndSystemSoundsDuringRecordingUnderlyingCallsCount = 0 var setAllowHapticsAndSystemSoundsDuringRecordingCallsCount: Int { get { setAllowHapticsAndSystemSoundsDuringRecordingCallsCountLock.withLock { setAllowHapticsAndSystemSoundsDuringRecordingUnderlyingCallsCount } } set { setAllowHapticsAndSystemSoundsDuringRecordingCallsCountLock.withLock { setAllowHapticsAndSystemSoundsDuringRecordingUnderlyingCallsCount = newValue } } @@ -1608,18 +1608,18 @@ class AudioSessionMock: AudioSessionProtocol, @unchecked Sendable { return setAllowHapticsAndSystemSoundsDuringRecordingCallsCount > 0 } private let setAllowHapticsAndSystemSoundsDuringRecordingReceivedInValueLock = NSLock() - private var setAllowHapticsAndSystemSoundsDuringRecordingUnderlyingReceivedInValue: Bool? + private nonisolated(unsafe) var setAllowHapticsAndSystemSoundsDuringRecordingUnderlyingReceivedInValue: Bool? var setAllowHapticsAndSystemSoundsDuringRecordingReceivedInValue: Bool? { get { setAllowHapticsAndSystemSoundsDuringRecordingReceivedInValueLock.withLock { setAllowHapticsAndSystemSoundsDuringRecordingUnderlyingReceivedInValue } } set { setAllowHapticsAndSystemSoundsDuringRecordingReceivedInValueLock.withLock { setAllowHapticsAndSystemSoundsDuringRecordingUnderlyingReceivedInValue = newValue } } } private let setAllowHapticsAndSystemSoundsDuringRecordingReceivedInvocationsLock = NSLock() - private var setAllowHapticsAndSystemSoundsDuringRecordingUnderlyingReceivedInvocations: [Bool] = [] + private nonisolated(unsafe) var setAllowHapticsAndSystemSoundsDuringRecordingUnderlyingReceivedInvocations: [Bool] = [] var setAllowHapticsAndSystemSoundsDuringRecordingReceivedInvocations: [Bool] { get { setAllowHapticsAndSystemSoundsDuringRecordingReceivedInvocationsLock.withLock { setAllowHapticsAndSystemSoundsDuringRecordingUnderlyingReceivedInvocations } } set { setAllowHapticsAndSystemSoundsDuringRecordingReceivedInvocationsLock.withLock { setAllowHapticsAndSystemSoundsDuringRecordingUnderlyingReceivedInvocations = newValue } } } - var setAllowHapticsAndSystemSoundsDuringRecordingClosure: ((Bool) throws -> Void)? + nonisolated(unsafe) var setAllowHapticsAndSystemSoundsDuringRecordingClosure: ((Bool) throws -> Void)? func setAllowHapticsAndSystemSoundsDuringRecording(_ inValue: Bool) throws { if let error = setAllowHapticsAndSystemSoundsDuringRecordingThrowableError { @@ -1632,9 +1632,9 @@ class AudioSessionMock: AudioSessionProtocol, @unchecked Sendable { } //MARK: - setCategory - var setCategoryModeOptionsThrowableError: Error? + nonisolated(unsafe) var setCategoryModeOptionsThrowableError: Error? private let setCategoryModeOptionsCallsCountLock = NSLock() - private var setCategoryModeOptionsUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setCategoryModeOptionsUnderlyingCallsCount = 0 var setCategoryModeOptionsCallsCount: Int { get { setCategoryModeOptionsCallsCountLock.withLock { setCategoryModeOptionsUnderlyingCallsCount } } set { setCategoryModeOptionsCallsCountLock.withLock { setCategoryModeOptionsUnderlyingCallsCount = newValue } } @@ -1643,18 +1643,18 @@ class AudioSessionMock: AudioSessionProtocol, @unchecked Sendable { return setCategoryModeOptionsCallsCount > 0 } private let setCategoryModeOptionsReceivedArgumentsLock = NSLock() - private var setCategoryModeOptionsUnderlyingReceivedArguments: (category: AVAudioSession.Category, mode: AVAudioSession.Mode, options: AVAudioSession.CategoryOptions)? + private nonisolated(unsafe) var setCategoryModeOptionsUnderlyingReceivedArguments: (category: AVAudioSession.Category, mode: AVAudioSession.Mode, options: AVAudioSession.CategoryOptions)? var setCategoryModeOptionsReceivedArguments: (category: AVAudioSession.Category, mode: AVAudioSession.Mode, options: AVAudioSession.CategoryOptions)? { get { setCategoryModeOptionsReceivedArgumentsLock.withLock { setCategoryModeOptionsUnderlyingReceivedArguments } } set { setCategoryModeOptionsReceivedArgumentsLock.withLock { setCategoryModeOptionsUnderlyingReceivedArguments = newValue } } } private let setCategoryModeOptionsReceivedInvocationsLock = NSLock() - private var setCategoryModeOptionsUnderlyingReceivedInvocations: [(category: AVAudioSession.Category, mode: AVAudioSession.Mode, options: AVAudioSession.CategoryOptions)] = [] + private nonisolated(unsafe) var setCategoryModeOptionsUnderlyingReceivedInvocations: [(category: AVAudioSession.Category, mode: AVAudioSession.Mode, options: AVAudioSession.CategoryOptions)] = [] var setCategoryModeOptionsReceivedInvocations: [(category: AVAudioSession.Category, mode: AVAudioSession.Mode, options: AVAudioSession.CategoryOptions)] { get { setCategoryModeOptionsReceivedInvocationsLock.withLock { setCategoryModeOptionsUnderlyingReceivedInvocations } } set { setCategoryModeOptionsReceivedInvocationsLock.withLock { setCategoryModeOptionsUnderlyingReceivedInvocations = newValue } } } - var setCategoryModeOptionsClosure: ((AVAudioSession.Category, AVAudioSession.Mode, AVAudioSession.CategoryOptions) throws -> Void)? + nonisolated(unsafe) var setCategoryModeOptionsClosure: ((AVAudioSession.Category, AVAudioSession.Mode, AVAudioSession.CategoryOptions) throws -> Void)? func setCategory(_ category: AVAudioSession.Category, mode: AVAudioSession.Mode, options: AVAudioSession.CategoryOptions) throws { if let error = setCategoryModeOptionsThrowableError { @@ -1667,9 +1667,9 @@ class AudioSessionMock: AudioSessionProtocol, @unchecked Sendable { } //MARK: - setActive - var setActiveOptionsThrowableError: Error? + nonisolated(unsafe) var setActiveOptionsThrowableError: Error? private let setActiveOptionsCallsCountLock = NSLock() - private var setActiveOptionsUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setActiveOptionsUnderlyingCallsCount = 0 var setActiveOptionsCallsCount: Int { get { setActiveOptionsCallsCountLock.withLock { setActiveOptionsUnderlyingCallsCount } } set { setActiveOptionsCallsCountLock.withLock { setActiveOptionsUnderlyingCallsCount = newValue } } @@ -1678,18 +1678,18 @@ class AudioSessionMock: AudioSessionProtocol, @unchecked Sendable { return setActiveOptionsCallsCount > 0 } private let setActiveOptionsReceivedArgumentsLock = NSLock() - private var setActiveOptionsUnderlyingReceivedArguments: (active: Bool, options: AVAudioSession.SetActiveOptions)? + private nonisolated(unsafe) var setActiveOptionsUnderlyingReceivedArguments: (active: Bool, options: AVAudioSession.SetActiveOptions)? var setActiveOptionsReceivedArguments: (active: Bool, options: AVAudioSession.SetActiveOptions)? { get { setActiveOptionsReceivedArgumentsLock.withLock { setActiveOptionsUnderlyingReceivedArguments } } set { setActiveOptionsReceivedArgumentsLock.withLock { setActiveOptionsUnderlyingReceivedArguments = newValue } } } private let setActiveOptionsReceivedInvocationsLock = NSLock() - private var setActiveOptionsUnderlyingReceivedInvocations: [(active: Bool, options: AVAudioSession.SetActiveOptions)] = [] + private nonisolated(unsafe) var setActiveOptionsUnderlyingReceivedInvocations: [(active: Bool, options: AVAudioSession.SetActiveOptions)] = [] var setActiveOptionsReceivedInvocations: [(active: Bool, options: AVAudioSession.SetActiveOptions)] { get { setActiveOptionsReceivedInvocationsLock.withLock { setActiveOptionsUnderlyingReceivedInvocations } } set { setActiveOptionsReceivedInvocationsLock.withLock { setActiveOptionsUnderlyingReceivedInvocations = newValue } } } - var setActiveOptionsClosure: ((Bool, AVAudioSession.SetActiveOptions) throws -> Void)? + nonisolated(unsafe) var setActiveOptionsClosure: ((Bool, AVAudioSession.SetActiveOptions) throws -> Void)? func setActive(_ active: Bool, options: AVAudioSession.SetActiveOptions) throws { if let error = setActiveOptionsThrowableError { @@ -1701,13 +1701,13 @@ class AudioSessionMock: AudioSessionProtocol, @unchecked Sendable { try setActiveOptionsClosure?(active, options) } } -class AuthenticationClientFactoryMock: AuthenticationClientFactoryProtocol, @unchecked Sendable { +nonisolated class AuthenticationClientFactoryMock: AuthenticationClientFactoryProtocol, @unchecked Sendable { //MARK: - makeClient - var makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksThrowableError: Error? + nonisolated(unsafe) var makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksThrowableError: Error? private let makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksCallsCountLock = NSLock() - private var makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksUnderlyingCallsCount = 0 + private nonisolated(unsafe) var makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksUnderlyingCallsCount = 0 var makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksCallsCount: Int { get { makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksCallsCountLock.withLock { makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksUnderlyingCallsCount } } set { makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksCallsCountLock.withLock { makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksUnderlyingCallsCount = newValue } } @@ -1716,27 +1716,27 @@ class AuthenticationClientFactoryMock: AuthenticationClientFactoryProtocol, @unc return makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksCallsCount > 0 } private let makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksReceivedArgumentsLock = NSLock() - private var makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksUnderlyingReceivedArguments: (homeserverAddress: String, sessionDirectories: SessionDirectories, passphrase: String, clientSessionDelegate: ClientSessionDelegate, appSettings: AppSettings, appHooks: AppHooks)? + private nonisolated(unsafe) var makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksUnderlyingReceivedArguments: (homeserverAddress: String, sessionDirectories: SessionDirectories, passphrase: String, clientSessionDelegate: ClientSessionDelegate, appSettings: AppSettings, appHooks: AppHooks)? var makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksReceivedArguments: (homeserverAddress: String, sessionDirectories: SessionDirectories, passphrase: String, clientSessionDelegate: ClientSessionDelegate, appSettings: AppSettings, appHooks: AppHooks)? { get { makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksReceivedArgumentsLock.withLock { makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksUnderlyingReceivedArguments } } set { makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksReceivedArgumentsLock.withLock { makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksUnderlyingReceivedArguments = newValue } } } private let makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksReceivedInvocationsLock = NSLock() - private var makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksUnderlyingReceivedInvocations: [(homeserverAddress: String, sessionDirectories: SessionDirectories, passphrase: String, clientSessionDelegate: ClientSessionDelegate, appSettings: AppSettings, appHooks: AppHooks)] = [] + private nonisolated(unsafe) var makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksUnderlyingReceivedInvocations: [(homeserverAddress: String, sessionDirectories: SessionDirectories, passphrase: String, clientSessionDelegate: ClientSessionDelegate, appSettings: AppSettings, appHooks: AppHooks)] = [] var makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksReceivedInvocations: [(homeserverAddress: String, sessionDirectories: SessionDirectories, passphrase: String, clientSessionDelegate: ClientSessionDelegate, appSettings: AppSettings, appHooks: AppHooks)] { get { makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksReceivedInvocationsLock.withLock { makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksUnderlyingReceivedInvocations } } set { makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksReceivedInvocationsLock.withLock { makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksUnderlyingReceivedInvocations = newValue } } } private let makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksReturnValueLock = NSLock() - private var makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksUnderlyingReturnValue: ClientProtocol! + private nonisolated(unsafe) var makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksUnderlyingReturnValue: ClientProtocol! var makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksReturnValue: ClientProtocol! { get { makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksReturnValueLock.withLock { makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksUnderlyingReturnValue } } set { makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksReturnValueLock.withLock { makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksUnderlyingReturnValue = newValue } } } - var makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksClosure: ((String, SessionDirectories, String, ClientSessionDelegate, AppSettings, AppHooks) async throws -> ClientProtocol)? + nonisolated(unsafe) var makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksClosure: ((String, SessionDirectories, String, ClientSessionDelegate, AppSettings, AppHooks) async throws -> ClientProtocol)? - func makeClient(homeserverAddress: String, sessionDirectories: SessionDirectories, passphrase: String, clientSessionDelegate: ClientSessionDelegate, appSettings: AppSettings, appHooks: AppHooks) async throws -> ClientProtocol { + @concurrent func makeClient(homeserverAddress: String, sessionDirectories: SessionDirectories, passphrase: String, clientSessionDelegate: ClientSessionDelegate, appSettings: AppSettings, appHooks: AppHooks) async throws -> ClientProtocol { if let error = makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksThrowableError { throw error } @@ -1751,9 +1751,9 @@ class AuthenticationClientFactoryMock: AuthenticationClientFactoryProtocol, @unc } //MARK: - makeInMemoryClient - var makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksThrowableError: Error? + nonisolated(unsafe) var makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksThrowableError: Error? private let makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksCallsCountLock = NSLock() - private var makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksUnderlyingCallsCount = 0 + private nonisolated(unsafe) var makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksUnderlyingCallsCount = 0 var makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksCallsCount: Int { get { makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksCallsCountLock.withLock { makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksUnderlyingCallsCount } } set { makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksCallsCountLock.withLock { makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksUnderlyingCallsCount = newValue } } @@ -1762,27 +1762,27 @@ class AuthenticationClientFactoryMock: AuthenticationClientFactoryProtocol, @unc return makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksCallsCount > 0 } private let makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksReceivedArgumentsLock = NSLock() - private var makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksUnderlyingReceivedArguments: (homeserverAddress: String, clientSessionDelegate: ClientSessionDelegate, appSettings: AppSettings, appHooks: AppHooks)? + private nonisolated(unsafe) var makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksUnderlyingReceivedArguments: (homeserverAddress: String, clientSessionDelegate: ClientSessionDelegate, appSettings: AppSettings, appHooks: AppHooks)? var makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksReceivedArguments: (homeserverAddress: String, clientSessionDelegate: ClientSessionDelegate, appSettings: AppSettings, appHooks: AppHooks)? { get { makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksReceivedArgumentsLock.withLock { makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksUnderlyingReceivedArguments } } set { makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksReceivedArgumentsLock.withLock { makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksUnderlyingReceivedArguments = newValue } } } private let makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksReceivedInvocationsLock = NSLock() - private var makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksUnderlyingReceivedInvocations: [(homeserverAddress: String, clientSessionDelegate: ClientSessionDelegate, appSettings: AppSettings, appHooks: AppHooks)] = [] + private nonisolated(unsafe) var makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksUnderlyingReceivedInvocations: [(homeserverAddress: String, clientSessionDelegate: ClientSessionDelegate, appSettings: AppSettings, appHooks: AppHooks)] = [] var makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksReceivedInvocations: [(homeserverAddress: String, clientSessionDelegate: ClientSessionDelegate, appSettings: AppSettings, appHooks: AppHooks)] { get { makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksReceivedInvocationsLock.withLock { makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksUnderlyingReceivedInvocations } } set { makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksReceivedInvocationsLock.withLock { makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksUnderlyingReceivedInvocations = newValue } } } private let makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksReturnValueLock = NSLock() - private var makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksUnderlyingReturnValue: ClientProtocol! + private nonisolated(unsafe) var makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksUnderlyingReturnValue: ClientProtocol! var makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksReturnValue: ClientProtocol! { get { makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksReturnValueLock.withLock { makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksUnderlyingReturnValue } } set { makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksReturnValueLock.withLock { makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksUnderlyingReturnValue = newValue } } } - var makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksClosure: ((String, ClientSessionDelegate, AppSettings, AppHooks) async throws -> ClientProtocol)? + nonisolated(unsafe) var makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksClosure: ((String, ClientSessionDelegate, AppSettings, AppHooks) async throws -> ClientProtocol)? - func makeInMemoryClient(homeserverAddress: String, clientSessionDelegate: ClientSessionDelegate, appSettings: AppSettings, appHooks: AppHooks) async throws -> ClientProtocol { + @concurrent func makeInMemoryClient(homeserverAddress: String, clientSessionDelegate: ClientSessionDelegate, appSettings: AppSettings, appHooks: AppHooks) async throws -> ClientProtocol { if let error = makeInMemoryClientHomeserverAddressClientSessionDelegateAppSettingsAppHooksThrowableError { throw error } @@ -1796,27 +1796,27 @@ class AuthenticationClientFactoryMock: AuthenticationClientFactoryProtocol, @unc } } } -class BannedRoomProxyMock: BannedRoomProxyProtocol, @unchecked Sendable { +nonisolated class BannedRoomProxyMock: BannedRoomProxyProtocol, @unchecked Sendable { var info: BaseRoomInfoProxyProtocol { get { return underlyingInfo } set(value) { underlyingInfo = value } } - var underlyingInfo: BaseRoomInfoProxyProtocol! + nonisolated(unsafe) var underlyingInfo: BaseRoomInfoProxyProtocol! var id: String { get { return underlyingId } set(value) { underlyingId = value } } - var underlyingId: String! + nonisolated(unsafe) var underlyingId: String! var ownUserID: String { get { return underlyingOwnUserID } set(value) { underlyingOwnUserID = value } } - var underlyingOwnUserID: String! + nonisolated(unsafe) var underlyingOwnUserID: String! //MARK: - forgetRoom private let forgetRoomCallsCountLock = NSLock() - private var forgetRoomUnderlyingCallsCount = 0 + private nonisolated(unsafe) var forgetRoomUnderlyingCallsCount = 0 var forgetRoomCallsCount: Int { get { forgetRoomCallsCountLock.withLock { forgetRoomUnderlyingCallsCount } } set { forgetRoomCallsCountLock.withLock { forgetRoomUnderlyingCallsCount = newValue } } @@ -1826,14 +1826,14 @@ class BannedRoomProxyMock: BannedRoomProxyProtocol, @unchecked Sendable { } private let forgetRoomReturnValueLock = NSLock() - private var forgetRoomUnderlyingReturnValue: Result! + private nonisolated(unsafe) var forgetRoomUnderlyingReturnValue: Result! var forgetRoomReturnValue: Result! { get { forgetRoomReturnValueLock.withLock { forgetRoomUnderlyingReturnValue } } set { forgetRoomReturnValueLock.withLock { forgetRoomUnderlyingReturnValue = newValue } } } - var forgetRoomClosure: (() async -> Result)? + nonisolated(unsafe) var forgetRoomClosure: (() async -> Result)? - func forgetRoom() async -> Result { + @concurrent func forgetRoom() async -> Result { forgetRoomCallsCountLock.withLock { forgetRoomUnderlyingCallsCount += 1 } if let forgetRoomClosure = forgetRoomClosure { return await forgetRoomClosure() @@ -1842,23 +1842,23 @@ class BannedRoomProxyMock: BannedRoomProxyProtocol, @unchecked Sendable { } } } -class BugReportServiceMock: BugReportServiceProtocol, @unchecked Sendable { +nonisolated class BugReportServiceMock: BugReportServiceProtocol, @unchecked Sendable { var isEnabled: Bool { get { return underlyingIsEnabled } set(value) { underlyingIsEnabled = value } } - var underlyingIsEnabled: Bool! + nonisolated(unsafe) var underlyingIsEnabled: Bool! var crashedLastRun: Bool { get { return underlyingCrashedLastRun } set(value) { underlyingCrashedLastRun = value } } - var underlyingCrashedLastRun: Bool! - var lastCrashEventID: String? + nonisolated(unsafe) var underlyingCrashedLastRun: Bool! + nonisolated(unsafe) var lastCrashEventID: String? //MARK: - submitBugReport private let submitBugReportProgressListenerCallsCountLock = NSLock() - private var submitBugReportProgressListenerUnderlyingCallsCount = 0 + private nonisolated(unsafe) var submitBugReportProgressListenerUnderlyingCallsCount = 0 var submitBugReportProgressListenerCallsCount: Int { get { submitBugReportProgressListenerCallsCountLock.withLock { submitBugReportProgressListenerUnderlyingCallsCount } } set { submitBugReportProgressListenerCallsCountLock.withLock { submitBugReportProgressListenerUnderlyingCallsCount = newValue } } @@ -1867,27 +1867,27 @@ class BugReportServiceMock: BugReportServiceProtocol, @unchecked Sendable { return submitBugReportProgressListenerCallsCount > 0 } private let submitBugReportProgressListenerReceivedArgumentsLock = NSLock() - private var submitBugReportProgressListenerUnderlyingReceivedArguments: (bugReport: BugReport, progressListener: CurrentValueSubject)? + private nonisolated(unsafe) var submitBugReportProgressListenerUnderlyingReceivedArguments: (bugReport: BugReport, progressListener: CurrentValueSubject)? var submitBugReportProgressListenerReceivedArguments: (bugReport: BugReport, progressListener: CurrentValueSubject)? { get { submitBugReportProgressListenerReceivedArgumentsLock.withLock { submitBugReportProgressListenerUnderlyingReceivedArguments } } set { submitBugReportProgressListenerReceivedArgumentsLock.withLock { submitBugReportProgressListenerUnderlyingReceivedArguments = newValue } } } private let submitBugReportProgressListenerReceivedInvocationsLock = NSLock() - private var submitBugReportProgressListenerUnderlyingReceivedInvocations: [(bugReport: BugReport, progressListener: CurrentValueSubject)] = [] + private nonisolated(unsafe) var submitBugReportProgressListenerUnderlyingReceivedInvocations: [(bugReport: BugReport, progressListener: CurrentValueSubject)] = [] var submitBugReportProgressListenerReceivedInvocations: [(bugReport: BugReport, progressListener: CurrentValueSubject)] { get { submitBugReportProgressListenerReceivedInvocationsLock.withLock { submitBugReportProgressListenerUnderlyingReceivedInvocations } } set { submitBugReportProgressListenerReceivedInvocationsLock.withLock { submitBugReportProgressListenerUnderlyingReceivedInvocations = newValue } } } private let submitBugReportProgressListenerReturnValueLock = NSLock() - private var submitBugReportProgressListenerUnderlyingReturnValue: Result! + private nonisolated(unsafe) var submitBugReportProgressListenerUnderlyingReturnValue: Result! var submitBugReportProgressListenerReturnValue: Result! { get { submitBugReportProgressListenerReturnValueLock.withLock { submitBugReportProgressListenerUnderlyingReturnValue } } set { submitBugReportProgressListenerReturnValueLock.withLock { submitBugReportProgressListenerUnderlyingReturnValue = newValue } } } - var submitBugReportProgressListenerClosure: ((BugReport, CurrentValueSubject) async -> Result)? + nonisolated(unsafe) var submitBugReportProgressListenerClosure: ((BugReport, CurrentValueSubject) async -> Result)? - func submitBugReport(_ bugReport: BugReport, progressListener: CurrentValueSubject) async -> Result { + @concurrent func submitBugReport(_ bugReport: BugReport, progressListener: CurrentValueSubject) async -> Result { submitBugReportProgressListenerCallsCountLock.withLock { submitBugReportProgressListenerUnderlyingCallsCount += 1 } submitBugReportProgressListenerReceivedArguments = (bugReport: bugReport, progressListener: progressListener) submitBugReportProgressListenerReceivedInvocationsLock.withLock { submitBugReportProgressListenerUnderlyingReceivedInvocations.append((bugReport: bugReport, progressListener: progressListener)) } @@ -1898,48 +1898,48 @@ class BugReportServiceMock: BugReportServiceProtocol, @unchecked Sendable { } } } -class CLLocationManagerMock: CLLocationManagerProtocol, @unchecked Sendable { - weak var delegate: CLLocationManagerDelegate? +nonisolated class CLLocationManagerMock: CLLocationManagerProtocol, @unchecked Sendable { + weak nonisolated(unsafe) var delegate: CLLocationManagerDelegate? var allowsBackgroundLocationUpdates: Bool { get { return underlyingAllowsBackgroundLocationUpdates } set(value) { underlyingAllowsBackgroundLocationUpdates = value } } - var underlyingAllowsBackgroundLocationUpdates: Bool! + nonisolated(unsafe) var underlyingAllowsBackgroundLocationUpdates: Bool! var showsBackgroundLocationIndicator: Bool { get { return underlyingShowsBackgroundLocationIndicator } set(value) { underlyingShowsBackgroundLocationIndicator = value } } - var underlyingShowsBackgroundLocationIndicator: Bool! + nonisolated(unsafe) var underlyingShowsBackgroundLocationIndicator: Bool! var desiredAccuracy: CLLocationAccuracy { get { return underlyingDesiredAccuracy } set(value) { underlyingDesiredAccuracy = value } } - var underlyingDesiredAccuracy: CLLocationAccuracy! + nonisolated(unsafe) var underlyingDesiredAccuracy: CLLocationAccuracy! var distanceFilter: CLLocationDistance { get { return underlyingDistanceFilter } set(value) { underlyingDistanceFilter = value } } - var underlyingDistanceFilter: CLLocationDistance! + nonisolated(unsafe) var underlyingDistanceFilter: CLLocationDistance! var pausesLocationUpdatesAutomatically: Bool { get { return underlyingPausesLocationUpdatesAutomatically } set(value) { underlyingPausesLocationUpdatesAutomatically = value } } - var underlyingPausesLocationUpdatesAutomatically: Bool! + nonisolated(unsafe) var underlyingPausesLocationUpdatesAutomatically: Bool! var authorizationStatus: CLAuthorizationStatus { get { return underlyingAuthorizationStatus } set(value) { underlyingAuthorizationStatus = value } } - var underlyingAuthorizationStatus: CLAuthorizationStatus! + nonisolated(unsafe) var underlyingAuthorizationStatus: CLAuthorizationStatus! var accuracyAuthorization: CLAccuracyAuthorization { get { return underlyingAccuracyAuthorization } set(value) { underlyingAccuracyAuthorization = value } } - var underlyingAccuracyAuthorization: CLAccuracyAuthorization! + nonisolated(unsafe) var underlyingAccuracyAuthorization: CLAccuracyAuthorization! //MARK: - requestAlwaysAuthorization private let requestAlwaysAuthorizationCallsCountLock = NSLock() - private var requestAlwaysAuthorizationUnderlyingCallsCount = 0 + private nonisolated(unsafe) var requestAlwaysAuthorizationUnderlyingCallsCount = 0 var requestAlwaysAuthorizationCallsCount: Int { get { requestAlwaysAuthorizationCallsCountLock.withLock { requestAlwaysAuthorizationUnderlyingCallsCount } } set { requestAlwaysAuthorizationCallsCountLock.withLock { requestAlwaysAuthorizationUnderlyingCallsCount = newValue } } @@ -1947,7 +1947,7 @@ class CLLocationManagerMock: CLLocationManagerProtocol, @unchecked Sendable { var requestAlwaysAuthorizationCalled: Bool { return requestAlwaysAuthorizationCallsCount > 0 } - var requestAlwaysAuthorizationClosure: (() -> Void)? + nonisolated(unsafe) var requestAlwaysAuthorizationClosure: (() -> Void)? func requestAlwaysAuthorization() { requestAlwaysAuthorizationCallsCountLock.withLock { requestAlwaysAuthorizationUnderlyingCallsCount += 1 } @@ -1956,7 +1956,7 @@ class CLLocationManagerMock: CLLocationManagerProtocol, @unchecked Sendable { //MARK: - startUpdatingLocation private let startUpdatingLocationCallsCountLock = NSLock() - private var startUpdatingLocationUnderlyingCallsCount = 0 + private nonisolated(unsafe) var startUpdatingLocationUnderlyingCallsCount = 0 var startUpdatingLocationCallsCount: Int { get { startUpdatingLocationCallsCountLock.withLock { startUpdatingLocationUnderlyingCallsCount } } set { startUpdatingLocationCallsCountLock.withLock { startUpdatingLocationUnderlyingCallsCount = newValue } } @@ -1964,7 +1964,7 @@ class CLLocationManagerMock: CLLocationManagerProtocol, @unchecked Sendable { var startUpdatingLocationCalled: Bool { return startUpdatingLocationCallsCount > 0 } - var startUpdatingLocationClosure: (() -> Void)? + nonisolated(unsafe) var startUpdatingLocationClosure: (() -> Void)? func startUpdatingLocation() { startUpdatingLocationCallsCountLock.withLock { startUpdatingLocationUnderlyingCallsCount += 1 } @@ -1973,7 +1973,7 @@ class CLLocationManagerMock: CLLocationManagerProtocol, @unchecked Sendable { //MARK: - stopUpdatingLocation private let stopUpdatingLocationCallsCountLock = NSLock() - private var stopUpdatingLocationUnderlyingCallsCount = 0 + private nonisolated(unsafe) var stopUpdatingLocationUnderlyingCallsCount = 0 var stopUpdatingLocationCallsCount: Int { get { stopUpdatingLocationCallsCountLock.withLock { stopUpdatingLocationUnderlyingCallsCount } } set { stopUpdatingLocationCallsCountLock.withLock { stopUpdatingLocationUnderlyingCallsCount = newValue } } @@ -1981,19 +1981,19 @@ class CLLocationManagerMock: CLLocationManagerProtocol, @unchecked Sendable { var stopUpdatingLocationCalled: Bool { return stopUpdatingLocationCallsCount > 0 } - var stopUpdatingLocationClosure: (() -> Void)? + nonisolated(unsafe) var stopUpdatingLocationClosure: (() -> Void)? func stopUpdatingLocation() { stopUpdatingLocationCallsCountLock.withLock { stopUpdatingLocationUnderlyingCallsCount += 1 } stopUpdatingLocationClosure?() } } -class CXProviderMock: CXProviderProtocol, @unchecked Sendable { +nonisolated class CXProviderMock: CXProviderProtocol, @unchecked Sendable { //MARK: - setDelegate private let setDelegateQueueCallsCountLock = NSLock() - private var setDelegateQueueUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setDelegateQueueUnderlyingCallsCount = 0 var setDelegateQueueCallsCount: Int { get { setDelegateQueueCallsCountLock.withLock { setDelegateQueueUnderlyingCallsCount } } set { setDelegateQueueCallsCountLock.withLock { setDelegateQueueUnderlyingCallsCount = newValue } } @@ -2002,18 +2002,18 @@ class CXProviderMock: CXProviderProtocol, @unchecked Sendable { return setDelegateQueueCallsCount > 0 } private let setDelegateQueueReceivedArgumentsLock = NSLock() - private var setDelegateQueueUnderlyingReceivedArguments: (delegate: CXProviderDelegate?, queue: DispatchQueue?)? + private nonisolated(unsafe) var setDelegateQueueUnderlyingReceivedArguments: (delegate: CXProviderDelegate?, queue: DispatchQueue?)? var setDelegateQueueReceivedArguments: (delegate: CXProviderDelegate?, queue: DispatchQueue?)? { get { setDelegateQueueReceivedArgumentsLock.withLock { setDelegateQueueUnderlyingReceivedArguments } } set { setDelegateQueueReceivedArgumentsLock.withLock { setDelegateQueueUnderlyingReceivedArguments = newValue } } } private let setDelegateQueueReceivedInvocationsLock = NSLock() - private var setDelegateQueueUnderlyingReceivedInvocations: [(delegate: CXProviderDelegate?, queue: DispatchQueue?)] = [] + private nonisolated(unsafe) var setDelegateQueueUnderlyingReceivedInvocations: [(delegate: CXProviderDelegate?, queue: DispatchQueue?)] = [] var setDelegateQueueReceivedInvocations: [(delegate: CXProviderDelegate?, queue: DispatchQueue?)] { get { setDelegateQueueReceivedInvocationsLock.withLock { setDelegateQueueUnderlyingReceivedInvocations } } set { setDelegateQueueReceivedInvocationsLock.withLock { setDelegateQueueUnderlyingReceivedInvocations = newValue } } } - var setDelegateQueueClosure: ((CXProviderDelegate?, DispatchQueue?) -> Void)? + nonisolated(unsafe) var setDelegateQueueClosure: ((CXProviderDelegate?, DispatchQueue?) -> Void)? func setDelegate(_ delegate: CXProviderDelegate?, queue: DispatchQueue?) { setDelegateQueueCallsCountLock.withLock { setDelegateQueueUnderlyingCallsCount += 1 } @@ -2024,7 +2024,7 @@ class CXProviderMock: CXProviderProtocol, @unchecked Sendable { //MARK: - reportNewIncomingCall private let reportNewIncomingCallWithUpdateCompletionCallsCountLock = NSLock() - private var reportNewIncomingCallWithUpdateCompletionUnderlyingCallsCount = 0 + private nonisolated(unsafe) var reportNewIncomingCallWithUpdateCompletionUnderlyingCallsCount = 0 var reportNewIncomingCallWithUpdateCompletionCallsCount: Int { get { reportNewIncomingCallWithUpdateCompletionCallsCountLock.withLock { reportNewIncomingCallWithUpdateCompletionUnderlyingCallsCount } } set { reportNewIncomingCallWithUpdateCompletionCallsCountLock.withLock { reportNewIncomingCallWithUpdateCompletionUnderlyingCallsCount = newValue } } @@ -2033,18 +2033,18 @@ class CXProviderMock: CXProviderProtocol, @unchecked Sendable { return reportNewIncomingCallWithUpdateCompletionCallsCount > 0 } private let reportNewIncomingCallWithUpdateCompletionReceivedArgumentsLock = NSLock() - private var reportNewIncomingCallWithUpdateCompletionUnderlyingReceivedArguments: (uuid: UUID, update: CXCallUpdate, completion: (Error?) -> Void)? + private nonisolated(unsafe) var reportNewIncomingCallWithUpdateCompletionUnderlyingReceivedArguments: (uuid: UUID, update: CXCallUpdate, completion: (Error?) -> Void)? var reportNewIncomingCallWithUpdateCompletionReceivedArguments: (uuid: UUID, update: CXCallUpdate, completion: (Error?) -> Void)? { get { reportNewIncomingCallWithUpdateCompletionReceivedArgumentsLock.withLock { reportNewIncomingCallWithUpdateCompletionUnderlyingReceivedArguments } } set { reportNewIncomingCallWithUpdateCompletionReceivedArgumentsLock.withLock { reportNewIncomingCallWithUpdateCompletionUnderlyingReceivedArguments = newValue } } } private let reportNewIncomingCallWithUpdateCompletionReceivedInvocationsLock = NSLock() - private var reportNewIncomingCallWithUpdateCompletionUnderlyingReceivedInvocations: [(uuid: UUID, update: CXCallUpdate, completion: (Error?) -> Void)] = [] + private nonisolated(unsafe) var reportNewIncomingCallWithUpdateCompletionUnderlyingReceivedInvocations: [(uuid: UUID, update: CXCallUpdate, completion: (Error?) -> Void)] = [] var reportNewIncomingCallWithUpdateCompletionReceivedInvocations: [(uuid: UUID, update: CXCallUpdate, completion: (Error?) -> Void)] { get { reportNewIncomingCallWithUpdateCompletionReceivedInvocationsLock.withLock { reportNewIncomingCallWithUpdateCompletionUnderlyingReceivedInvocations } } set { reportNewIncomingCallWithUpdateCompletionReceivedInvocationsLock.withLock { reportNewIncomingCallWithUpdateCompletionUnderlyingReceivedInvocations = newValue } } } - var reportNewIncomingCallWithUpdateCompletionClosure: ((UUID, CXCallUpdate, @Sendable @escaping (Error?) -> Void) -> Void)? + nonisolated(unsafe) var reportNewIncomingCallWithUpdateCompletionClosure: ((UUID, CXCallUpdate, @Sendable @escaping (Error?) -> Void) -> Void)? func reportNewIncomingCall(with uuid: UUID, update: CXCallUpdate, completion: @Sendable @escaping (Error?) -> Void) { reportNewIncomingCallWithUpdateCompletionCallsCountLock.withLock { reportNewIncomingCallWithUpdateCompletionUnderlyingCallsCount += 1 } @@ -2055,7 +2055,7 @@ class CXProviderMock: CXProviderProtocol, @unchecked Sendable { //MARK: - reportCall private let reportCallWithEndedAtReasonCallsCountLock = NSLock() - private var reportCallWithEndedAtReasonUnderlyingCallsCount = 0 + private nonisolated(unsafe) var reportCallWithEndedAtReasonUnderlyingCallsCount = 0 var reportCallWithEndedAtReasonCallsCount: Int { get { reportCallWithEndedAtReasonCallsCountLock.withLock { reportCallWithEndedAtReasonUnderlyingCallsCount } } set { reportCallWithEndedAtReasonCallsCountLock.withLock { reportCallWithEndedAtReasonUnderlyingCallsCount = newValue } } @@ -2064,18 +2064,18 @@ class CXProviderMock: CXProviderProtocol, @unchecked Sendable { return reportCallWithEndedAtReasonCallsCount > 0 } private let reportCallWithEndedAtReasonReceivedArgumentsLock = NSLock() - private var reportCallWithEndedAtReasonUnderlyingReceivedArguments: (uuid: UUID, endedAt: Date?, reason: CXCallEndedReason)? + private nonisolated(unsafe) var reportCallWithEndedAtReasonUnderlyingReceivedArguments: (uuid: UUID, endedAt: Date?, reason: CXCallEndedReason)? var reportCallWithEndedAtReasonReceivedArguments: (uuid: UUID, endedAt: Date?, reason: CXCallEndedReason)? { get { reportCallWithEndedAtReasonReceivedArgumentsLock.withLock { reportCallWithEndedAtReasonUnderlyingReceivedArguments } } set { reportCallWithEndedAtReasonReceivedArgumentsLock.withLock { reportCallWithEndedAtReasonUnderlyingReceivedArguments = newValue } } } private let reportCallWithEndedAtReasonReceivedInvocationsLock = NSLock() - private var reportCallWithEndedAtReasonUnderlyingReceivedInvocations: [(uuid: UUID, endedAt: Date?, reason: CXCallEndedReason)] = [] + private nonisolated(unsafe) var reportCallWithEndedAtReasonUnderlyingReceivedInvocations: [(uuid: UUID, endedAt: Date?, reason: CXCallEndedReason)] = [] var reportCallWithEndedAtReasonReceivedInvocations: [(uuid: UUID, endedAt: Date?, reason: CXCallEndedReason)] { get { reportCallWithEndedAtReasonReceivedInvocationsLock.withLock { reportCallWithEndedAtReasonUnderlyingReceivedInvocations } } set { reportCallWithEndedAtReasonReceivedInvocationsLock.withLock { reportCallWithEndedAtReasonUnderlyingReceivedInvocations = newValue } } } - var reportCallWithEndedAtReasonClosure: ((UUID, Date?, CXCallEndedReason) -> Void)? + nonisolated(unsafe) var reportCallWithEndedAtReasonClosure: ((UUID, Date?, CXCallEndedReason) -> Void)? func reportCall(with uuid: UUID, endedAt: Date?, reason: CXCallEndedReason) { reportCallWithEndedAtReasonCallsCountLock.withLock { reportCallWithEndedAtReasonUnderlyingCallsCount += 1 } @@ -2084,13 +2084,13 @@ class CXProviderMock: CXProviderProtocol, @unchecked Sendable { reportCallWithEndedAtReasonClosure?(uuid, endedAt, reason) } } -class ClassicAppManagerMock: ClassicAppManagerProtocol, @unchecked Sendable { +nonisolated class ClassicAppManagerMock: ClassicAppManagerProtocol, @unchecked Sendable { //MARK: - loadAccounts - var loadAccountsThrowableError: Error? + nonisolated(unsafe) var loadAccountsThrowableError: Error? private let loadAccountsCallsCountLock = NSLock() - private var loadAccountsUnderlyingCallsCount = 0 + private nonisolated(unsafe) var loadAccountsUnderlyingCallsCount = 0 var loadAccountsCallsCount: Int { get { loadAccountsCallsCountLock.withLock { loadAccountsUnderlyingCallsCount } } set { loadAccountsCallsCountLock.withLock { loadAccountsUnderlyingCallsCount = newValue } } @@ -2100,12 +2100,12 @@ class ClassicAppManagerMock: ClassicAppManagerProtocol, @unchecked Sendable { } private let loadAccountsReturnValueLock = NSLock() - private var loadAccountsUnderlyingReturnValue: [ClassicAppAccount]! + private nonisolated(unsafe) var loadAccountsUnderlyingReturnValue: [ClassicAppAccount]! var loadAccountsReturnValue: [ClassicAppAccount]! { get { loadAccountsReturnValueLock.withLock { loadAccountsUnderlyingReturnValue } } set { loadAccountsReturnValueLock.withLock { loadAccountsUnderlyingReturnValue = newValue } } } - var loadAccountsClosure: (() throws -> [ClassicAppAccount])? + nonisolated(unsafe) var loadAccountsClosure: (() throws -> [ClassicAppAccount])? func loadAccounts() throws -> [ClassicAppAccount] { if let error = loadAccountsThrowableError { @@ -2120,9 +2120,9 @@ class ClassicAppManagerMock: ClassicAppManagerProtocol, @unchecked Sendable { } //MARK: - availableSecrets - var availableSecretsForThrowableError: Error? + nonisolated(unsafe) var availableSecretsForThrowableError: Error? private let availableSecretsForCallsCountLock = NSLock() - private var availableSecretsForUnderlyingCallsCount = 0 + private nonisolated(unsafe) var availableSecretsForUnderlyingCallsCount = 0 var availableSecretsForCallsCount: Int { get { availableSecretsForCallsCountLock.withLock { availableSecretsForUnderlyingCallsCount } } set { availableSecretsForCallsCountLock.withLock { availableSecretsForUnderlyingCallsCount = newValue } } @@ -2131,27 +2131,27 @@ class ClassicAppManagerMock: ClassicAppManagerProtocol, @unchecked Sendable { return availableSecretsForCallsCount > 0 } private let availableSecretsForReceivedAccountLock = NSLock() - private var availableSecretsForUnderlyingReceivedAccount: ClassicAppAccount? + private nonisolated(unsafe) var availableSecretsForUnderlyingReceivedAccount: ClassicAppAccount? var availableSecretsForReceivedAccount: ClassicAppAccount? { get { availableSecretsForReceivedAccountLock.withLock { availableSecretsForUnderlyingReceivedAccount } } set { availableSecretsForReceivedAccountLock.withLock { availableSecretsForUnderlyingReceivedAccount = newValue } } } private let availableSecretsForReceivedInvocationsLock = NSLock() - private var availableSecretsForUnderlyingReceivedInvocations: [ClassicAppAccount] = [] + private nonisolated(unsafe) var availableSecretsForUnderlyingReceivedInvocations: [ClassicAppAccount] = [] var availableSecretsForReceivedInvocations: [ClassicAppAccount] { get { availableSecretsForReceivedInvocationsLock.withLock { availableSecretsForUnderlyingReceivedInvocations } } set { availableSecretsForReceivedInvocationsLock.withLock { availableSecretsForUnderlyingReceivedInvocations = newValue } } } private let availableSecretsForReturnValueLock = NSLock() - private var availableSecretsForUnderlyingReturnValue: ClassicAppAccount.AvailableSecrets! + private nonisolated(unsafe) var availableSecretsForUnderlyingReturnValue: ClassicAppAccount.AvailableSecrets! var availableSecretsForReturnValue: ClassicAppAccount.AvailableSecrets! { get { availableSecretsForReturnValueLock.withLock { availableSecretsForUnderlyingReturnValue } } set { availableSecretsForReturnValueLock.withLock { availableSecretsForUnderlyingReturnValue = newValue } } } - var availableSecretsForClosure: ((ClassicAppAccount) async throws -> ClassicAppAccount.AvailableSecrets)? + nonisolated(unsafe) var availableSecretsForClosure: ((ClassicAppAccount) async throws -> ClassicAppAccount.AvailableSecrets)? - func availableSecrets(for account: ClassicAppAccount) async throws -> ClassicAppAccount.AvailableSecrets { + @concurrent func availableSecrets(for account: ClassicAppAccount) async throws -> ClassicAppAccount.AvailableSecrets { if let error = availableSecretsForThrowableError { throw error } @@ -2166,9 +2166,9 @@ class ClassicAppManagerMock: ClassicAppManagerProtocol, @unchecked Sendable { } //MARK: - secretsBundle - var secretsBundleForThrowableError: Error? + nonisolated(unsafe) var secretsBundleForThrowableError: Error? private let secretsBundleForCallsCountLock = NSLock() - private var secretsBundleForUnderlyingCallsCount = 0 + private nonisolated(unsafe) var secretsBundleForUnderlyingCallsCount = 0 var secretsBundleForCallsCount: Int { get { secretsBundleForCallsCountLock.withLock { secretsBundleForUnderlyingCallsCount } } set { secretsBundleForCallsCountLock.withLock { secretsBundleForUnderlyingCallsCount = newValue } } @@ -2177,27 +2177,27 @@ class ClassicAppManagerMock: ClassicAppManagerProtocol, @unchecked Sendable { return secretsBundleForCallsCount > 0 } private let secretsBundleForReceivedAccountLock = NSLock() - private var secretsBundleForUnderlyingReceivedAccount: ClassicAppAccount? + private nonisolated(unsafe) var secretsBundleForUnderlyingReceivedAccount: ClassicAppAccount? var secretsBundleForReceivedAccount: ClassicAppAccount? { get { secretsBundleForReceivedAccountLock.withLock { secretsBundleForUnderlyingReceivedAccount } } set { secretsBundleForReceivedAccountLock.withLock { secretsBundleForUnderlyingReceivedAccount = newValue } } } private let secretsBundleForReceivedInvocationsLock = NSLock() - private var secretsBundleForUnderlyingReceivedInvocations: [ClassicAppAccount] = [] + private nonisolated(unsafe) var secretsBundleForUnderlyingReceivedInvocations: [ClassicAppAccount] = [] var secretsBundleForReceivedInvocations: [ClassicAppAccount] { get { secretsBundleForReceivedInvocationsLock.withLock { secretsBundleForUnderlyingReceivedInvocations } } set { secretsBundleForReceivedInvocationsLock.withLock { secretsBundleForUnderlyingReceivedInvocations = newValue } } } private let secretsBundleForReturnValueLock = NSLock() - private var secretsBundleForUnderlyingReturnValue: SecretsBundleWithUserId! + private nonisolated(unsafe) var secretsBundleForUnderlyingReturnValue: SecretsBundleWithUserId! var secretsBundleForReturnValue: SecretsBundleWithUserId! { get { secretsBundleForReturnValueLock.withLock { secretsBundleForUnderlyingReturnValue } } set { secretsBundleForReturnValueLock.withLock { secretsBundleForUnderlyingReturnValue = newValue } } } - var secretsBundleForClosure: ((ClassicAppAccount) async throws -> SecretsBundleWithUserId)? + nonisolated(unsafe) var secretsBundleForClosure: ((ClassicAppAccount) async throws -> SecretsBundleWithUserId)? - func secretsBundle(for account: ClassicAppAccount) async throws -> SecretsBundleWithUserId { + @concurrent func secretsBundle(for account: ClassicAppAccount) async throws -> SecretsBundleWithUserId { if let error = secretsBundleForThrowableError { throw error } @@ -2211,117 +2211,117 @@ class ClassicAppManagerMock: ClassicAppManagerProtocol, @unchecked Sendable { } } } -class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { +nonisolated class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { var actionsPublisher: AnyPublisher { get { return underlyingActionsPublisher } set(value) { underlyingActionsPublisher = value } } - var underlyingActionsPublisher: AnyPublisher! + nonisolated(unsafe) var underlyingActionsPublisher: AnyPublisher! var loadingStatePublisher: CurrentValuePublisher { get { return underlyingLoadingStatePublisher } set(value) { underlyingLoadingStatePublisher = value } } - var underlyingLoadingStatePublisher: CurrentValuePublisher! + nonisolated(unsafe) var underlyingLoadingStatePublisher: CurrentValuePublisher! var verificationStatePublisher: CurrentValuePublisher { get { return underlyingVerificationStatePublisher } set(value) { underlyingVerificationStatePublisher = value } } - var underlyingVerificationStatePublisher: CurrentValuePublisher! + nonisolated(unsafe) var underlyingVerificationStatePublisher: CurrentValuePublisher! var homeserverReachabilityPublisher: CurrentValuePublisher { get { return underlyingHomeserverReachabilityPublisher } set(value) { underlyingHomeserverReachabilityPublisher = value } } - var underlyingHomeserverReachabilityPublisher: CurrentValuePublisher! + nonisolated(unsafe) var underlyingHomeserverReachabilityPublisher: CurrentValuePublisher! var userID: String { get { return underlyingUserID } set(value) { underlyingUserID = value } } - var underlyingUserID: String! - var deviceID: String? + nonisolated(unsafe) var underlyingUserID: String! + nonisolated(unsafe) var deviceID: String? var homeserver: String { get { return underlyingHomeserver } set(value) { underlyingHomeserver = value } } - var underlyingHomeserver: String! + nonisolated(unsafe) var underlyingHomeserver: String! var canDeactivateAccount: Bool { get { return underlyingCanDeactivateAccount } set(value) { underlyingCanDeactivateAccount = value } } - var underlyingCanDeactivateAccount: Bool! - var userIDServerName: String? + nonisolated(unsafe) var underlyingCanDeactivateAccount: Bool! + nonisolated(unsafe) var userIDServerName: String? var userDisplayNamePublisher: CurrentValuePublisher { get { return underlyingUserDisplayNamePublisher } set(value) { underlyingUserDisplayNamePublisher = value } } - var underlyingUserDisplayNamePublisher: CurrentValuePublisher! + nonisolated(unsafe) var underlyingUserDisplayNamePublisher: CurrentValuePublisher! var userAvatarURLPublisher: CurrentValuePublisher { get { return underlyingUserAvatarURLPublisher } set(value) { underlyingUserAvatarURLPublisher = value } } - var underlyingUserAvatarURLPublisher: CurrentValuePublisher! + nonisolated(unsafe) var underlyingUserAvatarURLPublisher: CurrentValuePublisher! var ignoredUsersPublisher: CurrentValuePublisher<[String]?, Never> { get { return underlyingIgnoredUsersPublisher } set(value) { underlyingIgnoredUsersPublisher = value } } - var underlyingIgnoredUsersPublisher: CurrentValuePublisher<[String]?, Never>! + nonisolated(unsafe) var underlyingIgnoredUsersPublisher: CurrentValuePublisher<[String]?, Never>! var timelineMediaVisibilityPublisher: CurrentValuePublisher { get { return underlyingTimelineMediaVisibilityPublisher } set(value) { underlyingTimelineMediaVisibilityPublisher = value } } - var underlyingTimelineMediaVisibilityPublisher: CurrentValuePublisher! + nonisolated(unsafe) var underlyingTimelineMediaVisibilityPublisher: CurrentValuePublisher! var hideInviteAvatarsPublisher: CurrentValuePublisher { get { return underlyingHideInviteAvatarsPublisher } set(value) { underlyingHideInviteAvatarsPublisher = value } } - var underlyingHideInviteAvatarsPublisher: CurrentValuePublisher! - var pusherNotificationClientIdentifier: String? + nonisolated(unsafe) var underlyingHideInviteAvatarsPublisher: CurrentValuePublisher! + nonisolated(unsafe) var pusherNotificationClientIdentifier: String? var mediaLoader: MediaLoaderProtocol { get { return underlyingMediaLoader } set(value) { underlyingMediaLoader = value } } - var underlyingMediaLoader: MediaLoaderProtocol! + nonisolated(unsafe) var underlyingMediaLoader: MediaLoaderProtocol! var roomSummaryProvider: RoomSummaryProviderProtocol { get { return underlyingRoomSummaryProvider } set(value) { underlyingRoomSummaryProvider = value } } - var underlyingRoomSummaryProvider: RoomSummaryProviderProtocol! + nonisolated(unsafe) var underlyingRoomSummaryProvider: RoomSummaryProviderProtocol! var alternateRoomSummaryProvider: RoomSummaryProviderProtocol { get { return underlyingAlternateRoomSummaryProvider } set(value) { underlyingAlternateRoomSummaryProvider = value } } - var underlyingAlternateRoomSummaryProvider: RoomSummaryProviderProtocol! + nonisolated(unsafe) var underlyingAlternateRoomSummaryProvider: RoomSummaryProviderProtocol! var staticRoomSummaryProvider: StaticRoomSummaryProviderProtocol { get { return underlyingStaticRoomSummaryProvider } set(value) { underlyingStaticRoomSummaryProvider = value } } - var underlyingStaticRoomSummaryProvider: StaticRoomSummaryProviderProtocol! + nonisolated(unsafe) var underlyingStaticRoomSummaryProvider: StaticRoomSummaryProviderProtocol! var roomsToAwait: Set { get { return underlyingRoomsToAwait } set(value) { underlyingRoomsToAwait = value } } - var underlyingRoomsToAwait: Set! + nonisolated(unsafe) var underlyingRoomsToAwait: Set! var notificationSettings: NotificationSettingsProxyProtocol { get { return underlyingNotificationSettings } set(value) { underlyingNotificationSettings = value } } - var underlyingNotificationSettings: NotificationSettingsProxyProtocol! + nonisolated(unsafe) var underlyingNotificationSettings: NotificationSettingsProxyProtocol! var secureBackupController: SecureBackupControllerProtocol { get { return underlyingSecureBackupController } set(value) { underlyingSecureBackupController = value } } - var underlyingSecureBackupController: SecureBackupControllerProtocol! - var sessionVerificationController: SessionVerificationControllerProxyProtocol? + nonisolated(unsafe) var underlyingSecureBackupController: SecureBackupControllerProtocol! + nonisolated(unsafe) var sessionVerificationController: SessionVerificationControllerProxyProtocol? var spaceService: SpaceServiceProxyProtocol { get { return underlyingSpaceService } set(value) { underlyingSpaceService = value } } - var underlyingSpaceService: SpaceServiceProxyProtocol! + nonisolated(unsafe) var underlyingSpaceService: SpaceServiceProxyProtocol! var capabilities: HomeserverCapabilitiesProxyProtocol { get { return underlyingCapabilities } set(value) { underlyingCapabilities = value } } - var underlyingCapabilities: HomeserverCapabilitiesProxyProtocol! - var isReportRoomSupportedCallsCount = 0 + nonisolated(unsafe) var underlyingCapabilities: HomeserverCapabilitiesProxyProtocol! + nonisolated(unsafe) var isReportRoomSupportedCallsCount = 0 var isReportRoomSupportedCalled: Bool { return isReportRoomSupportedCallsCount > 0 } @@ -2336,9 +2336,9 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { } } } - var underlyingIsReportRoomSupported: Bool! - var isReportRoomSupportedClosure: (() async -> Bool)? - var isLiveKitRTCSupportedCallsCount = 0 + nonisolated(unsafe) var underlyingIsReportRoomSupported: Bool! + nonisolated(unsafe) var isReportRoomSupportedClosure: (() async -> Bool)? + nonisolated(unsafe) var isLiveKitRTCSupportedCallsCount = 0 var isLiveKitRTCSupportedCalled: Bool { return isLiveKitRTCSupportedCallsCount > 0 } @@ -2353,9 +2353,9 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { } } } - var underlyingIsLiveKitRTCSupported: Bool! - var isLiveKitRTCSupportedClosure: (() async -> Bool)? - var isLoginWithQRCodeSupportedCallsCount = 0 + nonisolated(unsafe) var underlyingIsLiveKitRTCSupported: Bool! + nonisolated(unsafe) var isLiveKitRTCSupportedClosure: (() async -> Bool)? + nonisolated(unsafe) var isLoginWithQRCodeSupportedCallsCount = 0 var isLoginWithQRCodeSupportedCalled: Bool { return isLoginWithQRCodeSupportedCallsCount > 0 } @@ -2370,9 +2370,9 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { } } } - var underlyingIsLoginWithQRCodeSupported: Bool! - var isLoginWithQRCodeSupportedClosure: (() async -> Bool)? - var maxMediaUploadSizeCallsCount = 0 + nonisolated(unsafe) var underlyingIsLoginWithQRCodeSupported: Bool! + nonisolated(unsafe) var isLoginWithQRCodeSupportedClosure: (() async -> Bool)? + nonisolated(unsafe) var maxMediaUploadSizeCallsCount = 0 var maxMediaUploadSizeCalled: Bool { return maxMediaUploadSizeCallsCount > 0 } @@ -2387,18 +2387,18 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { } } } - var underlyingMaxMediaUploadSize: Result! - var maxMediaUploadSizeClosure: (() async -> Result)? + nonisolated(unsafe) var underlyingMaxMediaUploadSize: Result! + nonisolated(unsafe) var maxMediaUploadSizeClosure: (() async -> Result)? var liveLocationOwnInfoUpdatesPublisher: AnyPublisher { get { return underlyingLiveLocationOwnInfoUpdatesPublisher } set(value) { underlyingLiveLocationOwnInfoUpdatesPublisher = value } } - var underlyingLiveLocationOwnInfoUpdatesPublisher: AnyPublisher! + nonisolated(unsafe) var underlyingLiveLocationOwnInfoUpdatesPublisher: AnyPublisher! //MARK: - isOnlyDeviceLeft private let isOnlyDeviceLeftCallsCountLock = NSLock() - private var isOnlyDeviceLeftUnderlyingCallsCount = 0 + private nonisolated(unsafe) var isOnlyDeviceLeftUnderlyingCallsCount = 0 var isOnlyDeviceLeftCallsCount: Int { get { isOnlyDeviceLeftCallsCountLock.withLock { isOnlyDeviceLeftUnderlyingCallsCount } } set { isOnlyDeviceLeftCallsCountLock.withLock { isOnlyDeviceLeftUnderlyingCallsCount = newValue } } @@ -2408,14 +2408,14 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { } private let isOnlyDeviceLeftReturnValueLock = NSLock() - private var isOnlyDeviceLeftUnderlyingReturnValue: Result! + private nonisolated(unsafe) var isOnlyDeviceLeftUnderlyingReturnValue: Result! var isOnlyDeviceLeftReturnValue: Result! { get { isOnlyDeviceLeftReturnValueLock.withLock { isOnlyDeviceLeftUnderlyingReturnValue } } set { isOnlyDeviceLeftReturnValueLock.withLock { isOnlyDeviceLeftUnderlyingReturnValue = newValue } } } - var isOnlyDeviceLeftClosure: (() async -> Result)? + nonisolated(unsafe) var isOnlyDeviceLeftClosure: (() async -> Result)? - func isOnlyDeviceLeft() async -> Result { + @concurrent func isOnlyDeviceLeft() async -> Result { isOnlyDeviceLeftCallsCountLock.withLock { isOnlyDeviceLeftUnderlyingCallsCount += 1 } if let isOnlyDeviceLeftClosure = isOnlyDeviceLeftClosure { return await isOnlyDeviceLeftClosure() @@ -2426,7 +2426,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - hasDevicesToVerifyAgainst private let hasDevicesToVerifyAgainstCallsCountLock = NSLock() - private var hasDevicesToVerifyAgainstUnderlyingCallsCount = 0 + private nonisolated(unsafe) var hasDevicesToVerifyAgainstUnderlyingCallsCount = 0 var hasDevicesToVerifyAgainstCallsCount: Int { get { hasDevicesToVerifyAgainstCallsCountLock.withLock { hasDevicesToVerifyAgainstUnderlyingCallsCount } } set { hasDevicesToVerifyAgainstCallsCountLock.withLock { hasDevicesToVerifyAgainstUnderlyingCallsCount = newValue } } @@ -2436,14 +2436,14 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { } private let hasDevicesToVerifyAgainstReturnValueLock = NSLock() - private var hasDevicesToVerifyAgainstUnderlyingReturnValue: Result! + private nonisolated(unsafe) var hasDevicesToVerifyAgainstUnderlyingReturnValue: Result! var hasDevicesToVerifyAgainstReturnValue: Result! { get { hasDevicesToVerifyAgainstReturnValueLock.withLock { hasDevicesToVerifyAgainstUnderlyingReturnValue } } set { hasDevicesToVerifyAgainstReturnValueLock.withLock { hasDevicesToVerifyAgainstUnderlyingReturnValue = newValue } } } - var hasDevicesToVerifyAgainstClosure: (() async -> Result)? + nonisolated(unsafe) var hasDevicesToVerifyAgainstClosure: (() async -> Result)? - func hasDevicesToVerifyAgainst() async -> Result { + @concurrent func hasDevicesToVerifyAgainst() async -> Result { hasDevicesToVerifyAgainstCallsCountLock.withLock { hasDevicesToVerifyAgainstUnderlyingCallsCount += 1 } if let hasDevicesToVerifyAgainstClosure = hasDevicesToVerifyAgainstClosure { return await hasDevicesToVerifyAgainstClosure() @@ -2454,7 +2454,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - resumeServices private let resumeServicesCallsCountLock = NSLock() - private var resumeServicesUnderlyingCallsCount = 0 + private nonisolated(unsafe) var resumeServicesUnderlyingCallsCount = 0 var resumeServicesCallsCount: Int { get { resumeServicesCallsCountLock.withLock { resumeServicesUnderlyingCallsCount } } set { resumeServicesCallsCountLock.withLock { resumeServicesUnderlyingCallsCount = newValue } } @@ -2462,16 +2462,16 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { var resumeServicesCalled: Bool { return resumeServicesCallsCount > 0 } - var resumeServicesClosure: (() async -> Void)? + nonisolated(unsafe) var resumeServicesClosure: (() async -> Void)? - func resumeServices() async { + @concurrent func resumeServices() async { resumeServicesCallsCountLock.withLock { resumeServicesUnderlyingCallsCount += 1 } await resumeServicesClosure?() } //MARK: - pauseServices private let pauseServicesCallsCountLock = NSLock() - private var pauseServicesUnderlyingCallsCount = 0 + private nonisolated(unsafe) var pauseServicesUnderlyingCallsCount = 0 var pauseServicesCallsCount: Int { get { pauseServicesCallsCountLock.withLock { pauseServicesUnderlyingCallsCount } } set { pauseServicesCallsCountLock.withLock { pauseServicesUnderlyingCallsCount = newValue } } @@ -2479,16 +2479,16 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { var pauseServicesCalled: Bool { return pauseServicesCallsCount > 0 } - var pauseServicesClosure: (() async -> Void)? + nonisolated(unsafe) var pauseServicesClosure: (() async -> Void)? - func pauseServices() async { + @concurrent func pauseServices() async { pauseServicesCallsCountLock.withLock { pauseServicesUnderlyingCallsCount += 1 } await pauseServicesClosure?() } //MARK: - expireSyncSessions private let expireSyncSessionsCallsCountLock = NSLock() - private var expireSyncSessionsUnderlyingCallsCount = 0 + private nonisolated(unsafe) var expireSyncSessionsUnderlyingCallsCount = 0 var expireSyncSessionsCallsCount: Int { get { expireSyncSessionsCallsCountLock.withLock { expireSyncSessionsUnderlyingCallsCount } } set { expireSyncSessionsCallsCountLock.withLock { expireSyncSessionsUnderlyingCallsCount = newValue } } @@ -2496,16 +2496,16 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { var expireSyncSessionsCalled: Bool { return expireSyncSessionsCallsCount > 0 } - var expireSyncSessionsClosure: (() async -> Void)? + nonisolated(unsafe) var expireSyncSessionsClosure: (() async -> Void)? - func expireSyncSessions() async { + @concurrent func expireSyncSessions() async { expireSyncSessionsCallsCountLock.withLock { expireSyncSessionsUnderlyingCallsCount += 1 } await expireSyncSessionsClosure?() } //MARK: - accountURL private let accountURLActionCallsCountLock = NSLock() - private var accountURLActionUnderlyingCallsCount = 0 + private nonisolated(unsafe) var accountURLActionUnderlyingCallsCount = 0 var accountURLActionCallsCount: Int { get { accountURLActionCallsCountLock.withLock { accountURLActionUnderlyingCallsCount } } set { accountURLActionCallsCountLock.withLock { accountURLActionUnderlyingCallsCount = newValue } } @@ -2514,27 +2514,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return accountURLActionCallsCount > 0 } private let accountURLActionReceivedActionLock = NSLock() - private var accountURLActionUnderlyingReceivedAction: AccountManagementAction? + private nonisolated(unsafe) var accountURLActionUnderlyingReceivedAction: AccountManagementAction? var accountURLActionReceivedAction: AccountManagementAction? { get { accountURLActionReceivedActionLock.withLock { accountURLActionUnderlyingReceivedAction } } set { accountURLActionReceivedActionLock.withLock { accountURLActionUnderlyingReceivedAction = newValue } } } private let accountURLActionReceivedInvocationsLock = NSLock() - private var accountURLActionUnderlyingReceivedInvocations: [AccountManagementAction] = [] + private nonisolated(unsafe) var accountURLActionUnderlyingReceivedInvocations: [AccountManagementAction] = [] var accountURLActionReceivedInvocations: [AccountManagementAction] { get { accountURLActionReceivedInvocationsLock.withLock { accountURLActionUnderlyingReceivedInvocations } } set { accountURLActionReceivedInvocationsLock.withLock { accountURLActionUnderlyingReceivedInvocations = newValue } } } private let accountURLActionReturnValueLock = NSLock() - private var accountURLActionUnderlyingReturnValue: URL? + private nonisolated(unsafe) var accountURLActionUnderlyingReturnValue: URL? var accountURLActionReturnValue: URL? { get { accountURLActionReturnValueLock.withLock { accountURLActionUnderlyingReturnValue } } set { accountURLActionReturnValueLock.withLock { accountURLActionUnderlyingReturnValue = newValue } } } - var accountURLActionClosure: ((AccountManagementAction) async -> URL?)? + nonisolated(unsafe) var accountURLActionClosure: ((AccountManagementAction) async -> URL?)? - func accountURL(action: AccountManagementAction) async -> URL? { + @concurrent func accountURL(action: AccountManagementAction) async -> URL? { accountURLActionCallsCountLock.withLock { accountURLActionUnderlyingCallsCount += 1 } accountURLActionReceivedAction = action accountURLActionReceivedInvocationsLock.withLock { accountURLActionUnderlyingReceivedInvocations.append(action) } @@ -2547,7 +2547,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - directRoomForUserID private let directRoomForUserIDCallsCountLock = NSLock() - private var directRoomForUserIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var directRoomForUserIDUnderlyingCallsCount = 0 var directRoomForUserIDCallsCount: Int { get { directRoomForUserIDCallsCountLock.withLock { directRoomForUserIDUnderlyingCallsCount } } set { directRoomForUserIDCallsCountLock.withLock { directRoomForUserIDUnderlyingCallsCount = newValue } } @@ -2556,25 +2556,25 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return directRoomForUserIDCallsCount > 0 } private let directRoomForUserIDReceivedUserIDLock = NSLock() - private var directRoomForUserIDUnderlyingReceivedUserID: String? + private nonisolated(unsafe) var directRoomForUserIDUnderlyingReceivedUserID: String? var directRoomForUserIDReceivedUserID: String? { get { directRoomForUserIDReceivedUserIDLock.withLock { directRoomForUserIDUnderlyingReceivedUserID } } set { directRoomForUserIDReceivedUserIDLock.withLock { directRoomForUserIDUnderlyingReceivedUserID = newValue } } } private let directRoomForUserIDReceivedInvocationsLock = NSLock() - private var directRoomForUserIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var directRoomForUserIDUnderlyingReceivedInvocations: [String] = [] var directRoomForUserIDReceivedInvocations: [String] { get { directRoomForUserIDReceivedInvocationsLock.withLock { directRoomForUserIDUnderlyingReceivedInvocations } } set { directRoomForUserIDReceivedInvocationsLock.withLock { directRoomForUserIDUnderlyingReceivedInvocations = newValue } } } private let directRoomForUserIDReturnValueLock = NSLock() - private var directRoomForUserIDUnderlyingReturnValue: Result! + private nonisolated(unsafe) var directRoomForUserIDUnderlyingReturnValue: Result! var directRoomForUserIDReturnValue: Result! { get { directRoomForUserIDReturnValueLock.withLock { directRoomForUserIDUnderlyingReturnValue } } set { directRoomForUserIDReturnValueLock.withLock { directRoomForUserIDUnderlyingReturnValue = newValue } } } - var directRoomForUserIDClosure: ((String) -> Result)? + nonisolated(unsafe) var directRoomForUserIDClosure: ((String) -> Result)? func directRoomForUserID(_ userID: String) -> Result { directRoomForUserIDCallsCountLock.withLock { directRoomForUserIDUnderlyingCallsCount += 1 } @@ -2589,7 +2589,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - createDirectRoom private let createDirectRoomWithExpectedRoomNameCallsCountLock = NSLock() - private var createDirectRoomWithExpectedRoomNameUnderlyingCallsCount = 0 + private nonisolated(unsafe) var createDirectRoomWithExpectedRoomNameUnderlyingCallsCount = 0 var createDirectRoomWithExpectedRoomNameCallsCount: Int { get { createDirectRoomWithExpectedRoomNameCallsCountLock.withLock { createDirectRoomWithExpectedRoomNameUnderlyingCallsCount } } set { createDirectRoomWithExpectedRoomNameCallsCountLock.withLock { createDirectRoomWithExpectedRoomNameUnderlyingCallsCount = newValue } } @@ -2598,27 +2598,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return createDirectRoomWithExpectedRoomNameCallsCount > 0 } private let createDirectRoomWithExpectedRoomNameReceivedArgumentsLock = NSLock() - private var createDirectRoomWithExpectedRoomNameUnderlyingReceivedArguments: (userID: String, expectedRoomName: String?)? + private nonisolated(unsafe) var createDirectRoomWithExpectedRoomNameUnderlyingReceivedArguments: (userID: String, expectedRoomName: String?)? var createDirectRoomWithExpectedRoomNameReceivedArguments: (userID: String, expectedRoomName: String?)? { get { createDirectRoomWithExpectedRoomNameReceivedArgumentsLock.withLock { createDirectRoomWithExpectedRoomNameUnderlyingReceivedArguments } } set { createDirectRoomWithExpectedRoomNameReceivedArgumentsLock.withLock { createDirectRoomWithExpectedRoomNameUnderlyingReceivedArguments = newValue } } } private let createDirectRoomWithExpectedRoomNameReceivedInvocationsLock = NSLock() - private var createDirectRoomWithExpectedRoomNameUnderlyingReceivedInvocations: [(userID: String, expectedRoomName: String?)] = [] + private nonisolated(unsafe) var createDirectRoomWithExpectedRoomNameUnderlyingReceivedInvocations: [(userID: String, expectedRoomName: String?)] = [] var createDirectRoomWithExpectedRoomNameReceivedInvocations: [(userID: String, expectedRoomName: String?)] { get { createDirectRoomWithExpectedRoomNameReceivedInvocationsLock.withLock { createDirectRoomWithExpectedRoomNameUnderlyingReceivedInvocations } } set { createDirectRoomWithExpectedRoomNameReceivedInvocationsLock.withLock { createDirectRoomWithExpectedRoomNameUnderlyingReceivedInvocations = newValue } } } private let createDirectRoomWithExpectedRoomNameReturnValueLock = NSLock() - private var createDirectRoomWithExpectedRoomNameUnderlyingReturnValue: Result! + private nonisolated(unsafe) var createDirectRoomWithExpectedRoomNameUnderlyingReturnValue: Result! var createDirectRoomWithExpectedRoomNameReturnValue: Result! { get { createDirectRoomWithExpectedRoomNameReturnValueLock.withLock { createDirectRoomWithExpectedRoomNameUnderlyingReturnValue } } set { createDirectRoomWithExpectedRoomNameReturnValueLock.withLock { createDirectRoomWithExpectedRoomNameUnderlyingReturnValue = newValue } } } - var createDirectRoomWithExpectedRoomNameClosure: ((String, String?) async -> Result)? + nonisolated(unsafe) var createDirectRoomWithExpectedRoomNameClosure: ((String, String?) async -> Result)? - func createDirectRoom(with userID: String, expectedRoomName: String?) async -> Result { + @concurrent func createDirectRoom(with userID: String, expectedRoomName: String?) async -> Result { createDirectRoomWithExpectedRoomNameCallsCountLock.withLock { createDirectRoomWithExpectedRoomNameUnderlyingCallsCount += 1 } createDirectRoomWithExpectedRoomNameReceivedArguments = (userID: userID, expectedRoomName: expectedRoomName) createDirectRoomWithExpectedRoomNameReceivedInvocationsLock.withLock { createDirectRoomWithExpectedRoomNameUnderlyingReceivedInvocations.append((userID: userID, expectedRoomName: expectedRoomName)) } @@ -2631,7 +2631,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - createRoom private let createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartCallsCountLock = NSLock() - private var createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartUnderlyingCallsCount = 0 + private nonisolated(unsafe) var createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartUnderlyingCallsCount = 0 var createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartCallsCount: Int { get { createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartCallsCountLock.withLock { createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartUnderlyingCallsCount } } set { createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartCallsCountLock.withLock { createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartUnderlyingCallsCount = newValue } } @@ -2640,27 +2640,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartCallsCount > 0 } private let createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartReceivedArgumentsLock = NSLock() - private var createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartUnderlyingReceivedArguments: (name: String?, topic: String?, accessType: CreateRoomAccessType, isSpace: Bool, userIDs: [String], avatarURL: URL?, aliasLocalPart: String?)? + private nonisolated(unsafe) var createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartUnderlyingReceivedArguments: (name: String?, topic: String?, accessType: CreateRoomAccessType, isSpace: Bool, userIDs: [String], avatarURL: URL?, aliasLocalPart: String?)? var createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartReceivedArguments: (name: String?, topic: String?, accessType: CreateRoomAccessType, isSpace: Bool, userIDs: [String], avatarURL: URL?, aliasLocalPart: String?)? { get { createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartReceivedArgumentsLock.withLock { createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartUnderlyingReceivedArguments } } set { createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartReceivedArgumentsLock.withLock { createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartUnderlyingReceivedArguments = newValue } } } private let createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartReceivedInvocationsLock = NSLock() - private var createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartUnderlyingReceivedInvocations: [(name: String?, topic: String?, accessType: CreateRoomAccessType, isSpace: Bool, userIDs: [String], avatarURL: URL?, aliasLocalPart: String?)] = [] + private nonisolated(unsafe) var createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartUnderlyingReceivedInvocations: [(name: String?, topic: String?, accessType: CreateRoomAccessType, isSpace: Bool, userIDs: [String], avatarURL: URL?, aliasLocalPart: String?)] = [] var createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartReceivedInvocations: [(name: String?, topic: String?, accessType: CreateRoomAccessType, isSpace: Bool, userIDs: [String], avatarURL: URL?, aliasLocalPart: String?)] { get { createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartReceivedInvocationsLock.withLock { createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartUnderlyingReceivedInvocations } } set { createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartReceivedInvocationsLock.withLock { createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartUnderlyingReceivedInvocations = newValue } } } private let createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartReturnValueLock = NSLock() - private var createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartUnderlyingReturnValue: Result! + private nonisolated(unsafe) var createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartUnderlyingReturnValue: Result! var createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartReturnValue: Result! { get { createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartReturnValueLock.withLock { createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartUnderlyingReturnValue } } set { createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartReturnValueLock.withLock { createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartUnderlyingReturnValue = newValue } } } - var createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartClosure: ((String?, String?, CreateRoomAccessType, Bool, [String], URL?, String?) async -> Result)? + nonisolated(unsafe) var createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartClosure: ((String?, String?, CreateRoomAccessType, Bool, [String], URL?, String?) async -> Result)? - func createRoom(name: String?, topic: String?, accessType: CreateRoomAccessType, isSpace: Bool, userIDs: [String], avatarURL: URL?, aliasLocalPart: String?) async -> Result { + @concurrent func createRoom(name: String?, topic: String?, accessType: CreateRoomAccessType, isSpace: Bool, userIDs: [String], avatarURL: URL?, aliasLocalPart: String?) async -> Result { createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartCallsCountLock.withLock { createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartUnderlyingCallsCount += 1 } createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartReceivedArguments = (name: name, topic: topic, accessType: accessType, isSpace: isSpace, userIDs: userIDs, avatarURL: avatarURL, aliasLocalPart: aliasLocalPart) createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartReceivedInvocationsLock.withLock { createRoomNameTopicAccessTypeIsSpaceUserIDsAvatarURLAliasLocalPartUnderlyingReceivedInvocations.append((name: name, topic: topic, accessType: accessType, isSpace: isSpace, userIDs: userIDs, avatarURL: avatarURL, aliasLocalPart: aliasLocalPart)) } @@ -2673,7 +2673,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - joinRoom private let joinRoomViaCallsCountLock = NSLock() - private var joinRoomViaUnderlyingCallsCount = 0 + private nonisolated(unsafe) var joinRoomViaUnderlyingCallsCount = 0 var joinRoomViaCallsCount: Int { get { joinRoomViaCallsCountLock.withLock { joinRoomViaUnderlyingCallsCount } } set { joinRoomViaCallsCountLock.withLock { joinRoomViaUnderlyingCallsCount = newValue } } @@ -2682,27 +2682,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return joinRoomViaCallsCount > 0 } private let joinRoomViaReceivedArgumentsLock = NSLock() - private var joinRoomViaUnderlyingReceivedArguments: (roomID: String, via: [String])? + private nonisolated(unsafe) var joinRoomViaUnderlyingReceivedArguments: (roomID: String, via: [String])? var joinRoomViaReceivedArguments: (roomID: String, via: [String])? { get { joinRoomViaReceivedArgumentsLock.withLock { joinRoomViaUnderlyingReceivedArguments } } set { joinRoomViaReceivedArgumentsLock.withLock { joinRoomViaUnderlyingReceivedArguments = newValue } } } private let joinRoomViaReceivedInvocationsLock = NSLock() - private var joinRoomViaUnderlyingReceivedInvocations: [(roomID: String, via: [String])] = [] + private nonisolated(unsafe) var joinRoomViaUnderlyingReceivedInvocations: [(roomID: String, via: [String])] = [] var joinRoomViaReceivedInvocations: [(roomID: String, via: [String])] { get { joinRoomViaReceivedInvocationsLock.withLock { joinRoomViaUnderlyingReceivedInvocations } } set { joinRoomViaReceivedInvocationsLock.withLock { joinRoomViaUnderlyingReceivedInvocations = newValue } } } private let joinRoomViaReturnValueLock = NSLock() - private var joinRoomViaUnderlyingReturnValue: Result! + private nonisolated(unsafe) var joinRoomViaUnderlyingReturnValue: Result! var joinRoomViaReturnValue: Result! { get { joinRoomViaReturnValueLock.withLock { joinRoomViaUnderlyingReturnValue } } set { joinRoomViaReturnValueLock.withLock { joinRoomViaUnderlyingReturnValue = newValue } } } - var joinRoomViaClosure: ((String, [String]) async -> Result)? + nonisolated(unsafe) var joinRoomViaClosure: ((String, [String]) async -> Result)? - func joinRoom(_ roomID: String, via: [String]) async -> Result { + @concurrent func joinRoom(_ roomID: String, via: [String]) async -> Result { joinRoomViaCallsCountLock.withLock { joinRoomViaUnderlyingCallsCount += 1 } joinRoomViaReceivedArguments = (roomID: roomID, via: via) joinRoomViaReceivedInvocationsLock.withLock { joinRoomViaUnderlyingReceivedInvocations.append((roomID: roomID, via: via)) } @@ -2715,7 +2715,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - joinRoomAlias private let joinRoomAliasCallsCountLock = NSLock() - private var joinRoomAliasUnderlyingCallsCount = 0 + private nonisolated(unsafe) var joinRoomAliasUnderlyingCallsCount = 0 var joinRoomAliasCallsCount: Int { get { joinRoomAliasCallsCountLock.withLock { joinRoomAliasUnderlyingCallsCount } } set { joinRoomAliasCallsCountLock.withLock { joinRoomAliasUnderlyingCallsCount = newValue } } @@ -2724,27 +2724,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return joinRoomAliasCallsCount > 0 } private let joinRoomAliasReceivedRoomAliasLock = NSLock() - private var joinRoomAliasUnderlyingReceivedRoomAlias: String? + private nonisolated(unsafe) var joinRoomAliasUnderlyingReceivedRoomAlias: String? var joinRoomAliasReceivedRoomAlias: String? { get { joinRoomAliasReceivedRoomAliasLock.withLock { joinRoomAliasUnderlyingReceivedRoomAlias } } set { joinRoomAliasReceivedRoomAliasLock.withLock { joinRoomAliasUnderlyingReceivedRoomAlias = newValue } } } private let joinRoomAliasReceivedInvocationsLock = NSLock() - private var joinRoomAliasUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var joinRoomAliasUnderlyingReceivedInvocations: [String] = [] var joinRoomAliasReceivedInvocations: [String] { get { joinRoomAliasReceivedInvocationsLock.withLock { joinRoomAliasUnderlyingReceivedInvocations } } set { joinRoomAliasReceivedInvocationsLock.withLock { joinRoomAliasUnderlyingReceivedInvocations = newValue } } } private let joinRoomAliasReturnValueLock = NSLock() - private var joinRoomAliasUnderlyingReturnValue: Result! + private nonisolated(unsafe) var joinRoomAliasUnderlyingReturnValue: Result! var joinRoomAliasReturnValue: Result! { get { joinRoomAliasReturnValueLock.withLock { joinRoomAliasUnderlyingReturnValue } } set { joinRoomAliasReturnValueLock.withLock { joinRoomAliasUnderlyingReturnValue = newValue } } } - var joinRoomAliasClosure: ((String) async -> Result)? + nonisolated(unsafe) var joinRoomAliasClosure: ((String) async -> Result)? - func joinRoomAlias(_ roomAlias: String) async -> Result { + @concurrent func joinRoomAlias(_ roomAlias: String) async -> Result { joinRoomAliasCallsCountLock.withLock { joinRoomAliasUnderlyingCallsCount += 1 } joinRoomAliasReceivedRoomAlias = roomAlias joinRoomAliasReceivedInvocationsLock.withLock { joinRoomAliasUnderlyingReceivedInvocations.append(roomAlias) } @@ -2757,7 +2757,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - knockRoom private let knockRoomViaMessageCallsCountLock = NSLock() - private var knockRoomViaMessageUnderlyingCallsCount = 0 + private nonisolated(unsafe) var knockRoomViaMessageUnderlyingCallsCount = 0 var knockRoomViaMessageCallsCount: Int { get { knockRoomViaMessageCallsCountLock.withLock { knockRoomViaMessageUnderlyingCallsCount } } set { knockRoomViaMessageCallsCountLock.withLock { knockRoomViaMessageUnderlyingCallsCount = newValue } } @@ -2766,27 +2766,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return knockRoomViaMessageCallsCount > 0 } private let knockRoomViaMessageReceivedArgumentsLock = NSLock() - private var knockRoomViaMessageUnderlyingReceivedArguments: (roomID: String, via: [String], message: String?)? + private nonisolated(unsafe) var knockRoomViaMessageUnderlyingReceivedArguments: (roomID: String, via: [String], message: String?)? var knockRoomViaMessageReceivedArguments: (roomID: String, via: [String], message: String?)? { get { knockRoomViaMessageReceivedArgumentsLock.withLock { knockRoomViaMessageUnderlyingReceivedArguments } } set { knockRoomViaMessageReceivedArgumentsLock.withLock { knockRoomViaMessageUnderlyingReceivedArguments = newValue } } } private let knockRoomViaMessageReceivedInvocationsLock = NSLock() - private var knockRoomViaMessageUnderlyingReceivedInvocations: [(roomID: String, via: [String], message: String?)] = [] + private nonisolated(unsafe) var knockRoomViaMessageUnderlyingReceivedInvocations: [(roomID: String, via: [String], message: String?)] = [] var knockRoomViaMessageReceivedInvocations: [(roomID: String, via: [String], message: String?)] { get { knockRoomViaMessageReceivedInvocationsLock.withLock { knockRoomViaMessageUnderlyingReceivedInvocations } } set { knockRoomViaMessageReceivedInvocationsLock.withLock { knockRoomViaMessageUnderlyingReceivedInvocations = newValue } } } private let knockRoomViaMessageReturnValueLock = NSLock() - private var knockRoomViaMessageUnderlyingReturnValue: Result! + private nonisolated(unsafe) var knockRoomViaMessageUnderlyingReturnValue: Result! var knockRoomViaMessageReturnValue: Result! { get { knockRoomViaMessageReturnValueLock.withLock { knockRoomViaMessageUnderlyingReturnValue } } set { knockRoomViaMessageReturnValueLock.withLock { knockRoomViaMessageUnderlyingReturnValue = newValue } } } - var knockRoomViaMessageClosure: ((String, [String], String?) async -> Result)? + nonisolated(unsafe) var knockRoomViaMessageClosure: ((String, [String], String?) async -> Result)? - func knockRoom(_ roomID: String, via: [String], message: String?) async -> Result { + @concurrent func knockRoom(_ roomID: String, via: [String], message: String?) async -> Result { knockRoomViaMessageCallsCountLock.withLock { knockRoomViaMessageUnderlyingCallsCount += 1 } knockRoomViaMessageReceivedArguments = (roomID: roomID, via: via, message: message) knockRoomViaMessageReceivedInvocationsLock.withLock { knockRoomViaMessageUnderlyingReceivedInvocations.append((roomID: roomID, via: via, message: message)) } @@ -2799,7 +2799,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - knockRoomAlias private let knockRoomAliasMessageCallsCountLock = NSLock() - private var knockRoomAliasMessageUnderlyingCallsCount = 0 + private nonisolated(unsafe) var knockRoomAliasMessageUnderlyingCallsCount = 0 var knockRoomAliasMessageCallsCount: Int { get { knockRoomAliasMessageCallsCountLock.withLock { knockRoomAliasMessageUnderlyingCallsCount } } set { knockRoomAliasMessageCallsCountLock.withLock { knockRoomAliasMessageUnderlyingCallsCount = newValue } } @@ -2808,27 +2808,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return knockRoomAliasMessageCallsCount > 0 } private let knockRoomAliasMessageReceivedArgumentsLock = NSLock() - private var knockRoomAliasMessageUnderlyingReceivedArguments: (roomAlias: String, message: String?)? + private nonisolated(unsafe) var knockRoomAliasMessageUnderlyingReceivedArguments: (roomAlias: String, message: String?)? var knockRoomAliasMessageReceivedArguments: (roomAlias: String, message: String?)? { get { knockRoomAliasMessageReceivedArgumentsLock.withLock { knockRoomAliasMessageUnderlyingReceivedArguments } } set { knockRoomAliasMessageReceivedArgumentsLock.withLock { knockRoomAliasMessageUnderlyingReceivedArguments = newValue } } } private let knockRoomAliasMessageReceivedInvocationsLock = NSLock() - private var knockRoomAliasMessageUnderlyingReceivedInvocations: [(roomAlias: String, message: String?)] = [] + private nonisolated(unsafe) var knockRoomAliasMessageUnderlyingReceivedInvocations: [(roomAlias: String, message: String?)] = [] var knockRoomAliasMessageReceivedInvocations: [(roomAlias: String, message: String?)] { get { knockRoomAliasMessageReceivedInvocationsLock.withLock { knockRoomAliasMessageUnderlyingReceivedInvocations } } set { knockRoomAliasMessageReceivedInvocationsLock.withLock { knockRoomAliasMessageUnderlyingReceivedInvocations = newValue } } } private let knockRoomAliasMessageReturnValueLock = NSLock() - private var knockRoomAliasMessageUnderlyingReturnValue: Result! + private nonisolated(unsafe) var knockRoomAliasMessageUnderlyingReturnValue: Result! var knockRoomAliasMessageReturnValue: Result! { get { knockRoomAliasMessageReturnValueLock.withLock { knockRoomAliasMessageUnderlyingReturnValue } } set { knockRoomAliasMessageReturnValueLock.withLock { knockRoomAliasMessageUnderlyingReturnValue = newValue } } } - var knockRoomAliasMessageClosure: ((String, String?) async -> Result)? + nonisolated(unsafe) var knockRoomAliasMessageClosure: ((String, String?) async -> Result)? - func knockRoomAlias(_ roomAlias: String, message: String?) async -> Result { + @concurrent func knockRoomAlias(_ roomAlias: String, message: String?) async -> Result { knockRoomAliasMessageCallsCountLock.withLock { knockRoomAliasMessageUnderlyingCallsCount += 1 } knockRoomAliasMessageReceivedArguments = (roomAlias: roomAlias, message: message) knockRoomAliasMessageReceivedInvocationsLock.withLock { knockRoomAliasMessageUnderlyingReceivedInvocations.append((roomAlias: roomAlias, message: message)) } @@ -2841,7 +2841,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - canJoinRoom private let canJoinRoomWithCallsCountLock = NSLock() - private var canJoinRoomWithUnderlyingCallsCount = 0 + private nonisolated(unsafe) var canJoinRoomWithUnderlyingCallsCount = 0 var canJoinRoomWithCallsCount: Int { get { canJoinRoomWithCallsCountLock.withLock { canJoinRoomWithUnderlyingCallsCount } } set { canJoinRoomWithCallsCountLock.withLock { canJoinRoomWithUnderlyingCallsCount = newValue } } @@ -2850,25 +2850,25 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return canJoinRoomWithCallsCount > 0 } private let canJoinRoomWithReceivedRulesLock = NSLock() - private var canJoinRoomWithUnderlyingReceivedRules: [AllowRule]? + private nonisolated(unsafe) var canJoinRoomWithUnderlyingReceivedRules: [AllowRule]? var canJoinRoomWithReceivedRules: [AllowRule]? { get { canJoinRoomWithReceivedRulesLock.withLock { canJoinRoomWithUnderlyingReceivedRules } } set { canJoinRoomWithReceivedRulesLock.withLock { canJoinRoomWithUnderlyingReceivedRules = newValue } } } private let canJoinRoomWithReceivedInvocationsLock = NSLock() - private var canJoinRoomWithUnderlyingReceivedInvocations: [[AllowRule]] = [] + private nonisolated(unsafe) var canJoinRoomWithUnderlyingReceivedInvocations: [[AllowRule]] = [] var canJoinRoomWithReceivedInvocations: [[AllowRule]] { get { canJoinRoomWithReceivedInvocationsLock.withLock { canJoinRoomWithUnderlyingReceivedInvocations } } set { canJoinRoomWithReceivedInvocationsLock.withLock { canJoinRoomWithUnderlyingReceivedInvocations = newValue } } } private let canJoinRoomWithReturnValueLock = NSLock() - private var canJoinRoomWithUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var canJoinRoomWithUnderlyingReturnValue: Bool! var canJoinRoomWithReturnValue: Bool! { get { canJoinRoomWithReturnValueLock.withLock { canJoinRoomWithUnderlyingReturnValue } } set { canJoinRoomWithReturnValueLock.withLock { canJoinRoomWithUnderlyingReturnValue = newValue } } } - var canJoinRoomWithClosure: (([AllowRule]) -> Bool)? + nonisolated(unsafe) var canJoinRoomWithClosure: (([AllowRule]) -> Bool)? func canJoinRoom(with rules: [AllowRule]) -> Bool { canJoinRoomWithCallsCountLock.withLock { canJoinRoomWithUnderlyingCallsCount += 1 } @@ -2883,7 +2883,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - uploadMedia private let uploadMediaCallsCountLock = NSLock() - private var uploadMediaUnderlyingCallsCount = 0 + private nonisolated(unsafe) var uploadMediaUnderlyingCallsCount = 0 var uploadMediaCallsCount: Int { get { uploadMediaCallsCountLock.withLock { uploadMediaUnderlyingCallsCount } } set { uploadMediaCallsCountLock.withLock { uploadMediaUnderlyingCallsCount = newValue } } @@ -2892,27 +2892,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return uploadMediaCallsCount > 0 } private let uploadMediaReceivedMediaLock = NSLock() - private var uploadMediaUnderlyingReceivedMedia: MediaInfo? + private nonisolated(unsafe) var uploadMediaUnderlyingReceivedMedia: MediaInfo? var uploadMediaReceivedMedia: MediaInfo? { get { uploadMediaReceivedMediaLock.withLock { uploadMediaUnderlyingReceivedMedia } } set { uploadMediaReceivedMediaLock.withLock { uploadMediaUnderlyingReceivedMedia = newValue } } } private let uploadMediaReceivedInvocationsLock = NSLock() - private var uploadMediaUnderlyingReceivedInvocations: [MediaInfo] = [] + private nonisolated(unsafe) var uploadMediaUnderlyingReceivedInvocations: [MediaInfo] = [] var uploadMediaReceivedInvocations: [MediaInfo] { get { uploadMediaReceivedInvocationsLock.withLock { uploadMediaUnderlyingReceivedInvocations } } set { uploadMediaReceivedInvocationsLock.withLock { uploadMediaUnderlyingReceivedInvocations = newValue } } } private let uploadMediaReturnValueLock = NSLock() - private var uploadMediaUnderlyingReturnValue: Result! + private nonisolated(unsafe) var uploadMediaUnderlyingReturnValue: Result! var uploadMediaReturnValue: Result! { get { uploadMediaReturnValueLock.withLock { uploadMediaUnderlyingReturnValue } } set { uploadMediaReturnValueLock.withLock { uploadMediaUnderlyingReturnValue = newValue } } } - var uploadMediaClosure: ((MediaInfo) async -> Result)? + nonisolated(unsafe) var uploadMediaClosure: ((MediaInfo) async -> Result)? - func uploadMedia(_ media: MediaInfo) async -> Result { + @concurrent func uploadMedia(_ media: MediaInfo) async -> Result { uploadMediaCallsCountLock.withLock { uploadMediaUnderlyingCallsCount += 1 } uploadMediaReceivedMedia = media uploadMediaReceivedInvocationsLock.withLock { uploadMediaUnderlyingReceivedInvocations.append(media) } @@ -2925,7 +2925,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - roomForIdentifier private let roomForIdentifierCallsCountLock = NSLock() - private var roomForIdentifierUnderlyingCallsCount = 0 + private nonisolated(unsafe) var roomForIdentifierUnderlyingCallsCount = 0 var roomForIdentifierCallsCount: Int { get { roomForIdentifierCallsCountLock.withLock { roomForIdentifierUnderlyingCallsCount } } set { roomForIdentifierCallsCountLock.withLock { roomForIdentifierUnderlyingCallsCount = newValue } } @@ -2934,27 +2934,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return roomForIdentifierCallsCount > 0 } private let roomForIdentifierReceivedIdentifierLock = NSLock() - private var roomForIdentifierUnderlyingReceivedIdentifier: String? + private nonisolated(unsafe) var roomForIdentifierUnderlyingReceivedIdentifier: String? var roomForIdentifierReceivedIdentifier: String? { get { roomForIdentifierReceivedIdentifierLock.withLock { roomForIdentifierUnderlyingReceivedIdentifier } } set { roomForIdentifierReceivedIdentifierLock.withLock { roomForIdentifierUnderlyingReceivedIdentifier = newValue } } } private let roomForIdentifierReceivedInvocationsLock = NSLock() - private var roomForIdentifierUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var roomForIdentifierUnderlyingReceivedInvocations: [String] = [] var roomForIdentifierReceivedInvocations: [String] { get { roomForIdentifierReceivedInvocationsLock.withLock { roomForIdentifierUnderlyingReceivedInvocations } } set { roomForIdentifierReceivedInvocationsLock.withLock { roomForIdentifierUnderlyingReceivedInvocations = newValue } } } private let roomForIdentifierReturnValueLock = NSLock() - private var roomForIdentifierUnderlyingReturnValue: RoomProxyType? + private nonisolated(unsafe) var roomForIdentifierUnderlyingReturnValue: RoomProxyType? var roomForIdentifierReturnValue: RoomProxyType? { get { roomForIdentifierReturnValueLock.withLock { roomForIdentifierUnderlyingReturnValue } } set { roomForIdentifierReturnValueLock.withLock { roomForIdentifierUnderlyingReturnValue = newValue } } } - var roomForIdentifierClosure: ((String) async -> RoomProxyType?)? + nonisolated(unsafe) var roomForIdentifierClosure: ((String) async -> RoomProxyType?)? - func roomForIdentifier(_ identifier: String) async -> RoomProxyType? { + @concurrent func roomForIdentifier(_ identifier: String) async -> RoomProxyType? { roomForIdentifierCallsCountLock.withLock { roomForIdentifierUnderlyingCallsCount += 1 } roomForIdentifierReceivedIdentifier = identifier roomForIdentifierReceivedInvocationsLock.withLock { roomForIdentifierUnderlyingReceivedInvocations.append(identifier) } @@ -2967,7 +2967,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - roomPreviewForIdentifier private let roomPreviewForIdentifierViaCallsCountLock = NSLock() - private var roomPreviewForIdentifierViaUnderlyingCallsCount = 0 + private nonisolated(unsafe) var roomPreviewForIdentifierViaUnderlyingCallsCount = 0 var roomPreviewForIdentifierViaCallsCount: Int { get { roomPreviewForIdentifierViaCallsCountLock.withLock { roomPreviewForIdentifierViaUnderlyingCallsCount } } set { roomPreviewForIdentifierViaCallsCountLock.withLock { roomPreviewForIdentifierViaUnderlyingCallsCount = newValue } } @@ -2976,27 +2976,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return roomPreviewForIdentifierViaCallsCount > 0 } private let roomPreviewForIdentifierViaReceivedArgumentsLock = NSLock() - private var roomPreviewForIdentifierViaUnderlyingReceivedArguments: (identifier: String, via: [String])? + private nonisolated(unsafe) var roomPreviewForIdentifierViaUnderlyingReceivedArguments: (identifier: String, via: [String])? var roomPreviewForIdentifierViaReceivedArguments: (identifier: String, via: [String])? { get { roomPreviewForIdentifierViaReceivedArgumentsLock.withLock { roomPreviewForIdentifierViaUnderlyingReceivedArguments } } set { roomPreviewForIdentifierViaReceivedArgumentsLock.withLock { roomPreviewForIdentifierViaUnderlyingReceivedArguments = newValue } } } private let roomPreviewForIdentifierViaReceivedInvocationsLock = NSLock() - private var roomPreviewForIdentifierViaUnderlyingReceivedInvocations: [(identifier: String, via: [String])] = [] + private nonisolated(unsafe) var roomPreviewForIdentifierViaUnderlyingReceivedInvocations: [(identifier: String, via: [String])] = [] var roomPreviewForIdentifierViaReceivedInvocations: [(identifier: String, via: [String])] { get { roomPreviewForIdentifierViaReceivedInvocationsLock.withLock { roomPreviewForIdentifierViaUnderlyingReceivedInvocations } } set { roomPreviewForIdentifierViaReceivedInvocationsLock.withLock { roomPreviewForIdentifierViaUnderlyingReceivedInvocations = newValue } } } private let roomPreviewForIdentifierViaReturnValueLock = NSLock() - private var roomPreviewForIdentifierViaUnderlyingReturnValue: Result! + private nonisolated(unsafe) var roomPreviewForIdentifierViaUnderlyingReturnValue: Result! var roomPreviewForIdentifierViaReturnValue: Result! { get { roomPreviewForIdentifierViaReturnValueLock.withLock { roomPreviewForIdentifierViaUnderlyingReturnValue } } set { roomPreviewForIdentifierViaReturnValueLock.withLock { roomPreviewForIdentifierViaUnderlyingReturnValue = newValue } } } - var roomPreviewForIdentifierViaClosure: ((String, [String]) async -> Result)? + nonisolated(unsafe) var roomPreviewForIdentifierViaClosure: ((String, [String]) async -> Result)? - func roomPreviewForIdentifier(_ identifier: String, via: [String]) async -> Result { + @concurrent func roomPreviewForIdentifier(_ identifier: String, via: [String]) async -> Result { roomPreviewForIdentifierViaCallsCountLock.withLock { roomPreviewForIdentifierViaUnderlyingCallsCount += 1 } roomPreviewForIdentifierViaReceivedArguments = (identifier: identifier, via: via) roomPreviewForIdentifierViaReceivedInvocationsLock.withLock { roomPreviewForIdentifierViaUnderlyingReceivedInvocations.append((identifier: identifier, via: via)) } @@ -3009,7 +3009,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - roomSummaryForIdentifier private let roomSummaryForIdentifierCallsCountLock = NSLock() - private var roomSummaryForIdentifierUnderlyingCallsCount = 0 + private nonisolated(unsafe) var roomSummaryForIdentifierUnderlyingCallsCount = 0 var roomSummaryForIdentifierCallsCount: Int { get { roomSummaryForIdentifierCallsCountLock.withLock { roomSummaryForIdentifierUnderlyingCallsCount } } set { roomSummaryForIdentifierCallsCountLock.withLock { roomSummaryForIdentifierUnderlyingCallsCount = newValue } } @@ -3018,25 +3018,25 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return roomSummaryForIdentifierCallsCount > 0 } private let roomSummaryForIdentifierReceivedIdentifierLock = NSLock() - private var roomSummaryForIdentifierUnderlyingReceivedIdentifier: String? + private nonisolated(unsafe) var roomSummaryForIdentifierUnderlyingReceivedIdentifier: String? var roomSummaryForIdentifierReceivedIdentifier: String? { get { roomSummaryForIdentifierReceivedIdentifierLock.withLock { roomSummaryForIdentifierUnderlyingReceivedIdentifier } } set { roomSummaryForIdentifierReceivedIdentifierLock.withLock { roomSummaryForIdentifierUnderlyingReceivedIdentifier = newValue } } } private let roomSummaryForIdentifierReceivedInvocationsLock = NSLock() - private var roomSummaryForIdentifierUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var roomSummaryForIdentifierUnderlyingReceivedInvocations: [String] = [] var roomSummaryForIdentifierReceivedInvocations: [String] { get { roomSummaryForIdentifierReceivedInvocationsLock.withLock { roomSummaryForIdentifierUnderlyingReceivedInvocations } } set { roomSummaryForIdentifierReceivedInvocationsLock.withLock { roomSummaryForIdentifierUnderlyingReceivedInvocations = newValue } } } private let roomSummaryForIdentifierReturnValueLock = NSLock() - private var roomSummaryForIdentifierUnderlyingReturnValue: RoomSummary? + private nonisolated(unsafe) var roomSummaryForIdentifierUnderlyingReturnValue: RoomSummary? var roomSummaryForIdentifierReturnValue: RoomSummary? { get { roomSummaryForIdentifierReturnValueLock.withLock { roomSummaryForIdentifierUnderlyingReturnValue } } set { roomSummaryForIdentifierReturnValueLock.withLock { roomSummaryForIdentifierUnderlyingReturnValue = newValue } } } - var roomSummaryForIdentifierClosure: ((String) -> RoomSummary?)? + nonisolated(unsafe) var roomSummaryForIdentifierClosure: ((String) -> RoomSummary?)? func roomSummaryForIdentifier(_ identifier: String) -> RoomSummary? { roomSummaryForIdentifierCallsCountLock.withLock { roomSummaryForIdentifierUnderlyingCallsCount += 1 } @@ -3051,7 +3051,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - roomSummaryForAlias private let roomSummaryForAliasCallsCountLock = NSLock() - private var roomSummaryForAliasUnderlyingCallsCount = 0 + private nonisolated(unsafe) var roomSummaryForAliasUnderlyingCallsCount = 0 var roomSummaryForAliasCallsCount: Int { get { roomSummaryForAliasCallsCountLock.withLock { roomSummaryForAliasUnderlyingCallsCount } } set { roomSummaryForAliasCallsCountLock.withLock { roomSummaryForAliasUnderlyingCallsCount = newValue } } @@ -3060,25 +3060,25 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return roomSummaryForAliasCallsCount > 0 } private let roomSummaryForAliasReceivedAliasLock = NSLock() - private var roomSummaryForAliasUnderlyingReceivedAlias: String? + private nonisolated(unsafe) var roomSummaryForAliasUnderlyingReceivedAlias: String? var roomSummaryForAliasReceivedAlias: String? { get { roomSummaryForAliasReceivedAliasLock.withLock { roomSummaryForAliasUnderlyingReceivedAlias } } set { roomSummaryForAliasReceivedAliasLock.withLock { roomSummaryForAliasUnderlyingReceivedAlias = newValue } } } private let roomSummaryForAliasReceivedInvocationsLock = NSLock() - private var roomSummaryForAliasUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var roomSummaryForAliasUnderlyingReceivedInvocations: [String] = [] var roomSummaryForAliasReceivedInvocations: [String] { get { roomSummaryForAliasReceivedInvocationsLock.withLock { roomSummaryForAliasUnderlyingReceivedInvocations } } set { roomSummaryForAliasReceivedInvocationsLock.withLock { roomSummaryForAliasUnderlyingReceivedInvocations = newValue } } } private let roomSummaryForAliasReturnValueLock = NSLock() - private var roomSummaryForAliasUnderlyingReturnValue: RoomSummary? + private nonisolated(unsafe) var roomSummaryForAliasUnderlyingReturnValue: RoomSummary? var roomSummaryForAliasReturnValue: RoomSummary? { get { roomSummaryForAliasReturnValueLock.withLock { roomSummaryForAliasUnderlyingReturnValue } } set { roomSummaryForAliasReturnValueLock.withLock { roomSummaryForAliasUnderlyingReturnValue = newValue } } } - var roomSummaryForAliasClosure: ((String) -> RoomSummary?)? + nonisolated(unsafe) var roomSummaryForAliasClosure: ((String) -> RoomSummary?)? func roomSummaryForAlias(_ alias: String) -> RoomSummary? { roomSummaryForAliasCallsCountLock.withLock { roomSummaryForAliasUnderlyingCallsCount += 1 } @@ -3093,7 +3093,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - reportRoomForIdentifier private let reportRoomForIdentifierReasonCallsCountLock = NSLock() - private var reportRoomForIdentifierReasonUnderlyingCallsCount = 0 + private nonisolated(unsafe) var reportRoomForIdentifierReasonUnderlyingCallsCount = 0 var reportRoomForIdentifierReasonCallsCount: Int { get { reportRoomForIdentifierReasonCallsCountLock.withLock { reportRoomForIdentifierReasonUnderlyingCallsCount } } set { reportRoomForIdentifierReasonCallsCountLock.withLock { reportRoomForIdentifierReasonUnderlyingCallsCount = newValue } } @@ -3102,27 +3102,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return reportRoomForIdentifierReasonCallsCount > 0 } private let reportRoomForIdentifierReasonReceivedArgumentsLock = NSLock() - private var reportRoomForIdentifierReasonUnderlyingReceivedArguments: (identifier: String, reason: String)? + private nonisolated(unsafe) var reportRoomForIdentifierReasonUnderlyingReceivedArguments: (identifier: String, reason: String)? var reportRoomForIdentifierReasonReceivedArguments: (identifier: String, reason: String)? { get { reportRoomForIdentifierReasonReceivedArgumentsLock.withLock { reportRoomForIdentifierReasonUnderlyingReceivedArguments } } set { reportRoomForIdentifierReasonReceivedArgumentsLock.withLock { reportRoomForIdentifierReasonUnderlyingReceivedArguments = newValue } } } private let reportRoomForIdentifierReasonReceivedInvocationsLock = NSLock() - private var reportRoomForIdentifierReasonUnderlyingReceivedInvocations: [(identifier: String, reason: String)] = [] + private nonisolated(unsafe) var reportRoomForIdentifierReasonUnderlyingReceivedInvocations: [(identifier: String, reason: String)] = [] var reportRoomForIdentifierReasonReceivedInvocations: [(identifier: String, reason: String)] { get { reportRoomForIdentifierReasonReceivedInvocationsLock.withLock { reportRoomForIdentifierReasonUnderlyingReceivedInvocations } } set { reportRoomForIdentifierReasonReceivedInvocationsLock.withLock { reportRoomForIdentifierReasonUnderlyingReceivedInvocations = newValue } } } private let reportRoomForIdentifierReasonReturnValueLock = NSLock() - private var reportRoomForIdentifierReasonUnderlyingReturnValue: Result! + private nonisolated(unsafe) var reportRoomForIdentifierReasonUnderlyingReturnValue: Result! var reportRoomForIdentifierReasonReturnValue: Result! { get { reportRoomForIdentifierReasonReturnValueLock.withLock { reportRoomForIdentifierReasonUnderlyingReturnValue } } set { reportRoomForIdentifierReasonReturnValueLock.withLock { reportRoomForIdentifierReasonUnderlyingReturnValue = newValue } } } - var reportRoomForIdentifierReasonClosure: ((String, String) async -> Result)? + nonisolated(unsafe) var reportRoomForIdentifierReasonClosure: ((String, String) async -> Result)? - func reportRoomForIdentifier(_ identifier: String, reason: String) async -> Result { + @concurrent func reportRoomForIdentifier(_ identifier: String, reason: String) async -> Result { reportRoomForIdentifierReasonCallsCountLock.withLock { reportRoomForIdentifierReasonUnderlyingCallsCount += 1 } reportRoomForIdentifierReasonReceivedArguments = (identifier: identifier, reason: reason) reportRoomForIdentifierReasonReceivedInvocationsLock.withLock { reportRoomForIdentifierReasonUnderlyingReceivedInvocations.append((identifier: identifier, reason: reason)) } @@ -3135,7 +3135,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - loadUserDisplayName private let loadUserDisplayNameCallsCountLock = NSLock() - private var loadUserDisplayNameUnderlyingCallsCount = 0 + private nonisolated(unsafe) var loadUserDisplayNameUnderlyingCallsCount = 0 var loadUserDisplayNameCallsCount: Int { get { loadUserDisplayNameCallsCountLock.withLock { loadUserDisplayNameUnderlyingCallsCount } } set { loadUserDisplayNameCallsCountLock.withLock { loadUserDisplayNameUnderlyingCallsCount = newValue } } @@ -3145,15 +3145,15 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { } private let loadUserDisplayNameReturnValueLock = NSLock() - private var loadUserDisplayNameUnderlyingReturnValue: Result! + private nonisolated(unsafe) var loadUserDisplayNameUnderlyingReturnValue: Result! var loadUserDisplayNameReturnValue: Result! { get { loadUserDisplayNameReturnValueLock.withLock { loadUserDisplayNameUnderlyingReturnValue } } set { loadUserDisplayNameReturnValueLock.withLock { loadUserDisplayNameUnderlyingReturnValue = newValue } } } - var loadUserDisplayNameClosure: (() async -> Result)? + nonisolated(unsafe) var loadUserDisplayNameClosure: (() async -> Result)? @discardableResult - func loadUserDisplayName() async -> Result { + @concurrent func loadUserDisplayName() async -> Result { loadUserDisplayNameCallsCountLock.withLock { loadUserDisplayNameUnderlyingCallsCount += 1 } if let loadUserDisplayNameClosure = loadUserDisplayNameClosure { return await loadUserDisplayNameClosure() @@ -3164,7 +3164,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - setUserDisplayName private let setUserDisplayNameCallsCountLock = NSLock() - private var setUserDisplayNameUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setUserDisplayNameUnderlyingCallsCount = 0 var setUserDisplayNameCallsCount: Int { get { setUserDisplayNameCallsCountLock.withLock { setUserDisplayNameUnderlyingCallsCount } } set { setUserDisplayNameCallsCountLock.withLock { setUserDisplayNameUnderlyingCallsCount = newValue } } @@ -3173,27 +3173,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return setUserDisplayNameCallsCount > 0 } private let setUserDisplayNameReceivedNameLock = NSLock() - private var setUserDisplayNameUnderlyingReceivedName: String? + private nonisolated(unsafe) var setUserDisplayNameUnderlyingReceivedName: String? var setUserDisplayNameReceivedName: String? { get { setUserDisplayNameReceivedNameLock.withLock { setUserDisplayNameUnderlyingReceivedName } } set { setUserDisplayNameReceivedNameLock.withLock { setUserDisplayNameUnderlyingReceivedName = newValue } } } private let setUserDisplayNameReceivedInvocationsLock = NSLock() - private var setUserDisplayNameUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var setUserDisplayNameUnderlyingReceivedInvocations: [String] = [] var setUserDisplayNameReceivedInvocations: [String] { get { setUserDisplayNameReceivedInvocationsLock.withLock { setUserDisplayNameUnderlyingReceivedInvocations } } set { setUserDisplayNameReceivedInvocationsLock.withLock { setUserDisplayNameUnderlyingReceivedInvocations = newValue } } } private let setUserDisplayNameReturnValueLock = NSLock() - private var setUserDisplayNameUnderlyingReturnValue: Result! + private nonisolated(unsafe) var setUserDisplayNameUnderlyingReturnValue: Result! var setUserDisplayNameReturnValue: Result! { get { setUserDisplayNameReturnValueLock.withLock { setUserDisplayNameUnderlyingReturnValue } } set { setUserDisplayNameReturnValueLock.withLock { setUserDisplayNameUnderlyingReturnValue = newValue } } } - var setUserDisplayNameClosure: ((String) async -> Result)? + nonisolated(unsafe) var setUserDisplayNameClosure: ((String) async -> Result)? - func setUserDisplayName(_ name: String) async -> Result { + @concurrent func setUserDisplayName(_ name: String) async -> Result { setUserDisplayNameCallsCountLock.withLock { setUserDisplayNameUnderlyingCallsCount += 1 } setUserDisplayNameReceivedName = name setUserDisplayNameReceivedInvocationsLock.withLock { setUserDisplayNameUnderlyingReceivedInvocations.append(name) } @@ -3206,7 +3206,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - loadUserAvatarURL private let loadUserAvatarURLCallsCountLock = NSLock() - private var loadUserAvatarURLUnderlyingCallsCount = 0 + private nonisolated(unsafe) var loadUserAvatarURLUnderlyingCallsCount = 0 var loadUserAvatarURLCallsCount: Int { get { loadUserAvatarURLCallsCountLock.withLock { loadUserAvatarURLUnderlyingCallsCount } } set { loadUserAvatarURLCallsCountLock.withLock { loadUserAvatarURLUnderlyingCallsCount = newValue } } @@ -3216,15 +3216,15 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { } private let loadUserAvatarURLReturnValueLock = NSLock() - private var loadUserAvatarURLUnderlyingReturnValue: Result! + private nonisolated(unsafe) var loadUserAvatarURLUnderlyingReturnValue: Result! var loadUserAvatarURLReturnValue: Result! { get { loadUserAvatarURLReturnValueLock.withLock { loadUserAvatarURLUnderlyingReturnValue } } set { loadUserAvatarURLReturnValueLock.withLock { loadUserAvatarURLUnderlyingReturnValue = newValue } } } - var loadUserAvatarURLClosure: (() async -> Result)? + nonisolated(unsafe) var loadUserAvatarURLClosure: (() async -> Result)? @discardableResult - func loadUserAvatarURL() async -> Result { + @concurrent func loadUserAvatarURL() async -> Result { loadUserAvatarURLCallsCountLock.withLock { loadUserAvatarURLUnderlyingCallsCount += 1 } if let loadUserAvatarURLClosure = loadUserAvatarURLClosure { return await loadUserAvatarURLClosure() @@ -3235,7 +3235,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - setUserAvatar private let setUserAvatarMediaCallsCountLock = NSLock() - private var setUserAvatarMediaUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setUserAvatarMediaUnderlyingCallsCount = 0 var setUserAvatarMediaCallsCount: Int { get { setUserAvatarMediaCallsCountLock.withLock { setUserAvatarMediaUnderlyingCallsCount } } set { setUserAvatarMediaCallsCountLock.withLock { setUserAvatarMediaUnderlyingCallsCount = newValue } } @@ -3244,27 +3244,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return setUserAvatarMediaCallsCount > 0 } private let setUserAvatarMediaReceivedMediaLock = NSLock() - private var setUserAvatarMediaUnderlyingReceivedMedia: MediaInfo? + private nonisolated(unsafe) var setUserAvatarMediaUnderlyingReceivedMedia: MediaInfo? var setUserAvatarMediaReceivedMedia: MediaInfo? { get { setUserAvatarMediaReceivedMediaLock.withLock { setUserAvatarMediaUnderlyingReceivedMedia } } set { setUserAvatarMediaReceivedMediaLock.withLock { setUserAvatarMediaUnderlyingReceivedMedia = newValue } } } private let setUserAvatarMediaReceivedInvocationsLock = NSLock() - private var setUserAvatarMediaUnderlyingReceivedInvocations: [MediaInfo] = [] + private nonisolated(unsafe) var setUserAvatarMediaUnderlyingReceivedInvocations: [MediaInfo] = [] var setUserAvatarMediaReceivedInvocations: [MediaInfo] { get { setUserAvatarMediaReceivedInvocationsLock.withLock { setUserAvatarMediaUnderlyingReceivedInvocations } } set { setUserAvatarMediaReceivedInvocationsLock.withLock { setUserAvatarMediaUnderlyingReceivedInvocations = newValue } } } private let setUserAvatarMediaReturnValueLock = NSLock() - private var setUserAvatarMediaUnderlyingReturnValue: Result! + private nonisolated(unsafe) var setUserAvatarMediaUnderlyingReturnValue: Result! var setUserAvatarMediaReturnValue: Result! { get { setUserAvatarMediaReturnValueLock.withLock { setUserAvatarMediaUnderlyingReturnValue } } set { setUserAvatarMediaReturnValueLock.withLock { setUserAvatarMediaUnderlyingReturnValue = newValue } } } - var setUserAvatarMediaClosure: ((MediaInfo) async -> Result)? + nonisolated(unsafe) var setUserAvatarMediaClosure: ((MediaInfo) async -> Result)? - func setUserAvatar(media: MediaInfo) async -> Result { + @concurrent func setUserAvatar(media: MediaInfo) async -> Result { setUserAvatarMediaCallsCountLock.withLock { setUserAvatarMediaUnderlyingCallsCount += 1 } setUserAvatarMediaReceivedMedia = media setUserAvatarMediaReceivedInvocationsLock.withLock { setUserAvatarMediaUnderlyingReceivedInvocations.append(media) } @@ -3277,7 +3277,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - removeUserAvatar private let removeUserAvatarCallsCountLock = NSLock() - private var removeUserAvatarUnderlyingCallsCount = 0 + private nonisolated(unsafe) var removeUserAvatarUnderlyingCallsCount = 0 var removeUserAvatarCallsCount: Int { get { removeUserAvatarCallsCountLock.withLock { removeUserAvatarUnderlyingCallsCount } } set { removeUserAvatarCallsCountLock.withLock { removeUserAvatarUnderlyingCallsCount = newValue } } @@ -3287,14 +3287,14 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { } private let removeUserAvatarReturnValueLock = NSLock() - private var removeUserAvatarUnderlyingReturnValue: Result! + private nonisolated(unsafe) var removeUserAvatarUnderlyingReturnValue: Result! var removeUserAvatarReturnValue: Result! { get { removeUserAvatarReturnValueLock.withLock { removeUserAvatarUnderlyingReturnValue } } set { removeUserAvatarReturnValueLock.withLock { removeUserAvatarUnderlyingReturnValue = newValue } } } - var removeUserAvatarClosure: (() async -> Result)? + nonisolated(unsafe) var removeUserAvatarClosure: (() async -> Result)? - func removeUserAvatar() async -> Result { + @concurrent func removeUserAvatar() async -> Result { removeUserAvatarCallsCountLock.withLock { removeUserAvatarUnderlyingCallsCount += 1 } if let removeUserAvatarClosure = removeUserAvatarClosure { return await removeUserAvatarClosure() @@ -3305,7 +3305,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - linkNewDeviceService private let linkNewDeviceServiceCallsCountLock = NSLock() - private var linkNewDeviceServiceUnderlyingCallsCount = 0 + private nonisolated(unsafe) var linkNewDeviceServiceUnderlyingCallsCount = 0 var linkNewDeviceServiceCallsCount: Int { get { linkNewDeviceServiceCallsCountLock.withLock { linkNewDeviceServiceUnderlyingCallsCount } } set { linkNewDeviceServiceCallsCountLock.withLock { linkNewDeviceServiceUnderlyingCallsCount = newValue } } @@ -3315,12 +3315,12 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { } private let linkNewDeviceServiceReturnValueLock = NSLock() - private var linkNewDeviceServiceUnderlyingReturnValue: LinkNewDeviceServiceProtocol! + private nonisolated(unsafe) var linkNewDeviceServiceUnderlyingReturnValue: LinkNewDeviceServiceProtocol! var linkNewDeviceServiceReturnValue: LinkNewDeviceServiceProtocol! { get { linkNewDeviceServiceReturnValueLock.withLock { linkNewDeviceServiceUnderlyingReturnValue } } set { linkNewDeviceServiceReturnValueLock.withLock { linkNewDeviceServiceUnderlyingReturnValue = newValue } } } - var linkNewDeviceServiceClosure: (() -> LinkNewDeviceServiceProtocol)? + nonisolated(unsafe) var linkNewDeviceServiceClosure: (() -> LinkNewDeviceServiceProtocol)? func linkNewDeviceService() -> LinkNewDeviceServiceProtocol { linkNewDeviceServiceCallsCountLock.withLock { linkNewDeviceServiceUnderlyingCallsCount += 1 } @@ -3333,7 +3333,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - deactivateAccount private let deactivateAccountPasswordEraseDataCallsCountLock = NSLock() - private var deactivateAccountPasswordEraseDataUnderlyingCallsCount = 0 + private nonisolated(unsafe) var deactivateAccountPasswordEraseDataUnderlyingCallsCount = 0 var deactivateAccountPasswordEraseDataCallsCount: Int { get { deactivateAccountPasswordEraseDataCallsCountLock.withLock { deactivateAccountPasswordEraseDataUnderlyingCallsCount } } set { deactivateAccountPasswordEraseDataCallsCountLock.withLock { deactivateAccountPasswordEraseDataUnderlyingCallsCount = newValue } } @@ -3342,27 +3342,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return deactivateAccountPasswordEraseDataCallsCount > 0 } private let deactivateAccountPasswordEraseDataReceivedArgumentsLock = NSLock() - private var deactivateAccountPasswordEraseDataUnderlyingReceivedArguments: (password: String?, eraseData: Bool)? + private nonisolated(unsafe) var deactivateAccountPasswordEraseDataUnderlyingReceivedArguments: (password: String?, eraseData: Bool)? var deactivateAccountPasswordEraseDataReceivedArguments: (password: String?, eraseData: Bool)? { get { deactivateAccountPasswordEraseDataReceivedArgumentsLock.withLock { deactivateAccountPasswordEraseDataUnderlyingReceivedArguments } } set { deactivateAccountPasswordEraseDataReceivedArgumentsLock.withLock { deactivateAccountPasswordEraseDataUnderlyingReceivedArguments = newValue } } } private let deactivateAccountPasswordEraseDataReceivedInvocationsLock = NSLock() - private var deactivateAccountPasswordEraseDataUnderlyingReceivedInvocations: [(password: String?, eraseData: Bool)] = [] + private nonisolated(unsafe) var deactivateAccountPasswordEraseDataUnderlyingReceivedInvocations: [(password: String?, eraseData: Bool)] = [] var deactivateAccountPasswordEraseDataReceivedInvocations: [(password: String?, eraseData: Bool)] { get { deactivateAccountPasswordEraseDataReceivedInvocationsLock.withLock { deactivateAccountPasswordEraseDataUnderlyingReceivedInvocations } } set { deactivateAccountPasswordEraseDataReceivedInvocationsLock.withLock { deactivateAccountPasswordEraseDataUnderlyingReceivedInvocations = newValue } } } private let deactivateAccountPasswordEraseDataReturnValueLock = NSLock() - private var deactivateAccountPasswordEraseDataUnderlyingReturnValue: Result! + private nonisolated(unsafe) var deactivateAccountPasswordEraseDataUnderlyingReturnValue: Result! var deactivateAccountPasswordEraseDataReturnValue: Result! { get { deactivateAccountPasswordEraseDataReturnValueLock.withLock { deactivateAccountPasswordEraseDataUnderlyingReturnValue } } set { deactivateAccountPasswordEraseDataReturnValueLock.withLock { deactivateAccountPasswordEraseDataUnderlyingReturnValue = newValue } } } - var deactivateAccountPasswordEraseDataClosure: ((String?, Bool) async -> Result)? + nonisolated(unsafe) var deactivateAccountPasswordEraseDataClosure: ((String?, Bool) async -> Result)? - func deactivateAccount(password: String?, eraseData: Bool) async -> Result { + @concurrent func deactivateAccount(password: String?, eraseData: Bool) async -> Result { deactivateAccountPasswordEraseDataCallsCountLock.withLock { deactivateAccountPasswordEraseDataUnderlyingCallsCount += 1 } deactivateAccountPasswordEraseDataReceivedArguments = (password: password, eraseData: eraseData) deactivateAccountPasswordEraseDataReceivedInvocationsLock.withLock { deactivateAccountPasswordEraseDataUnderlyingReceivedInvocations.append((password: password, eraseData: eraseData)) } @@ -3375,7 +3375,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - logout private let logoutCallsCountLock = NSLock() - private var logoutUnderlyingCallsCount = 0 + private nonisolated(unsafe) var logoutUnderlyingCallsCount = 0 var logoutCallsCount: Int { get { logoutCallsCountLock.withLock { logoutUnderlyingCallsCount } } set { logoutCallsCountLock.withLock { logoutUnderlyingCallsCount = newValue } } @@ -3383,17 +3383,17 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { var logoutCalled: Bool { return logoutCallsCount > 0 } - var logoutClosure: (() async -> Void)? + nonisolated(unsafe) var logoutClosure: (() async -> Void)? - func logout() async { + @concurrent func logout() async { logoutCallsCountLock.withLock { logoutUnderlyingCallsCount += 1 } await logoutClosure?() } //MARK: - setPusher - var setPusherWithThrowableError: Error? + nonisolated(unsafe) var setPusherWithThrowableError: Error? private let setPusherWithCallsCountLock = NSLock() - private var setPusherWithUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setPusherWithUnderlyingCallsCount = 0 var setPusherWithCallsCount: Int { get { setPusherWithCallsCountLock.withLock { setPusherWithUnderlyingCallsCount } } set { setPusherWithCallsCountLock.withLock { setPusherWithUnderlyingCallsCount = newValue } } @@ -3402,20 +3402,20 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return setPusherWithCallsCount > 0 } private let setPusherWithReceivedConfigurationLock = NSLock() - private var setPusherWithUnderlyingReceivedConfiguration: PusherConfiguration? + private nonisolated(unsafe) var setPusherWithUnderlyingReceivedConfiguration: PusherConfiguration? var setPusherWithReceivedConfiguration: PusherConfiguration? { get { setPusherWithReceivedConfigurationLock.withLock { setPusherWithUnderlyingReceivedConfiguration } } set { setPusherWithReceivedConfigurationLock.withLock { setPusherWithUnderlyingReceivedConfiguration = newValue } } } private let setPusherWithReceivedInvocationsLock = NSLock() - private var setPusherWithUnderlyingReceivedInvocations: [PusherConfiguration] = [] + private nonisolated(unsafe) var setPusherWithUnderlyingReceivedInvocations: [PusherConfiguration] = [] var setPusherWithReceivedInvocations: [PusherConfiguration] { get { setPusherWithReceivedInvocationsLock.withLock { setPusherWithUnderlyingReceivedInvocations } } set { setPusherWithReceivedInvocationsLock.withLock { setPusherWithUnderlyingReceivedInvocations = newValue } } } - var setPusherWithClosure: ((PusherConfiguration) async throws -> Void)? + nonisolated(unsafe) var setPusherWithClosure: ((PusherConfiguration) async throws -> Void)? - func setPusher(with configuration: PusherConfiguration) async throws { + @concurrent func setPusher(with configuration: PusherConfiguration) async throws { if let error = setPusherWithThrowableError { throw error } @@ -3427,7 +3427,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - searchUsers private let searchUsersSearchTermLimitCallsCountLock = NSLock() - private var searchUsersSearchTermLimitUnderlyingCallsCount = 0 + private nonisolated(unsafe) var searchUsersSearchTermLimitUnderlyingCallsCount = 0 var searchUsersSearchTermLimitCallsCount: Int { get { searchUsersSearchTermLimitCallsCountLock.withLock { searchUsersSearchTermLimitUnderlyingCallsCount } } set { searchUsersSearchTermLimitCallsCountLock.withLock { searchUsersSearchTermLimitUnderlyingCallsCount = newValue } } @@ -3436,27 +3436,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return searchUsersSearchTermLimitCallsCount > 0 } private let searchUsersSearchTermLimitReceivedArgumentsLock = NSLock() - private var searchUsersSearchTermLimitUnderlyingReceivedArguments: (searchTerm: String, limit: UInt)? + private nonisolated(unsafe) var searchUsersSearchTermLimitUnderlyingReceivedArguments: (searchTerm: String, limit: UInt)? var searchUsersSearchTermLimitReceivedArguments: (searchTerm: String, limit: UInt)? { get { searchUsersSearchTermLimitReceivedArgumentsLock.withLock { searchUsersSearchTermLimitUnderlyingReceivedArguments } } set { searchUsersSearchTermLimitReceivedArgumentsLock.withLock { searchUsersSearchTermLimitUnderlyingReceivedArguments = newValue } } } private let searchUsersSearchTermLimitReceivedInvocationsLock = NSLock() - private var searchUsersSearchTermLimitUnderlyingReceivedInvocations: [(searchTerm: String, limit: UInt)] = [] + private nonisolated(unsafe) var searchUsersSearchTermLimitUnderlyingReceivedInvocations: [(searchTerm: String, limit: UInt)] = [] var searchUsersSearchTermLimitReceivedInvocations: [(searchTerm: String, limit: UInt)] { get { searchUsersSearchTermLimitReceivedInvocationsLock.withLock { searchUsersSearchTermLimitUnderlyingReceivedInvocations } } set { searchUsersSearchTermLimitReceivedInvocationsLock.withLock { searchUsersSearchTermLimitUnderlyingReceivedInvocations = newValue } } } private let searchUsersSearchTermLimitReturnValueLock = NSLock() - private var searchUsersSearchTermLimitUnderlyingReturnValue: Result! + private nonisolated(unsafe) var searchUsersSearchTermLimitUnderlyingReturnValue: Result! var searchUsersSearchTermLimitReturnValue: Result! { get { searchUsersSearchTermLimitReturnValueLock.withLock { searchUsersSearchTermLimitUnderlyingReturnValue } } set { searchUsersSearchTermLimitReturnValueLock.withLock { searchUsersSearchTermLimitUnderlyingReturnValue = newValue } } } - var searchUsersSearchTermLimitClosure: ((String, UInt) async -> Result)? + nonisolated(unsafe) var searchUsersSearchTermLimitClosure: ((String, UInt) async -> Result)? - func searchUsers(searchTerm: String, limit: UInt) async -> Result { + @concurrent func searchUsers(searchTerm: String, limit: UInt) async -> Result { searchUsersSearchTermLimitCallsCountLock.withLock { searchUsersSearchTermLimitUnderlyingCallsCount += 1 } searchUsersSearchTermLimitReceivedArguments = (searchTerm: searchTerm, limit: limit) searchUsersSearchTermLimitReceivedInvocationsLock.withLock { searchUsersSearchTermLimitUnderlyingReceivedInvocations.append((searchTerm: searchTerm, limit: limit)) } @@ -3469,7 +3469,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - profile private let profileForCallsCountLock = NSLock() - private var profileForUnderlyingCallsCount = 0 + private nonisolated(unsafe) var profileForUnderlyingCallsCount = 0 var profileForCallsCount: Int { get { profileForCallsCountLock.withLock { profileForUnderlyingCallsCount } } set { profileForCallsCountLock.withLock { profileForUnderlyingCallsCount = newValue } } @@ -3478,27 +3478,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return profileForCallsCount > 0 } private let profileForReceivedUserIDLock = NSLock() - private var profileForUnderlyingReceivedUserID: String? + private nonisolated(unsafe) var profileForUnderlyingReceivedUserID: String? var profileForReceivedUserID: String? { get { profileForReceivedUserIDLock.withLock { profileForUnderlyingReceivedUserID } } set { profileForReceivedUserIDLock.withLock { profileForUnderlyingReceivedUserID = newValue } } } private let profileForReceivedInvocationsLock = NSLock() - private var profileForUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var profileForUnderlyingReceivedInvocations: [String] = [] var profileForReceivedInvocations: [String] { get { profileForReceivedInvocationsLock.withLock { profileForUnderlyingReceivedInvocations } } set { profileForReceivedInvocationsLock.withLock { profileForUnderlyingReceivedInvocations = newValue } } } private let profileForReturnValueLock = NSLock() - private var profileForUnderlyingReturnValue: Result! + private nonisolated(unsafe) var profileForUnderlyingReturnValue: Result! var profileForReturnValue: Result! { get { profileForReturnValueLock.withLock { profileForUnderlyingReturnValue } } set { profileForReturnValueLock.withLock { profileForUnderlyingReturnValue = newValue } } } - var profileForClosure: ((String) async -> Result)? + nonisolated(unsafe) var profileForClosure: ((String) async -> Result)? - func profile(for userID: String) async -> Result { + @concurrent func profile(for userID: String) async -> Result { profileForCallsCountLock.withLock { profileForUnderlyingCallsCount += 1 } profileForReceivedUserID = userID profileForReceivedInvocationsLock.withLock { profileForUnderlyingReceivedInvocations.append(userID) } @@ -3511,7 +3511,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - roomDirectorySearchProxy private let roomDirectorySearchProxyCallsCountLock = NSLock() - private var roomDirectorySearchProxyUnderlyingCallsCount = 0 + private nonisolated(unsafe) var roomDirectorySearchProxyUnderlyingCallsCount = 0 var roomDirectorySearchProxyCallsCount: Int { get { roomDirectorySearchProxyCallsCountLock.withLock { roomDirectorySearchProxyUnderlyingCallsCount } } set { roomDirectorySearchProxyCallsCountLock.withLock { roomDirectorySearchProxyUnderlyingCallsCount = newValue } } @@ -3521,12 +3521,12 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { } private let roomDirectorySearchProxyReturnValueLock = NSLock() - private var roomDirectorySearchProxyUnderlyingReturnValue: RoomDirectorySearchProxyProtocol! + private nonisolated(unsafe) var roomDirectorySearchProxyUnderlyingReturnValue: RoomDirectorySearchProxyProtocol! var roomDirectorySearchProxyReturnValue: RoomDirectorySearchProxyProtocol! { get { roomDirectorySearchProxyReturnValueLock.withLock { roomDirectorySearchProxyUnderlyingReturnValue } } set { roomDirectorySearchProxyReturnValueLock.withLock { roomDirectorySearchProxyUnderlyingReturnValue = newValue } } } - var roomDirectorySearchProxyClosure: (() -> RoomDirectorySearchProxyProtocol)? + nonisolated(unsafe) var roomDirectorySearchProxyClosure: (() -> RoomDirectorySearchProxyProtocol)? func roomDirectorySearchProxy() -> RoomDirectorySearchProxyProtocol { roomDirectorySearchProxyCallsCountLock.withLock { roomDirectorySearchProxyUnderlyingCallsCount += 1 } @@ -3539,7 +3539,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - resolveRoomAlias private let resolveRoomAliasCallsCountLock = NSLock() - private var resolveRoomAliasUnderlyingCallsCount = 0 + private nonisolated(unsafe) var resolveRoomAliasUnderlyingCallsCount = 0 var resolveRoomAliasCallsCount: Int { get { resolveRoomAliasCallsCountLock.withLock { resolveRoomAliasUnderlyingCallsCount } } set { resolveRoomAliasCallsCountLock.withLock { resolveRoomAliasUnderlyingCallsCount = newValue } } @@ -3548,27 +3548,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return resolveRoomAliasCallsCount > 0 } private let resolveRoomAliasReceivedAliasLock = NSLock() - private var resolveRoomAliasUnderlyingReceivedAlias: String? + private nonisolated(unsafe) var resolveRoomAliasUnderlyingReceivedAlias: String? var resolveRoomAliasReceivedAlias: String? { get { resolveRoomAliasReceivedAliasLock.withLock { resolveRoomAliasUnderlyingReceivedAlias } } set { resolveRoomAliasReceivedAliasLock.withLock { resolveRoomAliasUnderlyingReceivedAlias = newValue } } } private let resolveRoomAliasReceivedInvocationsLock = NSLock() - private var resolveRoomAliasUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var resolveRoomAliasUnderlyingReceivedInvocations: [String] = [] var resolveRoomAliasReceivedInvocations: [String] { get { resolveRoomAliasReceivedInvocationsLock.withLock { resolveRoomAliasUnderlyingReceivedInvocations } } set { resolveRoomAliasReceivedInvocationsLock.withLock { resolveRoomAliasUnderlyingReceivedInvocations = newValue } } } private let resolveRoomAliasReturnValueLock = NSLock() - private var resolveRoomAliasUnderlyingReturnValue: Result! + private nonisolated(unsafe) var resolveRoomAliasUnderlyingReturnValue: Result! var resolveRoomAliasReturnValue: Result! { get { resolveRoomAliasReturnValueLock.withLock { resolveRoomAliasUnderlyingReturnValue } } set { resolveRoomAliasReturnValueLock.withLock { resolveRoomAliasUnderlyingReturnValue = newValue } } } - var resolveRoomAliasClosure: ((String) async -> Result)? + nonisolated(unsafe) var resolveRoomAliasClosure: ((String) async -> Result)? - func resolveRoomAlias(_ alias: String) async -> Result { + @concurrent func resolveRoomAlias(_ alias: String) async -> Result { resolveRoomAliasCallsCountLock.withLock { resolveRoomAliasUnderlyingCallsCount += 1 } resolveRoomAliasReceivedAlias = alias resolveRoomAliasReceivedInvocationsLock.withLock { resolveRoomAliasUnderlyingReceivedInvocations.append(alias) } @@ -3581,7 +3581,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - isAliasAvailable private let isAliasAvailableCallsCountLock = NSLock() - private var isAliasAvailableUnderlyingCallsCount = 0 + private nonisolated(unsafe) var isAliasAvailableUnderlyingCallsCount = 0 var isAliasAvailableCallsCount: Int { get { isAliasAvailableCallsCountLock.withLock { isAliasAvailableUnderlyingCallsCount } } set { isAliasAvailableCallsCountLock.withLock { isAliasAvailableUnderlyingCallsCount = newValue } } @@ -3590,27 +3590,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return isAliasAvailableCallsCount > 0 } private let isAliasAvailableReceivedAliasLock = NSLock() - private var isAliasAvailableUnderlyingReceivedAlias: String? + private nonisolated(unsafe) var isAliasAvailableUnderlyingReceivedAlias: String? var isAliasAvailableReceivedAlias: String? { get { isAliasAvailableReceivedAliasLock.withLock { isAliasAvailableUnderlyingReceivedAlias } } set { isAliasAvailableReceivedAliasLock.withLock { isAliasAvailableUnderlyingReceivedAlias = newValue } } } private let isAliasAvailableReceivedInvocationsLock = NSLock() - private var isAliasAvailableUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var isAliasAvailableUnderlyingReceivedInvocations: [String] = [] var isAliasAvailableReceivedInvocations: [String] { get { isAliasAvailableReceivedInvocationsLock.withLock { isAliasAvailableUnderlyingReceivedInvocations } } set { isAliasAvailableReceivedInvocationsLock.withLock { isAliasAvailableUnderlyingReceivedInvocations = newValue } } } private let isAliasAvailableReturnValueLock = NSLock() - private var isAliasAvailableUnderlyingReturnValue: Result! + private nonisolated(unsafe) var isAliasAvailableUnderlyingReturnValue: Result! var isAliasAvailableReturnValue: Result! { get { isAliasAvailableReturnValueLock.withLock { isAliasAvailableUnderlyingReturnValue } } set { isAliasAvailableReturnValueLock.withLock { isAliasAvailableUnderlyingReturnValue = newValue } } } - var isAliasAvailableClosure: ((String) async -> Result)? + nonisolated(unsafe) var isAliasAvailableClosure: ((String) async -> Result)? - func isAliasAvailable(_ alias: String) async -> Result { + @concurrent func isAliasAvailable(_ alias: String) async -> Result { isAliasAvailableCallsCountLock.withLock { isAliasAvailableUnderlyingCallsCount += 1 } isAliasAvailableReceivedAlias = alias isAliasAvailableReceivedInvocationsLock.withLock { isAliasAvailableUnderlyingReceivedInvocations.append(alias) } @@ -3623,7 +3623,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - clearCaches private let clearCachesCallsCountLock = NSLock() - private var clearCachesUnderlyingCallsCount = 0 + private nonisolated(unsafe) var clearCachesUnderlyingCallsCount = 0 var clearCachesCallsCount: Int { get { clearCachesCallsCountLock.withLock { clearCachesUnderlyingCallsCount } } set { clearCachesCallsCountLock.withLock { clearCachesUnderlyingCallsCount = newValue } } @@ -3633,15 +3633,15 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { } private let clearCachesReturnValueLock = NSLock() - private var clearCachesUnderlyingReturnValue: Result! + private nonisolated(unsafe) var clearCachesUnderlyingReturnValue: Result! var clearCachesReturnValue: Result! { get { clearCachesReturnValueLock.withLock { clearCachesUnderlyingReturnValue } } set { clearCachesReturnValueLock.withLock { clearCachesUnderlyingReturnValue = newValue } } } - var clearCachesClosure: (() async -> Result)? + nonisolated(unsafe) var clearCachesClosure: (() async -> Result)? @discardableResult - func clearCaches() async -> Result { + @concurrent func clearCaches() async -> Result { clearCachesCallsCountLock.withLock { clearCachesUnderlyingCallsCount += 1 } if let clearCachesClosure = clearCachesClosure { return await clearCachesClosure() @@ -3652,7 +3652,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - optimizeStores private let optimizeStoresCallsCountLock = NSLock() - private var optimizeStoresUnderlyingCallsCount = 0 + private nonisolated(unsafe) var optimizeStoresUnderlyingCallsCount = 0 var optimizeStoresCallsCount: Int { get { optimizeStoresCallsCountLock.withLock { optimizeStoresUnderlyingCallsCount } } set { optimizeStoresCallsCountLock.withLock { optimizeStoresUnderlyingCallsCount = newValue } } @@ -3662,15 +3662,15 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { } private let optimizeStoresReturnValueLock = NSLock() - private var optimizeStoresUnderlyingReturnValue: Result! + private nonisolated(unsafe) var optimizeStoresUnderlyingReturnValue: Result! var optimizeStoresReturnValue: Result! { get { optimizeStoresReturnValueLock.withLock { optimizeStoresUnderlyingReturnValue } } set { optimizeStoresReturnValueLock.withLock { optimizeStoresUnderlyingReturnValue = newValue } } } - var optimizeStoresClosure: (() async -> Result)? + nonisolated(unsafe) var optimizeStoresClosure: (() async -> Result)? @discardableResult - func optimizeStores() async -> Result { + @concurrent func optimizeStores() async -> Result { optimizeStoresCallsCountLock.withLock { optimizeStoresUnderlyingCallsCount += 1 } if let optimizeStoresClosure = optimizeStoresClosure { return await optimizeStoresClosure() @@ -3681,7 +3681,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - markAllRoomsAsRead private let markAllRoomsAsReadCallsCountLock = NSLock() - private var markAllRoomsAsReadUnderlyingCallsCount = 0 + private nonisolated(unsafe) var markAllRoomsAsReadUnderlyingCallsCount = 0 var markAllRoomsAsReadCallsCount: Int { get { markAllRoomsAsReadCallsCountLock.withLock { markAllRoomsAsReadUnderlyingCallsCount } } set { markAllRoomsAsReadCallsCountLock.withLock { markAllRoomsAsReadUnderlyingCallsCount = newValue } } @@ -3691,15 +3691,15 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { } private let markAllRoomsAsReadReturnValueLock = NSLock() - private var markAllRoomsAsReadUnderlyingReturnValue: Result! + private nonisolated(unsafe) var markAllRoomsAsReadUnderlyingReturnValue: Result! var markAllRoomsAsReadReturnValue: Result! { get { markAllRoomsAsReadReturnValueLock.withLock { markAllRoomsAsReadUnderlyingReturnValue } } set { markAllRoomsAsReadReturnValueLock.withLock { markAllRoomsAsReadUnderlyingReturnValue = newValue } } } - var markAllRoomsAsReadClosure: (() async -> Result)? + nonisolated(unsafe) var markAllRoomsAsReadClosure: (() async -> Result)? @discardableResult - func markAllRoomsAsRead() async -> Result { + @concurrent func markAllRoomsAsRead() async -> Result { markAllRoomsAsReadCallsCountLock.withLock { markAllRoomsAsReadUnderlyingCallsCount += 1 } if let markAllRoomsAsReadClosure = markAllRoomsAsReadClosure { return await markAllRoomsAsReadClosure() @@ -3710,7 +3710,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - storeSizes private let storeSizesCallsCountLock = NSLock() - private var storeSizesUnderlyingCallsCount = 0 + private nonisolated(unsafe) var storeSizesUnderlyingCallsCount = 0 var storeSizesCallsCount: Int { get { storeSizesCallsCountLock.withLock { storeSizesUnderlyingCallsCount } } set { storeSizesCallsCountLock.withLock { storeSizesUnderlyingCallsCount = newValue } } @@ -3720,14 +3720,14 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { } private let storeSizesReturnValueLock = NSLock() - private var storeSizesUnderlyingReturnValue: Result! + private nonisolated(unsafe) var storeSizesUnderlyingReturnValue: Result! var storeSizesReturnValue: Result! { get { storeSizesReturnValueLock.withLock { storeSizesUnderlyingReturnValue } } set { storeSizesReturnValueLock.withLock { storeSizesUnderlyingReturnValue = newValue } } } - var storeSizesClosure: (() async -> Result)? + nonisolated(unsafe) var storeSizesClosure: (() async -> Result)? - func storeSizes() async -> Result { + @concurrent func storeSizes() async -> Result { storeSizesCallsCountLock.withLock { storeSizesUnderlyingCallsCount += 1 } if let storeSizesClosure = storeSizesClosure { return await storeSizesClosure() @@ -3738,7 +3738,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - fetchMediaPreviewConfiguration private let fetchMediaPreviewConfigurationCallsCountLock = NSLock() - private var fetchMediaPreviewConfigurationUnderlyingCallsCount = 0 + private nonisolated(unsafe) var fetchMediaPreviewConfigurationUnderlyingCallsCount = 0 var fetchMediaPreviewConfigurationCallsCount: Int { get { fetchMediaPreviewConfigurationCallsCountLock.withLock { fetchMediaPreviewConfigurationUnderlyingCallsCount } } set { fetchMediaPreviewConfigurationCallsCountLock.withLock { fetchMediaPreviewConfigurationUnderlyingCallsCount = newValue } } @@ -3748,14 +3748,14 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { } private let fetchMediaPreviewConfigurationReturnValueLock = NSLock() - private var fetchMediaPreviewConfigurationUnderlyingReturnValue: Result! + private nonisolated(unsafe) var fetchMediaPreviewConfigurationUnderlyingReturnValue: Result! var fetchMediaPreviewConfigurationReturnValue: Result! { get { fetchMediaPreviewConfigurationReturnValueLock.withLock { fetchMediaPreviewConfigurationUnderlyingReturnValue } } set { fetchMediaPreviewConfigurationReturnValueLock.withLock { fetchMediaPreviewConfigurationUnderlyingReturnValue = newValue } } } - var fetchMediaPreviewConfigurationClosure: (() async -> Result)? + nonisolated(unsafe) var fetchMediaPreviewConfigurationClosure: (() async -> Result)? - func fetchMediaPreviewConfiguration() async -> Result { + @concurrent func fetchMediaPreviewConfiguration() async -> Result { fetchMediaPreviewConfigurationCallsCountLock.withLock { fetchMediaPreviewConfigurationUnderlyingCallsCount += 1 } if let fetchMediaPreviewConfigurationClosure = fetchMediaPreviewConfigurationClosure { return await fetchMediaPreviewConfigurationClosure() @@ -3766,7 +3766,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - ignoreUser private let ignoreUserCallsCountLock = NSLock() - private var ignoreUserUnderlyingCallsCount = 0 + private nonisolated(unsafe) var ignoreUserUnderlyingCallsCount = 0 var ignoreUserCallsCount: Int { get { ignoreUserCallsCountLock.withLock { ignoreUserUnderlyingCallsCount } } set { ignoreUserCallsCountLock.withLock { ignoreUserUnderlyingCallsCount = newValue } } @@ -3775,27 +3775,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return ignoreUserCallsCount > 0 } private let ignoreUserReceivedUserIDLock = NSLock() - private var ignoreUserUnderlyingReceivedUserID: String? + private nonisolated(unsafe) var ignoreUserUnderlyingReceivedUserID: String? var ignoreUserReceivedUserID: String? { get { ignoreUserReceivedUserIDLock.withLock { ignoreUserUnderlyingReceivedUserID } } set { ignoreUserReceivedUserIDLock.withLock { ignoreUserUnderlyingReceivedUserID = newValue } } } private let ignoreUserReceivedInvocationsLock = NSLock() - private var ignoreUserUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var ignoreUserUnderlyingReceivedInvocations: [String] = [] var ignoreUserReceivedInvocations: [String] { get { ignoreUserReceivedInvocationsLock.withLock { ignoreUserUnderlyingReceivedInvocations } } set { ignoreUserReceivedInvocationsLock.withLock { ignoreUserUnderlyingReceivedInvocations = newValue } } } private let ignoreUserReturnValueLock = NSLock() - private var ignoreUserUnderlyingReturnValue: Result! + private nonisolated(unsafe) var ignoreUserUnderlyingReturnValue: Result! var ignoreUserReturnValue: Result! { get { ignoreUserReturnValueLock.withLock { ignoreUserUnderlyingReturnValue } } set { ignoreUserReturnValueLock.withLock { ignoreUserUnderlyingReturnValue = newValue } } } - var ignoreUserClosure: ((String) async -> Result)? + nonisolated(unsafe) var ignoreUserClosure: ((String) async -> Result)? - func ignoreUser(_ userID: String) async -> Result { + @concurrent func ignoreUser(_ userID: String) async -> Result { ignoreUserCallsCountLock.withLock { ignoreUserUnderlyingCallsCount += 1 } ignoreUserReceivedUserID = userID ignoreUserReceivedInvocationsLock.withLock { ignoreUserUnderlyingReceivedInvocations.append(userID) } @@ -3808,7 +3808,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - unignoreUser private let unignoreUserCallsCountLock = NSLock() - private var unignoreUserUnderlyingCallsCount = 0 + private nonisolated(unsafe) var unignoreUserUnderlyingCallsCount = 0 var unignoreUserCallsCount: Int { get { unignoreUserCallsCountLock.withLock { unignoreUserUnderlyingCallsCount } } set { unignoreUserCallsCountLock.withLock { unignoreUserUnderlyingCallsCount = newValue } } @@ -3817,27 +3817,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return unignoreUserCallsCount > 0 } private let unignoreUserReceivedUserIDLock = NSLock() - private var unignoreUserUnderlyingReceivedUserID: String? + private nonisolated(unsafe) var unignoreUserUnderlyingReceivedUserID: String? var unignoreUserReceivedUserID: String? { get { unignoreUserReceivedUserIDLock.withLock { unignoreUserUnderlyingReceivedUserID } } set { unignoreUserReceivedUserIDLock.withLock { unignoreUserUnderlyingReceivedUserID = newValue } } } private let unignoreUserReceivedInvocationsLock = NSLock() - private var unignoreUserUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var unignoreUserUnderlyingReceivedInvocations: [String] = [] var unignoreUserReceivedInvocations: [String] { get { unignoreUserReceivedInvocationsLock.withLock { unignoreUserUnderlyingReceivedInvocations } } set { unignoreUserReceivedInvocationsLock.withLock { unignoreUserUnderlyingReceivedInvocations = newValue } } } private let unignoreUserReturnValueLock = NSLock() - private var unignoreUserUnderlyingReturnValue: Result! + private nonisolated(unsafe) var unignoreUserUnderlyingReturnValue: Result! var unignoreUserReturnValue: Result! { get { unignoreUserReturnValueLock.withLock { unignoreUserUnderlyingReturnValue } } set { unignoreUserReturnValueLock.withLock { unignoreUserUnderlyingReturnValue = newValue } } } - var unignoreUserClosure: ((String) async -> Result)? + nonisolated(unsafe) var unignoreUserClosure: ((String) async -> Result)? - func unignoreUser(_ userID: String) async -> Result { + @concurrent func unignoreUser(_ userID: String) async -> Result { unignoreUserCallsCountLock.withLock { unignoreUserUnderlyingCallsCount += 1 } unignoreUserReceivedUserID = userID unignoreUserReceivedInvocationsLock.withLock { unignoreUserUnderlyingReceivedInvocations.append(userID) } @@ -3850,7 +3850,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - trackRecentlyVisitedRoom private let trackRecentlyVisitedRoomCallsCountLock = NSLock() - private var trackRecentlyVisitedRoomUnderlyingCallsCount = 0 + private nonisolated(unsafe) var trackRecentlyVisitedRoomUnderlyingCallsCount = 0 var trackRecentlyVisitedRoomCallsCount: Int { get { trackRecentlyVisitedRoomCallsCountLock.withLock { trackRecentlyVisitedRoomUnderlyingCallsCount } } set { trackRecentlyVisitedRoomCallsCountLock.withLock { trackRecentlyVisitedRoomUnderlyingCallsCount = newValue } } @@ -3859,27 +3859,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return trackRecentlyVisitedRoomCallsCount > 0 } private let trackRecentlyVisitedRoomReceivedRoomIDLock = NSLock() - private var trackRecentlyVisitedRoomUnderlyingReceivedRoomID: String? + private nonisolated(unsafe) var trackRecentlyVisitedRoomUnderlyingReceivedRoomID: String? var trackRecentlyVisitedRoomReceivedRoomID: String? { get { trackRecentlyVisitedRoomReceivedRoomIDLock.withLock { trackRecentlyVisitedRoomUnderlyingReceivedRoomID } } set { trackRecentlyVisitedRoomReceivedRoomIDLock.withLock { trackRecentlyVisitedRoomUnderlyingReceivedRoomID = newValue } } } private let trackRecentlyVisitedRoomReceivedInvocationsLock = NSLock() - private var trackRecentlyVisitedRoomUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var trackRecentlyVisitedRoomUnderlyingReceivedInvocations: [String] = [] var trackRecentlyVisitedRoomReceivedInvocations: [String] { get { trackRecentlyVisitedRoomReceivedInvocationsLock.withLock { trackRecentlyVisitedRoomUnderlyingReceivedInvocations } } set { trackRecentlyVisitedRoomReceivedInvocationsLock.withLock { trackRecentlyVisitedRoomUnderlyingReceivedInvocations = newValue } } } private let trackRecentlyVisitedRoomReturnValueLock = NSLock() - private var trackRecentlyVisitedRoomUnderlyingReturnValue: Result! + private nonisolated(unsafe) var trackRecentlyVisitedRoomUnderlyingReturnValue: Result! var trackRecentlyVisitedRoomReturnValue: Result! { get { trackRecentlyVisitedRoomReturnValueLock.withLock { trackRecentlyVisitedRoomUnderlyingReturnValue } } set { trackRecentlyVisitedRoomReturnValueLock.withLock { trackRecentlyVisitedRoomUnderlyingReturnValue = newValue } } } - var trackRecentlyVisitedRoomClosure: ((String) async -> Result)? + nonisolated(unsafe) var trackRecentlyVisitedRoomClosure: ((String) async -> Result)? - func trackRecentlyVisitedRoom(_ roomID: String) async -> Result { + @concurrent func trackRecentlyVisitedRoom(_ roomID: String) async -> Result { trackRecentlyVisitedRoomCallsCountLock.withLock { trackRecentlyVisitedRoomUnderlyingCallsCount += 1 } trackRecentlyVisitedRoomReceivedRoomID = roomID trackRecentlyVisitedRoomReceivedInvocationsLock.withLock { trackRecentlyVisitedRoomUnderlyingReceivedInvocations.append(roomID) } @@ -3892,7 +3892,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - recentlyVisitedRooms private let recentlyVisitedRoomsFilterCallsCountLock = NSLock() - private var recentlyVisitedRoomsFilterUnderlyingCallsCount = 0 + private nonisolated(unsafe) var recentlyVisitedRoomsFilterUnderlyingCallsCount = 0 var recentlyVisitedRoomsFilterCallsCount: Int { get { recentlyVisitedRoomsFilterCallsCountLock.withLock { recentlyVisitedRoomsFilterUnderlyingCallsCount } } set { recentlyVisitedRoomsFilterCallsCountLock.withLock { recentlyVisitedRoomsFilterUnderlyingCallsCount = newValue } } @@ -3902,14 +3902,14 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { } private let recentlyVisitedRoomsFilterReturnValueLock = NSLock() - private var recentlyVisitedRoomsFilterUnderlyingReturnValue: [JoinedRoomProxyProtocol]! + private nonisolated(unsafe) var recentlyVisitedRoomsFilterUnderlyingReturnValue: [JoinedRoomProxyProtocol]! var recentlyVisitedRoomsFilterReturnValue: [JoinedRoomProxyProtocol]! { get { recentlyVisitedRoomsFilterReturnValueLock.withLock { recentlyVisitedRoomsFilterUnderlyingReturnValue } } set { recentlyVisitedRoomsFilterReturnValueLock.withLock { recentlyVisitedRoomsFilterUnderlyingReturnValue = newValue } } } - var recentlyVisitedRoomsFilterClosure: (((JoinedRoomProxyProtocol) -> Bool) async -> [JoinedRoomProxyProtocol])? + nonisolated(unsafe) var recentlyVisitedRoomsFilterClosure: ((@Sendable (JoinedRoomProxyProtocol) -> Bool) async -> [JoinedRoomProxyProtocol])? - func recentlyVisitedRooms(filter: (JoinedRoomProxyProtocol) -> Bool) async -> [JoinedRoomProxyProtocol] { + @concurrent func recentlyVisitedRooms(filter: @Sendable (JoinedRoomProxyProtocol) -> Bool) async -> [JoinedRoomProxyProtocol] { recentlyVisitedRoomsFilterCallsCountLock.withLock { recentlyVisitedRoomsFilterUnderlyingCallsCount += 1 } if let recentlyVisitedRoomsFilterClosure = recentlyVisitedRoomsFilterClosure { return await recentlyVisitedRoomsFilterClosure(filter) @@ -3920,7 +3920,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - recentConversationCounterparts private let recentConversationCounterpartsCallsCountLock = NSLock() - private var recentConversationCounterpartsUnderlyingCallsCount = 0 + private nonisolated(unsafe) var recentConversationCounterpartsUnderlyingCallsCount = 0 var recentConversationCounterpartsCallsCount: Int { get { recentConversationCounterpartsCallsCountLock.withLock { recentConversationCounterpartsUnderlyingCallsCount } } set { recentConversationCounterpartsCallsCountLock.withLock { recentConversationCounterpartsUnderlyingCallsCount = newValue } } @@ -3930,14 +3930,14 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { } private let recentConversationCounterpartsReturnValueLock = NSLock() - private var recentConversationCounterpartsUnderlyingReturnValue: [UserProfileProxy]! + private nonisolated(unsafe) var recentConversationCounterpartsUnderlyingReturnValue: [UserProfileProxy]! var recentConversationCounterpartsReturnValue: [UserProfileProxy]! { get { recentConversationCounterpartsReturnValueLock.withLock { recentConversationCounterpartsUnderlyingReturnValue } } set { recentConversationCounterpartsReturnValueLock.withLock { recentConversationCounterpartsUnderlyingReturnValue = newValue } } } - var recentConversationCounterpartsClosure: (() async -> [UserProfileProxy])? + nonisolated(unsafe) var recentConversationCounterpartsClosure: (() async -> [UserProfileProxy])? - func recentConversationCounterparts() async -> [UserProfileProxy] { + @concurrent func recentConversationCounterparts() async -> [UserProfileProxy] { recentConversationCounterpartsCallsCountLock.withLock { recentConversationCounterpartsUnderlyingCallsCount += 1 } if let recentConversationCounterpartsClosure = recentConversationCounterpartsClosure { return await recentConversationCounterpartsClosure() @@ -3948,7 +3948,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - ed25519Base64 private let ed25519Base64CallsCountLock = NSLock() - private var ed25519Base64UnderlyingCallsCount = 0 + private nonisolated(unsafe) var ed25519Base64UnderlyingCallsCount = 0 var ed25519Base64CallsCount: Int { get { ed25519Base64CallsCountLock.withLock { ed25519Base64UnderlyingCallsCount } } set { ed25519Base64CallsCountLock.withLock { ed25519Base64UnderlyingCallsCount = newValue } } @@ -3958,14 +3958,14 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { } private let ed25519Base64ReturnValueLock = NSLock() - private var ed25519Base64UnderlyingReturnValue: String? + private nonisolated(unsafe) var ed25519Base64UnderlyingReturnValue: String? var ed25519Base64ReturnValue: String? { get { ed25519Base64ReturnValueLock.withLock { ed25519Base64UnderlyingReturnValue } } set { ed25519Base64ReturnValueLock.withLock { ed25519Base64UnderlyingReturnValue = newValue } } } - var ed25519Base64Closure: (() async -> String?)? + nonisolated(unsafe) var ed25519Base64Closure: (() async -> String?)? - func ed25519Base64() async -> String? { + @concurrent func ed25519Base64() async -> String? { ed25519Base64CallsCountLock.withLock { ed25519Base64UnderlyingCallsCount += 1 } if let ed25519Base64Closure = ed25519Base64Closure { return await ed25519Base64Closure() @@ -3976,7 +3976,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - curve25519Base64 private let curve25519Base64CallsCountLock = NSLock() - private var curve25519Base64UnderlyingCallsCount = 0 + private nonisolated(unsafe) var curve25519Base64UnderlyingCallsCount = 0 var curve25519Base64CallsCount: Int { get { curve25519Base64CallsCountLock.withLock { curve25519Base64UnderlyingCallsCount } } set { curve25519Base64CallsCountLock.withLock { curve25519Base64UnderlyingCallsCount = newValue } } @@ -3986,14 +3986,14 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { } private let curve25519Base64ReturnValueLock = NSLock() - private var curve25519Base64UnderlyingReturnValue: String? + private nonisolated(unsafe) var curve25519Base64UnderlyingReturnValue: String? var curve25519Base64ReturnValue: String? { get { curve25519Base64ReturnValueLock.withLock { curve25519Base64UnderlyingReturnValue } } set { curve25519Base64ReturnValueLock.withLock { curve25519Base64UnderlyingReturnValue = newValue } } } - var curve25519Base64Closure: (() async -> String?)? + nonisolated(unsafe) var curve25519Base64Closure: (() async -> String?)? - func curve25519Base64() async -> String? { + @concurrent func curve25519Base64() async -> String? { curve25519Base64CallsCountLock.withLock { curve25519Base64UnderlyingCallsCount += 1 } if let curve25519Base64Closure = curve25519Base64Closure { return await curve25519Base64Closure() @@ -4004,7 +4004,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - pinUserIdentity private let pinUserIdentityCallsCountLock = NSLock() - private var pinUserIdentityUnderlyingCallsCount = 0 + private nonisolated(unsafe) var pinUserIdentityUnderlyingCallsCount = 0 var pinUserIdentityCallsCount: Int { get { pinUserIdentityCallsCountLock.withLock { pinUserIdentityUnderlyingCallsCount } } set { pinUserIdentityCallsCountLock.withLock { pinUserIdentityUnderlyingCallsCount = newValue } } @@ -4013,27 +4013,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return pinUserIdentityCallsCount > 0 } private let pinUserIdentityReceivedUserIDLock = NSLock() - private var pinUserIdentityUnderlyingReceivedUserID: String? + private nonisolated(unsafe) var pinUserIdentityUnderlyingReceivedUserID: String? var pinUserIdentityReceivedUserID: String? { get { pinUserIdentityReceivedUserIDLock.withLock { pinUserIdentityUnderlyingReceivedUserID } } set { pinUserIdentityReceivedUserIDLock.withLock { pinUserIdentityUnderlyingReceivedUserID = newValue } } } private let pinUserIdentityReceivedInvocationsLock = NSLock() - private var pinUserIdentityUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var pinUserIdentityUnderlyingReceivedInvocations: [String] = [] var pinUserIdentityReceivedInvocations: [String] { get { pinUserIdentityReceivedInvocationsLock.withLock { pinUserIdentityUnderlyingReceivedInvocations } } set { pinUserIdentityReceivedInvocationsLock.withLock { pinUserIdentityUnderlyingReceivedInvocations = newValue } } } private let pinUserIdentityReturnValueLock = NSLock() - private var pinUserIdentityUnderlyingReturnValue: Result! + private nonisolated(unsafe) var pinUserIdentityUnderlyingReturnValue: Result! var pinUserIdentityReturnValue: Result! { get { pinUserIdentityReturnValueLock.withLock { pinUserIdentityUnderlyingReturnValue } } set { pinUserIdentityReturnValueLock.withLock { pinUserIdentityUnderlyingReturnValue = newValue } } } - var pinUserIdentityClosure: ((String) async -> Result)? + nonisolated(unsafe) var pinUserIdentityClosure: ((String) async -> Result)? - func pinUserIdentity(_ userID: String) async -> Result { + @concurrent func pinUserIdentity(_ userID: String) async -> Result { pinUserIdentityCallsCountLock.withLock { pinUserIdentityUnderlyingCallsCount += 1 } pinUserIdentityReceivedUserID = userID pinUserIdentityReceivedInvocationsLock.withLock { pinUserIdentityUnderlyingReceivedInvocations.append(userID) } @@ -4046,7 +4046,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - withdrawUserIdentityVerification private let withdrawUserIdentityVerificationCallsCountLock = NSLock() - private var withdrawUserIdentityVerificationUnderlyingCallsCount = 0 + private nonisolated(unsafe) var withdrawUserIdentityVerificationUnderlyingCallsCount = 0 var withdrawUserIdentityVerificationCallsCount: Int { get { withdrawUserIdentityVerificationCallsCountLock.withLock { withdrawUserIdentityVerificationUnderlyingCallsCount } } set { withdrawUserIdentityVerificationCallsCountLock.withLock { withdrawUserIdentityVerificationUnderlyingCallsCount = newValue } } @@ -4055,27 +4055,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return withdrawUserIdentityVerificationCallsCount > 0 } private let withdrawUserIdentityVerificationReceivedUserIDLock = NSLock() - private var withdrawUserIdentityVerificationUnderlyingReceivedUserID: String? + private nonisolated(unsafe) var withdrawUserIdentityVerificationUnderlyingReceivedUserID: String? var withdrawUserIdentityVerificationReceivedUserID: String? { get { withdrawUserIdentityVerificationReceivedUserIDLock.withLock { withdrawUserIdentityVerificationUnderlyingReceivedUserID } } set { withdrawUserIdentityVerificationReceivedUserIDLock.withLock { withdrawUserIdentityVerificationUnderlyingReceivedUserID = newValue } } } private let withdrawUserIdentityVerificationReceivedInvocationsLock = NSLock() - private var withdrawUserIdentityVerificationUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var withdrawUserIdentityVerificationUnderlyingReceivedInvocations: [String] = [] var withdrawUserIdentityVerificationReceivedInvocations: [String] { get { withdrawUserIdentityVerificationReceivedInvocationsLock.withLock { withdrawUserIdentityVerificationUnderlyingReceivedInvocations } } set { withdrawUserIdentityVerificationReceivedInvocationsLock.withLock { withdrawUserIdentityVerificationUnderlyingReceivedInvocations = newValue } } } private let withdrawUserIdentityVerificationReturnValueLock = NSLock() - private var withdrawUserIdentityVerificationUnderlyingReturnValue: Result! + private nonisolated(unsafe) var withdrawUserIdentityVerificationUnderlyingReturnValue: Result! var withdrawUserIdentityVerificationReturnValue: Result! { get { withdrawUserIdentityVerificationReturnValueLock.withLock { withdrawUserIdentityVerificationUnderlyingReturnValue } } set { withdrawUserIdentityVerificationReturnValueLock.withLock { withdrawUserIdentityVerificationUnderlyingReturnValue = newValue } } } - var withdrawUserIdentityVerificationClosure: ((String) async -> Result)? + nonisolated(unsafe) var withdrawUserIdentityVerificationClosure: ((String) async -> Result)? - func withdrawUserIdentityVerification(_ userID: String) async -> Result { + @concurrent func withdrawUserIdentityVerification(_ userID: String) async -> Result { withdrawUserIdentityVerificationCallsCountLock.withLock { withdrawUserIdentityVerificationUnderlyingCallsCount += 1 } withdrawUserIdentityVerificationReceivedUserID = userID withdrawUserIdentityVerificationReceivedInvocationsLock.withLock { withdrawUserIdentityVerificationUnderlyingReceivedInvocations.append(userID) } @@ -4088,7 +4088,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - resetIdentity private let resetIdentityCallsCountLock = NSLock() - private var resetIdentityUnderlyingCallsCount = 0 + private nonisolated(unsafe) var resetIdentityUnderlyingCallsCount = 0 var resetIdentityCallsCount: Int { get { resetIdentityCallsCountLock.withLock { resetIdentityUnderlyingCallsCount } } set { resetIdentityCallsCountLock.withLock { resetIdentityUnderlyingCallsCount = newValue } } @@ -4098,14 +4098,14 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { } private let resetIdentityReturnValueLock = NSLock() - private var resetIdentityUnderlyingReturnValue: Result! + private nonisolated(unsafe) var resetIdentityUnderlyingReturnValue: Result! var resetIdentityReturnValue: Result! { get { resetIdentityReturnValueLock.withLock { resetIdentityUnderlyingReturnValue } } set { resetIdentityReturnValueLock.withLock { resetIdentityUnderlyingReturnValue = newValue } } } - var resetIdentityClosure: (() async -> Result)? + nonisolated(unsafe) var resetIdentityClosure: (() async -> Result)? - func resetIdentity() async -> Result { + @concurrent func resetIdentity() async -> Result { resetIdentityCallsCountLock.withLock { resetIdentityUnderlyingCallsCount += 1 } if let resetIdentityClosure = resetIdentityClosure { return await resetIdentityClosure() @@ -4116,7 +4116,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - userIdentity private let userIdentityForFallBackToServerCallsCountLock = NSLock() - private var userIdentityForFallBackToServerUnderlyingCallsCount = 0 + private nonisolated(unsafe) var userIdentityForFallBackToServerUnderlyingCallsCount = 0 var userIdentityForFallBackToServerCallsCount: Int { get { userIdentityForFallBackToServerCallsCountLock.withLock { userIdentityForFallBackToServerUnderlyingCallsCount } } set { userIdentityForFallBackToServerCallsCountLock.withLock { userIdentityForFallBackToServerUnderlyingCallsCount = newValue } } @@ -4125,27 +4125,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return userIdentityForFallBackToServerCallsCount > 0 } private let userIdentityForFallBackToServerReceivedArgumentsLock = NSLock() - private var userIdentityForFallBackToServerUnderlyingReceivedArguments: (userID: String, fallBackToServer: Bool)? + private nonisolated(unsafe) var userIdentityForFallBackToServerUnderlyingReceivedArguments: (userID: String, fallBackToServer: Bool)? var userIdentityForFallBackToServerReceivedArguments: (userID: String, fallBackToServer: Bool)? { get { userIdentityForFallBackToServerReceivedArgumentsLock.withLock { userIdentityForFallBackToServerUnderlyingReceivedArguments } } set { userIdentityForFallBackToServerReceivedArgumentsLock.withLock { userIdentityForFallBackToServerUnderlyingReceivedArguments = newValue } } } private let userIdentityForFallBackToServerReceivedInvocationsLock = NSLock() - private var userIdentityForFallBackToServerUnderlyingReceivedInvocations: [(userID: String, fallBackToServer: Bool)] = [] + private nonisolated(unsafe) var userIdentityForFallBackToServerUnderlyingReceivedInvocations: [(userID: String, fallBackToServer: Bool)] = [] var userIdentityForFallBackToServerReceivedInvocations: [(userID: String, fallBackToServer: Bool)] { get { userIdentityForFallBackToServerReceivedInvocationsLock.withLock { userIdentityForFallBackToServerUnderlyingReceivedInvocations } } set { userIdentityForFallBackToServerReceivedInvocationsLock.withLock { userIdentityForFallBackToServerUnderlyingReceivedInvocations = newValue } } } private let userIdentityForFallBackToServerReturnValueLock = NSLock() - private var userIdentityForFallBackToServerUnderlyingReturnValue: Result! + private nonisolated(unsafe) var userIdentityForFallBackToServerUnderlyingReturnValue: Result! var userIdentityForFallBackToServerReturnValue: Result! { get { userIdentityForFallBackToServerReturnValueLock.withLock { userIdentityForFallBackToServerUnderlyingReturnValue } } set { userIdentityForFallBackToServerReturnValueLock.withLock { userIdentityForFallBackToServerUnderlyingReturnValue = newValue } } } - var userIdentityForFallBackToServerClosure: ((String, Bool) async -> Result)? + nonisolated(unsafe) var userIdentityForFallBackToServerClosure: ((String, Bool) async -> Result)? - func userIdentity(for userID: String, fallBackToServer: Bool) async -> Result { + @concurrent func userIdentity(for userID: String, fallBackToServer: Bool) async -> Result { userIdentityForFallBackToServerCallsCountLock.withLock { userIdentityForFallBackToServerUnderlyingCallsCount += 1 } userIdentityForFallBackToServerReceivedArguments = (userID: userID, fallBackToServer: fallBackToServer) userIdentityForFallBackToServerReceivedInvocationsLock.withLock { userIdentityForFallBackToServerUnderlyingReceivedInvocations.append((userID: userID, fallBackToServer: fallBackToServer)) } @@ -4158,7 +4158,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - setTimelineMediaVisibility private let setTimelineMediaVisibilityCallsCountLock = NSLock() - private var setTimelineMediaVisibilityUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setTimelineMediaVisibilityUnderlyingCallsCount = 0 var setTimelineMediaVisibilityCallsCount: Int { get { setTimelineMediaVisibilityCallsCountLock.withLock { setTimelineMediaVisibilityUnderlyingCallsCount } } set { setTimelineMediaVisibilityCallsCountLock.withLock { setTimelineMediaVisibilityUnderlyingCallsCount = newValue } } @@ -4167,27 +4167,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return setTimelineMediaVisibilityCallsCount > 0 } private let setTimelineMediaVisibilityReceivedValueLock = NSLock() - private var setTimelineMediaVisibilityUnderlyingReceivedValue: TimelineMediaVisibility? + private nonisolated(unsafe) var setTimelineMediaVisibilityUnderlyingReceivedValue: TimelineMediaVisibility? var setTimelineMediaVisibilityReceivedValue: TimelineMediaVisibility? { get { setTimelineMediaVisibilityReceivedValueLock.withLock { setTimelineMediaVisibilityUnderlyingReceivedValue } } set { setTimelineMediaVisibilityReceivedValueLock.withLock { setTimelineMediaVisibilityUnderlyingReceivedValue = newValue } } } private let setTimelineMediaVisibilityReceivedInvocationsLock = NSLock() - private var setTimelineMediaVisibilityUnderlyingReceivedInvocations: [TimelineMediaVisibility] = [] + private nonisolated(unsafe) var setTimelineMediaVisibilityUnderlyingReceivedInvocations: [TimelineMediaVisibility] = [] var setTimelineMediaVisibilityReceivedInvocations: [TimelineMediaVisibility] { get { setTimelineMediaVisibilityReceivedInvocationsLock.withLock { setTimelineMediaVisibilityUnderlyingReceivedInvocations } } set { setTimelineMediaVisibilityReceivedInvocationsLock.withLock { setTimelineMediaVisibilityUnderlyingReceivedInvocations = newValue } } } private let setTimelineMediaVisibilityReturnValueLock = NSLock() - private var setTimelineMediaVisibilityUnderlyingReturnValue: Result! + private nonisolated(unsafe) var setTimelineMediaVisibilityUnderlyingReturnValue: Result! var setTimelineMediaVisibilityReturnValue: Result! { get { setTimelineMediaVisibilityReturnValueLock.withLock { setTimelineMediaVisibilityUnderlyingReturnValue } } set { setTimelineMediaVisibilityReturnValueLock.withLock { setTimelineMediaVisibilityUnderlyingReturnValue = newValue } } } - var setTimelineMediaVisibilityClosure: ((TimelineMediaVisibility) async -> Result)? + nonisolated(unsafe) var setTimelineMediaVisibilityClosure: ((TimelineMediaVisibility) async -> Result)? - func setTimelineMediaVisibility(_ value: TimelineMediaVisibility) async -> Result { + @concurrent func setTimelineMediaVisibility(_ value: TimelineMediaVisibility) async -> Result { setTimelineMediaVisibilityCallsCountLock.withLock { setTimelineMediaVisibilityUnderlyingCallsCount += 1 } setTimelineMediaVisibilityReceivedValue = value setTimelineMediaVisibilityReceivedInvocationsLock.withLock { setTimelineMediaVisibilityUnderlyingReceivedInvocations.append(value) } @@ -4200,7 +4200,7 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { //MARK: - setHideInviteAvatars private let setHideInviteAvatarsCallsCountLock = NSLock() - private var setHideInviteAvatarsUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setHideInviteAvatarsUnderlyingCallsCount = 0 var setHideInviteAvatarsCallsCount: Int { get { setHideInviteAvatarsCallsCountLock.withLock { setHideInviteAvatarsUnderlyingCallsCount } } set { setHideInviteAvatarsCallsCountLock.withLock { setHideInviteAvatarsUnderlyingCallsCount = newValue } } @@ -4209,27 +4209,27 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { return setHideInviteAvatarsCallsCount > 0 } private let setHideInviteAvatarsReceivedValueLock = NSLock() - private var setHideInviteAvatarsUnderlyingReceivedValue: Bool? + private nonisolated(unsafe) var setHideInviteAvatarsUnderlyingReceivedValue: Bool? var setHideInviteAvatarsReceivedValue: Bool? { get { setHideInviteAvatarsReceivedValueLock.withLock { setHideInviteAvatarsUnderlyingReceivedValue } } set { setHideInviteAvatarsReceivedValueLock.withLock { setHideInviteAvatarsUnderlyingReceivedValue = newValue } } } private let setHideInviteAvatarsReceivedInvocationsLock = NSLock() - private var setHideInviteAvatarsUnderlyingReceivedInvocations: [Bool] = [] + private nonisolated(unsafe) var setHideInviteAvatarsUnderlyingReceivedInvocations: [Bool] = [] var setHideInviteAvatarsReceivedInvocations: [Bool] { get { setHideInviteAvatarsReceivedInvocationsLock.withLock { setHideInviteAvatarsUnderlyingReceivedInvocations } } set { setHideInviteAvatarsReceivedInvocationsLock.withLock { setHideInviteAvatarsUnderlyingReceivedInvocations = newValue } } } private let setHideInviteAvatarsReturnValueLock = NSLock() - private var setHideInviteAvatarsUnderlyingReturnValue: Result! + private nonisolated(unsafe) var setHideInviteAvatarsUnderlyingReturnValue: Result! var setHideInviteAvatarsReturnValue: Result! { get { setHideInviteAvatarsReturnValueLock.withLock { setHideInviteAvatarsUnderlyingReturnValue } } set { setHideInviteAvatarsReturnValueLock.withLock { setHideInviteAvatarsUnderlyingReturnValue = newValue } } } - var setHideInviteAvatarsClosure: ((Bool) async -> Result)? + nonisolated(unsafe) var setHideInviteAvatarsClosure: ((Bool) async -> Result)? - func setHideInviteAvatars(_ value: Bool) async -> Result { + @concurrent func setHideInviteAvatars(_ value: Bool) async -> Result { setHideInviteAvatarsCallsCountLock.withLock { setHideInviteAvatarsUnderlyingCallsCount += 1 } setHideInviteAvatarsReceivedValue = value setHideInviteAvatarsReceivedInvocationsLock.withLock { setHideInviteAvatarsUnderlyingReceivedInvocations.append(value) } @@ -4240,17 +4240,17 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable { } } } -class CompletionSuggestionServiceMock: CompletionSuggestionServiceProtocol, @unchecked Sendable { +nonisolated class CompletionSuggestionServiceMock: CompletionSuggestionServiceProtocol, @unchecked Sendable { var suggestionsPublisher: AnyPublisher<[SuggestionItem], Never> { get { return underlyingSuggestionsPublisher } set(value) { underlyingSuggestionsPublisher = value } } - var underlyingSuggestionsPublisher: AnyPublisher<[SuggestionItem], Never>! + nonisolated(unsafe) var underlyingSuggestionsPublisher: AnyPublisher<[SuggestionItem], Never>! //MARK: - processTextMessage private let processTextMessageSelectedRangeCallsCountLock = NSLock() - private var processTextMessageSelectedRangeUnderlyingCallsCount = 0 + private nonisolated(unsafe) var processTextMessageSelectedRangeUnderlyingCallsCount = 0 var processTextMessageSelectedRangeCallsCount: Int { get { processTextMessageSelectedRangeCallsCountLock.withLock { processTextMessageSelectedRangeUnderlyingCallsCount } } set { processTextMessageSelectedRangeCallsCountLock.withLock { processTextMessageSelectedRangeUnderlyingCallsCount = newValue } } @@ -4259,18 +4259,18 @@ class CompletionSuggestionServiceMock: CompletionSuggestionServiceProtocol, @unc return processTextMessageSelectedRangeCallsCount > 0 } private let processTextMessageSelectedRangeReceivedArgumentsLock = NSLock() - private var processTextMessageSelectedRangeUnderlyingReceivedArguments: (textMessage: String, selectedRange: NSRange)? + private nonisolated(unsafe) var processTextMessageSelectedRangeUnderlyingReceivedArguments: (textMessage: String, selectedRange: NSRange)? var processTextMessageSelectedRangeReceivedArguments: (textMessage: String, selectedRange: NSRange)? { get { processTextMessageSelectedRangeReceivedArgumentsLock.withLock { processTextMessageSelectedRangeUnderlyingReceivedArguments } } set { processTextMessageSelectedRangeReceivedArgumentsLock.withLock { processTextMessageSelectedRangeUnderlyingReceivedArguments = newValue } } } private let processTextMessageSelectedRangeReceivedInvocationsLock = NSLock() - private var processTextMessageSelectedRangeUnderlyingReceivedInvocations: [(textMessage: String, selectedRange: NSRange)] = [] + private nonisolated(unsafe) var processTextMessageSelectedRangeUnderlyingReceivedInvocations: [(textMessage: String, selectedRange: NSRange)] = [] var processTextMessageSelectedRangeReceivedInvocations: [(textMessage: String, selectedRange: NSRange)] { get { processTextMessageSelectedRangeReceivedInvocationsLock.withLock { processTextMessageSelectedRangeUnderlyingReceivedInvocations } } set { processTextMessageSelectedRangeReceivedInvocationsLock.withLock { processTextMessageSelectedRangeUnderlyingReceivedInvocations = newValue } } } - var processTextMessageSelectedRangeClosure: ((String, NSRange) -> Void)? + nonisolated(unsafe) var processTextMessageSelectedRangeClosure: ((String, NSRange) -> Void)? func processTextMessage(_ textMessage: String, selectedRange: NSRange) { processTextMessageSelectedRangeCallsCountLock.withLock { processTextMessageSelectedRangeUnderlyingCallsCount += 1 } @@ -4281,7 +4281,7 @@ class CompletionSuggestionServiceMock: CompletionSuggestionServiceProtocol, @unc //MARK: - setSuggestionTrigger private let setSuggestionTriggerCallsCountLock = NSLock() - private var setSuggestionTriggerUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setSuggestionTriggerUnderlyingCallsCount = 0 var setSuggestionTriggerCallsCount: Int { get { setSuggestionTriggerCallsCountLock.withLock { setSuggestionTriggerUnderlyingCallsCount } } set { setSuggestionTriggerCallsCountLock.withLock { setSuggestionTriggerUnderlyingCallsCount = newValue } } @@ -4290,18 +4290,18 @@ class CompletionSuggestionServiceMock: CompletionSuggestionServiceProtocol, @unc return setSuggestionTriggerCallsCount > 0 } private let setSuggestionTriggerReceivedSuggestionTriggerLock = NSLock() - private var setSuggestionTriggerUnderlyingReceivedSuggestionTrigger: SuggestionTrigger? + private nonisolated(unsafe) var setSuggestionTriggerUnderlyingReceivedSuggestionTrigger: SuggestionTrigger? var setSuggestionTriggerReceivedSuggestionTrigger: SuggestionTrigger? { get { setSuggestionTriggerReceivedSuggestionTriggerLock.withLock { setSuggestionTriggerUnderlyingReceivedSuggestionTrigger } } set { setSuggestionTriggerReceivedSuggestionTriggerLock.withLock { setSuggestionTriggerUnderlyingReceivedSuggestionTrigger = newValue } } } private let setSuggestionTriggerReceivedInvocationsLock = NSLock() - private var setSuggestionTriggerUnderlyingReceivedInvocations: [SuggestionTrigger?] = [] + private nonisolated(unsafe) var setSuggestionTriggerUnderlyingReceivedInvocations: [SuggestionTrigger?] = [] var setSuggestionTriggerReceivedInvocations: [SuggestionTrigger?] { get { setSuggestionTriggerReceivedInvocationsLock.withLock { setSuggestionTriggerUnderlyingReceivedInvocations } } set { setSuggestionTriggerReceivedInvocationsLock.withLock { setSuggestionTriggerUnderlyingReceivedInvocations = newValue } } } - var setSuggestionTriggerClosure: ((SuggestionTrigger?) -> Void)? + nonisolated(unsafe) var setSuggestionTriggerClosure: ((SuggestionTrigger?) -> Void)? func setSuggestionTrigger(_ suggestionTrigger: SuggestionTrigger?) { setSuggestionTriggerCallsCountLock.withLock { setSuggestionTriggerUnderlyingCallsCount += 1 } @@ -4310,12 +4310,12 @@ class CompletionSuggestionServiceMock: CompletionSuggestionServiceProtocol, @unc setSuggestionTriggerClosure?(suggestionTrigger) } } -class ComposerDraftServiceMock: ComposerDraftServiceProtocol, @unchecked Sendable { +nonisolated class ComposerDraftServiceMock: ComposerDraftServiceProtocol, @unchecked Sendable { //MARK: - saveDraft private let saveDraftCallsCountLock = NSLock() - private var saveDraftUnderlyingCallsCount = 0 + private nonisolated(unsafe) var saveDraftUnderlyingCallsCount = 0 var saveDraftCallsCount: Int { get { saveDraftCallsCountLock.withLock { saveDraftUnderlyingCallsCount } } set { saveDraftCallsCountLock.withLock { saveDraftUnderlyingCallsCount = newValue } } @@ -4324,27 +4324,27 @@ class ComposerDraftServiceMock: ComposerDraftServiceProtocol, @unchecked Sendabl return saveDraftCallsCount > 0 } private let saveDraftReceivedDraftLock = NSLock() - private var saveDraftUnderlyingReceivedDraft: ComposerDraftProxy? + private nonisolated(unsafe) var saveDraftUnderlyingReceivedDraft: ComposerDraftProxy? var saveDraftReceivedDraft: ComposerDraftProxy? { get { saveDraftReceivedDraftLock.withLock { saveDraftUnderlyingReceivedDraft } } set { saveDraftReceivedDraftLock.withLock { saveDraftUnderlyingReceivedDraft = newValue } } } private let saveDraftReceivedInvocationsLock = NSLock() - private var saveDraftUnderlyingReceivedInvocations: [ComposerDraftProxy] = [] + private nonisolated(unsafe) var saveDraftUnderlyingReceivedInvocations: [ComposerDraftProxy] = [] var saveDraftReceivedInvocations: [ComposerDraftProxy] { get { saveDraftReceivedInvocationsLock.withLock { saveDraftUnderlyingReceivedInvocations } } set { saveDraftReceivedInvocationsLock.withLock { saveDraftUnderlyingReceivedInvocations = newValue } } } private let saveDraftReturnValueLock = NSLock() - private var saveDraftUnderlyingReturnValue: Result! + private nonisolated(unsafe) var saveDraftUnderlyingReturnValue: Result! var saveDraftReturnValue: Result! { get { saveDraftReturnValueLock.withLock { saveDraftUnderlyingReturnValue } } set { saveDraftReturnValueLock.withLock { saveDraftUnderlyingReturnValue = newValue } } } - var saveDraftClosure: ((ComposerDraftProxy) async -> Result)? + nonisolated(unsafe) var saveDraftClosure: ((ComposerDraftProxy) async -> Result)? - func saveDraft(_ draft: ComposerDraftProxy) async -> Result { + @concurrent func saveDraft(_ draft: ComposerDraftProxy) async -> Result { saveDraftCallsCountLock.withLock { saveDraftUnderlyingCallsCount += 1 } saveDraftReceivedDraft = draft saveDraftReceivedInvocationsLock.withLock { saveDraftUnderlyingReceivedInvocations.append(draft) } @@ -4357,7 +4357,7 @@ class ComposerDraftServiceMock: ComposerDraftServiceProtocol, @unchecked Sendabl //MARK: - saveVolatileDraft private let saveVolatileDraftCallsCountLock = NSLock() - private var saveVolatileDraftUnderlyingCallsCount = 0 + private nonisolated(unsafe) var saveVolatileDraftUnderlyingCallsCount = 0 var saveVolatileDraftCallsCount: Int { get { saveVolatileDraftCallsCountLock.withLock { saveVolatileDraftUnderlyingCallsCount } } set { saveVolatileDraftCallsCountLock.withLock { saveVolatileDraftUnderlyingCallsCount = newValue } } @@ -4366,18 +4366,18 @@ class ComposerDraftServiceMock: ComposerDraftServiceProtocol, @unchecked Sendabl return saveVolatileDraftCallsCount > 0 } private let saveVolatileDraftReceivedDraftLock = NSLock() - private var saveVolatileDraftUnderlyingReceivedDraft: ComposerDraftProxy? + private nonisolated(unsafe) var saveVolatileDraftUnderlyingReceivedDraft: ComposerDraftProxy? var saveVolatileDraftReceivedDraft: ComposerDraftProxy? { get { saveVolatileDraftReceivedDraftLock.withLock { saveVolatileDraftUnderlyingReceivedDraft } } set { saveVolatileDraftReceivedDraftLock.withLock { saveVolatileDraftUnderlyingReceivedDraft = newValue } } } private let saveVolatileDraftReceivedInvocationsLock = NSLock() - private var saveVolatileDraftUnderlyingReceivedInvocations: [ComposerDraftProxy] = [] + private nonisolated(unsafe) var saveVolatileDraftUnderlyingReceivedInvocations: [ComposerDraftProxy] = [] var saveVolatileDraftReceivedInvocations: [ComposerDraftProxy] { get { saveVolatileDraftReceivedInvocationsLock.withLock { saveVolatileDraftUnderlyingReceivedInvocations } } set { saveVolatileDraftReceivedInvocationsLock.withLock { saveVolatileDraftUnderlyingReceivedInvocations = newValue } } } - var saveVolatileDraftClosure: ((ComposerDraftProxy) -> Void)? + nonisolated(unsafe) var saveVolatileDraftClosure: ((ComposerDraftProxy) -> Void)? func saveVolatileDraft(_ draft: ComposerDraftProxy) { saveVolatileDraftCallsCountLock.withLock { saveVolatileDraftUnderlyingCallsCount += 1 } @@ -4388,7 +4388,7 @@ class ComposerDraftServiceMock: ComposerDraftServiceProtocol, @unchecked Sendabl //MARK: - loadDraft private let loadDraftCallsCountLock = NSLock() - private var loadDraftUnderlyingCallsCount = 0 + private nonisolated(unsafe) var loadDraftUnderlyingCallsCount = 0 var loadDraftCallsCount: Int { get { loadDraftCallsCountLock.withLock { loadDraftUnderlyingCallsCount } } set { loadDraftCallsCountLock.withLock { loadDraftUnderlyingCallsCount = newValue } } @@ -4398,14 +4398,14 @@ class ComposerDraftServiceMock: ComposerDraftServiceProtocol, @unchecked Sendabl } private let loadDraftReturnValueLock = NSLock() - private var loadDraftUnderlyingReturnValue: Result! + private nonisolated(unsafe) var loadDraftUnderlyingReturnValue: Result! var loadDraftReturnValue: Result! { get { loadDraftReturnValueLock.withLock { loadDraftUnderlyingReturnValue } } set { loadDraftReturnValueLock.withLock { loadDraftUnderlyingReturnValue = newValue } } } - var loadDraftClosure: (() async -> Result)? + nonisolated(unsafe) var loadDraftClosure: (() async -> Result)? - func loadDraft() async -> Result { + @concurrent func loadDraft() async -> Result { loadDraftCallsCountLock.withLock { loadDraftUnderlyingCallsCount += 1 } if let loadDraftClosure = loadDraftClosure { return await loadDraftClosure() @@ -4416,7 +4416,7 @@ class ComposerDraftServiceMock: ComposerDraftServiceProtocol, @unchecked Sendabl //MARK: - loadVolatileDraft private let loadVolatileDraftCallsCountLock = NSLock() - private var loadVolatileDraftUnderlyingCallsCount = 0 + private nonisolated(unsafe) var loadVolatileDraftUnderlyingCallsCount = 0 var loadVolatileDraftCallsCount: Int { get { loadVolatileDraftCallsCountLock.withLock { loadVolatileDraftUnderlyingCallsCount } } set { loadVolatileDraftCallsCountLock.withLock { loadVolatileDraftUnderlyingCallsCount = newValue } } @@ -4426,12 +4426,12 @@ class ComposerDraftServiceMock: ComposerDraftServiceProtocol, @unchecked Sendabl } private let loadVolatileDraftReturnValueLock = NSLock() - private var loadVolatileDraftUnderlyingReturnValue: ComposerDraftProxy? + private nonisolated(unsafe) var loadVolatileDraftUnderlyingReturnValue: ComposerDraftProxy? var loadVolatileDraftReturnValue: ComposerDraftProxy? { get { loadVolatileDraftReturnValueLock.withLock { loadVolatileDraftUnderlyingReturnValue } } set { loadVolatileDraftReturnValueLock.withLock { loadVolatileDraftUnderlyingReturnValue = newValue } } } - var loadVolatileDraftClosure: (() -> ComposerDraftProxy?)? + nonisolated(unsafe) var loadVolatileDraftClosure: (() -> ComposerDraftProxy?)? func loadVolatileDraft() -> ComposerDraftProxy? { loadVolatileDraftCallsCountLock.withLock { loadVolatileDraftUnderlyingCallsCount += 1 } @@ -4444,7 +4444,7 @@ class ComposerDraftServiceMock: ComposerDraftServiceProtocol, @unchecked Sendabl //MARK: - clearDraft private let clearDraftCallsCountLock = NSLock() - private var clearDraftUnderlyingCallsCount = 0 + private nonisolated(unsafe) var clearDraftUnderlyingCallsCount = 0 var clearDraftCallsCount: Int { get { clearDraftCallsCountLock.withLock { clearDraftUnderlyingCallsCount } } set { clearDraftCallsCountLock.withLock { clearDraftUnderlyingCallsCount = newValue } } @@ -4454,14 +4454,14 @@ class ComposerDraftServiceMock: ComposerDraftServiceProtocol, @unchecked Sendabl } private let clearDraftReturnValueLock = NSLock() - private var clearDraftUnderlyingReturnValue: Result! + private nonisolated(unsafe) var clearDraftUnderlyingReturnValue: Result! var clearDraftReturnValue: Result! { get { clearDraftReturnValueLock.withLock { clearDraftUnderlyingReturnValue } } set { clearDraftReturnValueLock.withLock { clearDraftUnderlyingReturnValue = newValue } } } - var clearDraftClosure: (() async -> Result)? + nonisolated(unsafe) var clearDraftClosure: (() async -> Result)? - func clearDraft() async -> Result { + @concurrent func clearDraft() async -> Result { clearDraftCallsCountLock.withLock { clearDraftUnderlyingCallsCount += 1 } if let clearDraftClosure = clearDraftClosure { return await clearDraftClosure() @@ -4472,7 +4472,7 @@ class ComposerDraftServiceMock: ComposerDraftServiceProtocol, @unchecked Sendabl //MARK: - clearVolatileDraft private let clearVolatileDraftCallsCountLock = NSLock() - private var clearVolatileDraftUnderlyingCallsCount = 0 + private nonisolated(unsafe) var clearVolatileDraftUnderlyingCallsCount = 0 var clearVolatileDraftCallsCount: Int { get { clearVolatileDraftCallsCountLock.withLock { clearVolatileDraftUnderlyingCallsCount } } set { clearVolatileDraftCallsCountLock.withLock { clearVolatileDraftUnderlyingCallsCount = newValue } } @@ -4480,7 +4480,7 @@ class ComposerDraftServiceMock: ComposerDraftServiceProtocol, @unchecked Sendabl var clearVolatileDraftCalled: Bool { return clearVolatileDraftCallsCount > 0 } - var clearVolatileDraftClosure: (() -> Void)? + nonisolated(unsafe) var clearVolatileDraftClosure: (() -> Void)? func clearVolatileDraft() { clearVolatileDraftCallsCountLock.withLock { clearVolatileDraftUnderlyingCallsCount += 1 } @@ -4489,7 +4489,7 @@ class ComposerDraftServiceMock: ComposerDraftServiceProtocol, @unchecked Sendabl //MARK: - getReply private let getReplyEventIDCallsCountLock = NSLock() - private var getReplyEventIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var getReplyEventIDUnderlyingCallsCount = 0 var getReplyEventIDCallsCount: Int { get { getReplyEventIDCallsCountLock.withLock { getReplyEventIDUnderlyingCallsCount } } set { getReplyEventIDCallsCountLock.withLock { getReplyEventIDUnderlyingCallsCount = newValue } } @@ -4498,27 +4498,27 @@ class ComposerDraftServiceMock: ComposerDraftServiceProtocol, @unchecked Sendabl return getReplyEventIDCallsCount > 0 } private let getReplyEventIDReceivedEventIDLock = NSLock() - private var getReplyEventIDUnderlyingReceivedEventID: String? + private nonisolated(unsafe) var getReplyEventIDUnderlyingReceivedEventID: String? var getReplyEventIDReceivedEventID: String? { get { getReplyEventIDReceivedEventIDLock.withLock { getReplyEventIDUnderlyingReceivedEventID } } set { getReplyEventIDReceivedEventIDLock.withLock { getReplyEventIDUnderlyingReceivedEventID = newValue } } } private let getReplyEventIDReceivedInvocationsLock = NSLock() - private var getReplyEventIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var getReplyEventIDUnderlyingReceivedInvocations: [String] = [] var getReplyEventIDReceivedInvocations: [String] { get { getReplyEventIDReceivedInvocationsLock.withLock { getReplyEventIDUnderlyingReceivedInvocations } } set { getReplyEventIDReceivedInvocationsLock.withLock { getReplyEventIDUnderlyingReceivedInvocations = newValue } } } private let getReplyEventIDReturnValueLock = NSLock() - private var getReplyEventIDUnderlyingReturnValue: Result! + private nonisolated(unsafe) var getReplyEventIDUnderlyingReturnValue: Result! var getReplyEventIDReturnValue: Result! { get { getReplyEventIDReturnValueLock.withLock { getReplyEventIDUnderlyingReturnValue } } set { getReplyEventIDReturnValueLock.withLock { getReplyEventIDUnderlyingReturnValue = newValue } } } - var getReplyEventIDClosure: ((String) async -> Result)? + nonisolated(unsafe) var getReplyEventIDClosure: ((String) async -> Result)? - func getReply(eventID: String) async -> Result { + @concurrent func getReply(eventID: String) async -> Result { getReplyEventIDCallsCountLock.withLock { getReplyEventIDUnderlyingCallsCount += 1 } getReplyEventIDReceivedEventID = eventID getReplyEventIDReceivedInvocationsLock.withLock { getReplyEventIDUnderlyingReceivedInvocations.append(eventID) } @@ -4529,22 +4529,22 @@ class ComposerDraftServiceMock: ComposerDraftServiceProtocol, @unchecked Sendabl } } } -class ElementCallServiceMock: ElementCallServiceProtocol, @unchecked Sendable { +nonisolated class ElementCallServiceMock: ElementCallServiceProtocol, @unchecked Sendable { var actions: AnyPublisher { get { return underlyingActions } set(value) { underlyingActions = value } } - var underlyingActions: AnyPublisher! + nonisolated(unsafe) var underlyingActions: AnyPublisher! var ongoingCallRoomIDPublisher: CurrentValuePublisher { get { return underlyingOngoingCallRoomIDPublisher } set(value) { underlyingOngoingCallRoomIDPublisher = value } } - var underlyingOngoingCallRoomIDPublisher: CurrentValuePublisher! + nonisolated(unsafe) var underlyingOngoingCallRoomIDPublisher: CurrentValuePublisher! //MARK: - setClientProxy private let setClientProxyCallsCountLock = NSLock() - private var setClientProxyUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setClientProxyUnderlyingCallsCount = 0 var setClientProxyCallsCount: Int { get { setClientProxyCallsCountLock.withLock { setClientProxyUnderlyingCallsCount } } set { setClientProxyCallsCountLock.withLock { setClientProxyUnderlyingCallsCount = newValue } } @@ -4553,18 +4553,18 @@ class ElementCallServiceMock: ElementCallServiceProtocol, @unchecked Sendable { return setClientProxyCallsCount > 0 } private let setClientProxyReceivedClientProxyLock = NSLock() - private var setClientProxyUnderlyingReceivedClientProxy: ClientProxyProtocol? + private nonisolated(unsafe) var setClientProxyUnderlyingReceivedClientProxy: ClientProxyProtocol? var setClientProxyReceivedClientProxy: ClientProxyProtocol? { get { setClientProxyReceivedClientProxyLock.withLock { setClientProxyUnderlyingReceivedClientProxy } } set { setClientProxyReceivedClientProxyLock.withLock { setClientProxyUnderlyingReceivedClientProxy = newValue } } } private let setClientProxyReceivedInvocationsLock = NSLock() - private var setClientProxyUnderlyingReceivedInvocations: [ClientProxyProtocol] = [] + private nonisolated(unsafe) var setClientProxyUnderlyingReceivedInvocations: [ClientProxyProtocol] = [] var setClientProxyReceivedInvocations: [ClientProxyProtocol] { get { setClientProxyReceivedInvocationsLock.withLock { setClientProxyUnderlyingReceivedInvocations } } set { setClientProxyReceivedInvocationsLock.withLock { setClientProxyUnderlyingReceivedInvocations = newValue } } } - var setClientProxyClosure: ((ClientProxyProtocol) -> Void)? + nonisolated(unsafe) var setClientProxyClosure: ((ClientProxyProtocol) -> Void)? func setClientProxy(_ clientProxy: ClientProxyProtocol) { setClientProxyCallsCountLock.withLock { setClientProxyUnderlyingCallsCount += 1 } @@ -4575,7 +4575,7 @@ class ElementCallServiceMock: ElementCallServiceProtocol, @unchecked Sendable { //MARK: - setupCallSession private let setupCallSessionRoomIDRoomDisplayNameCallsCountLock = NSLock() - private var setupCallSessionRoomIDRoomDisplayNameUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setupCallSessionRoomIDRoomDisplayNameUnderlyingCallsCount = 0 var setupCallSessionRoomIDRoomDisplayNameCallsCount: Int { get { setupCallSessionRoomIDRoomDisplayNameCallsCountLock.withLock { setupCallSessionRoomIDRoomDisplayNameUnderlyingCallsCount } } set { setupCallSessionRoomIDRoomDisplayNameCallsCountLock.withLock { setupCallSessionRoomIDRoomDisplayNameUnderlyingCallsCount = newValue } } @@ -4584,20 +4584,20 @@ class ElementCallServiceMock: ElementCallServiceProtocol, @unchecked Sendable { return setupCallSessionRoomIDRoomDisplayNameCallsCount > 0 } private let setupCallSessionRoomIDRoomDisplayNameReceivedArgumentsLock = NSLock() - private var setupCallSessionRoomIDRoomDisplayNameUnderlyingReceivedArguments: (roomID: String, roomDisplayName: String)? + private nonisolated(unsafe) var setupCallSessionRoomIDRoomDisplayNameUnderlyingReceivedArguments: (roomID: String, roomDisplayName: String)? var setupCallSessionRoomIDRoomDisplayNameReceivedArguments: (roomID: String, roomDisplayName: String)? { get { setupCallSessionRoomIDRoomDisplayNameReceivedArgumentsLock.withLock { setupCallSessionRoomIDRoomDisplayNameUnderlyingReceivedArguments } } set { setupCallSessionRoomIDRoomDisplayNameReceivedArgumentsLock.withLock { setupCallSessionRoomIDRoomDisplayNameUnderlyingReceivedArguments = newValue } } } private let setupCallSessionRoomIDRoomDisplayNameReceivedInvocationsLock = NSLock() - private var setupCallSessionRoomIDRoomDisplayNameUnderlyingReceivedInvocations: [(roomID: String, roomDisplayName: String)] = [] + private nonisolated(unsafe) var setupCallSessionRoomIDRoomDisplayNameUnderlyingReceivedInvocations: [(roomID: String, roomDisplayName: String)] = [] var setupCallSessionRoomIDRoomDisplayNameReceivedInvocations: [(roomID: String, roomDisplayName: String)] { get { setupCallSessionRoomIDRoomDisplayNameReceivedInvocationsLock.withLock { setupCallSessionRoomIDRoomDisplayNameUnderlyingReceivedInvocations } } set { setupCallSessionRoomIDRoomDisplayNameReceivedInvocationsLock.withLock { setupCallSessionRoomIDRoomDisplayNameUnderlyingReceivedInvocations = newValue } } } - var setupCallSessionRoomIDRoomDisplayNameClosure: ((String, String) async -> Void)? + nonisolated(unsafe) var setupCallSessionRoomIDRoomDisplayNameClosure: ((String, String) async -> Void)? - func setupCallSession(roomID: String, roomDisplayName: String) async { + @concurrent func setupCallSession(roomID: String, roomDisplayName: String) async { setupCallSessionRoomIDRoomDisplayNameCallsCountLock.withLock { setupCallSessionRoomIDRoomDisplayNameUnderlyingCallsCount += 1 } setupCallSessionRoomIDRoomDisplayNameReceivedArguments = (roomID: roomID, roomDisplayName: roomDisplayName) setupCallSessionRoomIDRoomDisplayNameReceivedInvocationsLock.withLock { setupCallSessionRoomIDRoomDisplayNameUnderlyingReceivedInvocations.append((roomID: roomID, roomDisplayName: roomDisplayName)) } @@ -4606,7 +4606,7 @@ class ElementCallServiceMock: ElementCallServiceProtocol, @unchecked Sendable { //MARK: - tearDownCallSession private let tearDownCallSessionCallsCountLock = NSLock() - private var tearDownCallSessionUnderlyingCallsCount = 0 + private nonisolated(unsafe) var tearDownCallSessionUnderlyingCallsCount = 0 var tearDownCallSessionCallsCount: Int { get { tearDownCallSessionCallsCountLock.withLock { tearDownCallSessionUnderlyingCallsCount } } set { tearDownCallSessionCallsCountLock.withLock { tearDownCallSessionUnderlyingCallsCount = newValue } } @@ -4614,7 +4614,7 @@ class ElementCallServiceMock: ElementCallServiceProtocol, @unchecked Sendable { var tearDownCallSessionCalled: Bool { return tearDownCallSessionCallsCount > 0 } - var tearDownCallSessionClosure: (() -> Void)? + nonisolated(unsafe) var tearDownCallSessionClosure: (() -> Void)? func tearDownCallSession() { tearDownCallSessionCallsCountLock.withLock { tearDownCallSessionUnderlyingCallsCount += 1 } @@ -4623,7 +4623,7 @@ class ElementCallServiceMock: ElementCallServiceProtocol, @unchecked Sendable { //MARK: - setAudioEnabled private let setAudioEnabledRoomIDCallsCountLock = NSLock() - private var setAudioEnabledRoomIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setAudioEnabledRoomIDUnderlyingCallsCount = 0 var setAudioEnabledRoomIDCallsCount: Int { get { setAudioEnabledRoomIDCallsCountLock.withLock { setAudioEnabledRoomIDUnderlyingCallsCount } } set { setAudioEnabledRoomIDCallsCountLock.withLock { setAudioEnabledRoomIDUnderlyingCallsCount = newValue } } @@ -4632,18 +4632,18 @@ class ElementCallServiceMock: ElementCallServiceProtocol, @unchecked Sendable { return setAudioEnabledRoomIDCallsCount > 0 } private let setAudioEnabledRoomIDReceivedArgumentsLock = NSLock() - private var setAudioEnabledRoomIDUnderlyingReceivedArguments: (enabled: Bool, roomID: String)? + private nonisolated(unsafe) var setAudioEnabledRoomIDUnderlyingReceivedArguments: (enabled: Bool, roomID: String)? var setAudioEnabledRoomIDReceivedArguments: (enabled: Bool, roomID: String)? { get { setAudioEnabledRoomIDReceivedArgumentsLock.withLock { setAudioEnabledRoomIDUnderlyingReceivedArguments } } set { setAudioEnabledRoomIDReceivedArgumentsLock.withLock { setAudioEnabledRoomIDUnderlyingReceivedArguments = newValue } } } private let setAudioEnabledRoomIDReceivedInvocationsLock = NSLock() - private var setAudioEnabledRoomIDUnderlyingReceivedInvocations: [(enabled: Bool, roomID: String)] = [] + private nonisolated(unsafe) var setAudioEnabledRoomIDUnderlyingReceivedInvocations: [(enabled: Bool, roomID: String)] = [] var setAudioEnabledRoomIDReceivedInvocations: [(enabled: Bool, roomID: String)] { get { setAudioEnabledRoomIDReceivedInvocationsLock.withLock { setAudioEnabledRoomIDUnderlyingReceivedInvocations } } set { setAudioEnabledRoomIDReceivedInvocationsLock.withLock { setAudioEnabledRoomIDUnderlyingReceivedInvocations = newValue } } } - var setAudioEnabledRoomIDClosure: ((Bool, String) -> Void)? + nonisolated(unsafe) var setAudioEnabledRoomIDClosure: ((Bool, String) -> Void)? func setAudioEnabled(_ enabled: Bool, roomID: String) { setAudioEnabledRoomIDCallsCountLock.withLock { setAudioEnabledRoomIDUnderlyingCallsCount += 1 } @@ -4652,27 +4652,27 @@ class ElementCallServiceMock: ElementCallServiceProtocol, @unchecked Sendable { setAudioEnabledRoomIDClosure?(enabled, roomID) } } -class ElementCallWidgetDriverMock: ElementCallWidgetDriverProtocol, @unchecked Sendable { +nonisolated class ElementCallWidgetDriverMock: ElementCallWidgetDriverProtocol, @unchecked Sendable { var widgetID: String { get { return underlyingWidgetID } set(value) { underlyingWidgetID = value } } - var underlyingWidgetID: String! + nonisolated(unsafe) var underlyingWidgetID: String! var messagePublisher: PassthroughSubject { get { return underlyingMessagePublisher } set(value) { underlyingMessagePublisher = value } } - var underlyingMessagePublisher: PassthroughSubject! + nonisolated(unsafe) var underlyingMessagePublisher: PassthroughSubject! var actions: AnyPublisher { get { return underlyingActions } set(value) { underlyingActions = value } } - var underlyingActions: AnyPublisher! + nonisolated(unsafe) var underlyingActions: AnyPublisher! //MARK: - start private let startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationCallsCountLock = NSLock() - private var startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationUnderlyingCallsCount = 0 + private nonisolated(unsafe) var startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationUnderlyingCallsCount = 0 var startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationCallsCount: Int { get { startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationCallsCountLock.withLock { startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationUnderlyingCallsCount } } set { startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationCallsCountLock.withLock { startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationUnderlyingCallsCount = newValue } } @@ -4681,27 +4681,27 @@ class ElementCallWidgetDriverMock: ElementCallWidgetDriverProtocol, @unchecked S return startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationCallsCount > 0 } private let startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationReceivedArgumentsLock = NSLock() - private var startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationUnderlyingReceivedArguments: (baseURL: URL, clientID: String, colorScheme: ColorScheme, voiceOnly: Bool, rageshakeURL: String?, analyticsConfiguration: ElementCallAnalyticsConfiguration?)? + private nonisolated(unsafe) var startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationUnderlyingReceivedArguments: (baseURL: URL, clientID: String, colorScheme: ColorScheme, voiceOnly: Bool, rageshakeURL: String?, analyticsConfiguration: ElementCallAnalyticsConfiguration?)? var startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationReceivedArguments: (baseURL: URL, clientID: String, colorScheme: ColorScheme, voiceOnly: Bool, rageshakeURL: String?, analyticsConfiguration: ElementCallAnalyticsConfiguration?)? { get { startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationReceivedArgumentsLock.withLock { startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationUnderlyingReceivedArguments } } set { startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationReceivedArgumentsLock.withLock { startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationUnderlyingReceivedArguments = newValue } } } private let startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationReceivedInvocationsLock = NSLock() - private var startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationUnderlyingReceivedInvocations: [(baseURL: URL, clientID: String, colorScheme: ColorScheme, voiceOnly: Bool, rageshakeURL: String?, analyticsConfiguration: ElementCallAnalyticsConfiguration?)] = [] + private nonisolated(unsafe) var startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationUnderlyingReceivedInvocations: [(baseURL: URL, clientID: String, colorScheme: ColorScheme, voiceOnly: Bool, rageshakeURL: String?, analyticsConfiguration: ElementCallAnalyticsConfiguration?)] = [] var startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationReceivedInvocations: [(baseURL: URL, clientID: String, colorScheme: ColorScheme, voiceOnly: Bool, rageshakeURL: String?, analyticsConfiguration: ElementCallAnalyticsConfiguration?)] { get { startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationReceivedInvocationsLock.withLock { startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationUnderlyingReceivedInvocations } } set { startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationReceivedInvocationsLock.withLock { startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationUnderlyingReceivedInvocations = newValue } } } private let startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationReturnValueLock = NSLock() - private var startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationUnderlyingReturnValue: Result! + private nonisolated(unsafe) var startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationUnderlyingReturnValue: Result! var startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationReturnValue: Result! { get { startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationReturnValueLock.withLock { startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationUnderlyingReturnValue } } set { startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationReturnValueLock.withLock { startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationUnderlyingReturnValue = newValue } } } - var startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationClosure: ((URL, String, ColorScheme, Bool, String?, ElementCallAnalyticsConfiguration?) async -> Result)? + nonisolated(unsafe) var startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationClosure: ((URL, String, ColorScheme, Bool, String?, ElementCallAnalyticsConfiguration?) async -> Result)? - func start(baseURL: URL, clientID: String, colorScheme: ColorScheme, voiceOnly: Bool, rageshakeURL: String?, analyticsConfiguration: ElementCallAnalyticsConfiguration?) async -> Result { + @concurrent func start(baseURL: URL, clientID: String, colorScheme: ColorScheme, voiceOnly: Bool, rageshakeURL: String?, analyticsConfiguration: ElementCallAnalyticsConfiguration?) async -> Result { startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationCallsCountLock.withLock { startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationUnderlyingCallsCount += 1 } startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationReceivedArguments = (baseURL: baseURL, clientID: clientID, colorScheme: colorScheme, voiceOnly: voiceOnly, rageshakeURL: rageshakeURL, analyticsConfiguration: analyticsConfiguration) startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationReceivedInvocationsLock.withLock { startBaseURLClientIDColorSchemeVoiceOnlyRageshakeURLAnalyticsConfigurationUnderlyingReceivedInvocations.append((baseURL: baseURL, clientID: clientID, colorScheme: colorScheme, voiceOnly: voiceOnly, rageshakeURL: rageshakeURL, analyticsConfiguration: analyticsConfiguration)) } @@ -4714,7 +4714,7 @@ class ElementCallWidgetDriverMock: ElementCallWidgetDriverProtocol, @unchecked S //MARK: - handleMessage private let handleMessageCallsCountLock = NSLock() - private var handleMessageUnderlyingCallsCount = 0 + private nonisolated(unsafe) var handleMessageUnderlyingCallsCount = 0 var handleMessageCallsCount: Int { get { handleMessageCallsCountLock.withLock { handleMessageUnderlyingCallsCount } } set { handleMessageCallsCountLock.withLock { handleMessageUnderlyingCallsCount = newValue } } @@ -4723,28 +4723,28 @@ class ElementCallWidgetDriverMock: ElementCallWidgetDriverProtocol, @unchecked S return handleMessageCallsCount > 0 } private let handleMessageReceivedMessageLock = NSLock() - private var handleMessageUnderlyingReceivedMessage: String? + private nonisolated(unsafe) var handleMessageUnderlyingReceivedMessage: String? var handleMessageReceivedMessage: String? { get { handleMessageReceivedMessageLock.withLock { handleMessageUnderlyingReceivedMessage } } set { handleMessageReceivedMessageLock.withLock { handleMessageUnderlyingReceivedMessage = newValue } } } private let handleMessageReceivedInvocationsLock = NSLock() - private var handleMessageUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var handleMessageUnderlyingReceivedInvocations: [String] = [] var handleMessageReceivedInvocations: [String] { get { handleMessageReceivedInvocationsLock.withLock { handleMessageUnderlyingReceivedInvocations } } set { handleMessageReceivedInvocationsLock.withLock { handleMessageUnderlyingReceivedInvocations = newValue } } } private let handleMessageReturnValueLock = NSLock() - private var handleMessageUnderlyingReturnValue: Result! + private nonisolated(unsafe) var handleMessageUnderlyingReturnValue: Result! var handleMessageReturnValue: Result! { get { handleMessageReturnValueLock.withLock { handleMessageUnderlyingReturnValue } } set { handleMessageReturnValueLock.withLock { handleMessageUnderlyingReturnValue = newValue } } } - var handleMessageClosure: ((String) async -> Result)? + nonisolated(unsafe) var handleMessageClosure: ((String) async -> Result)? @discardableResult - func handleMessage(_ message: String) async -> Result { + @concurrent func handleMessage(_ message: String) async -> Result { handleMessageCallsCountLock.withLock { handleMessageUnderlyingCallsCount += 1 } handleMessageReceivedMessage = message handleMessageReceivedInvocationsLock.withLock { handleMessageUnderlyingReceivedInvocations.append(message) } @@ -4755,12 +4755,12 @@ class ElementCallWidgetDriverMock: ElementCallWidgetDriverProtocol, @unchecked S } } } -class HomeserverCapabilitiesProxyMock: HomeserverCapabilitiesProxyProtocol, @unchecked Sendable { +nonisolated class HomeserverCapabilitiesProxyMock: HomeserverCapabilitiesProxyProtocol, @unchecked Sendable { //MARK: - refresh private let refreshCallsCountLock = NSLock() - private var refreshUnderlyingCallsCount = 0 + private nonisolated(unsafe) var refreshUnderlyingCallsCount = 0 var refreshCallsCount: Int { get { refreshCallsCountLock.withLock { refreshUnderlyingCallsCount } } set { refreshCallsCountLock.withLock { refreshUnderlyingCallsCount = newValue } } @@ -4768,16 +4768,16 @@ class HomeserverCapabilitiesProxyMock: HomeserverCapabilitiesProxyProtocol, @unc var refreshCalled: Bool { return refreshCallsCount > 0 } - var refreshClosure: (() async -> Void)? + nonisolated(unsafe) var refreshClosure: (() async -> Void)? - func refresh() async { + @concurrent func refresh() async { refreshCallsCountLock.withLock { refreshUnderlyingCallsCount += 1 } await refreshClosure?() } //MARK: - canChangeAvatar private let canChangeAvatarCallsCountLock = NSLock() - private var canChangeAvatarUnderlyingCallsCount = 0 + private nonisolated(unsafe) var canChangeAvatarUnderlyingCallsCount = 0 var canChangeAvatarCallsCount: Int { get { canChangeAvatarCallsCountLock.withLock { canChangeAvatarUnderlyingCallsCount } } set { canChangeAvatarCallsCountLock.withLock { canChangeAvatarUnderlyingCallsCount = newValue } } @@ -4787,14 +4787,14 @@ class HomeserverCapabilitiesProxyMock: HomeserverCapabilitiesProxyProtocol, @unc } private let canChangeAvatarReturnValueLock = NSLock() - private var canChangeAvatarUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var canChangeAvatarUnderlyingReturnValue: Bool! var canChangeAvatarReturnValue: Bool! { get { canChangeAvatarReturnValueLock.withLock { canChangeAvatarUnderlyingReturnValue } } set { canChangeAvatarReturnValueLock.withLock { canChangeAvatarUnderlyingReturnValue = newValue } } } - var canChangeAvatarClosure: (() async -> Bool)? + nonisolated(unsafe) var canChangeAvatarClosure: (() async -> Bool)? - func canChangeAvatar() async -> Bool { + @concurrent func canChangeAvatar() async -> Bool { canChangeAvatarCallsCountLock.withLock { canChangeAvatarUnderlyingCallsCount += 1 } if let canChangeAvatarClosure = canChangeAvatarClosure { return await canChangeAvatarClosure() @@ -4805,7 +4805,7 @@ class HomeserverCapabilitiesProxyMock: HomeserverCapabilitiesProxyProtocol, @unc //MARK: - canChangeDisplayName private let canChangeDisplayNameCallsCountLock = NSLock() - private var canChangeDisplayNameUnderlyingCallsCount = 0 + private nonisolated(unsafe) var canChangeDisplayNameUnderlyingCallsCount = 0 var canChangeDisplayNameCallsCount: Int { get { canChangeDisplayNameCallsCountLock.withLock { canChangeDisplayNameUnderlyingCallsCount } } set { canChangeDisplayNameCallsCountLock.withLock { canChangeDisplayNameUnderlyingCallsCount = newValue } } @@ -4815,14 +4815,14 @@ class HomeserverCapabilitiesProxyMock: HomeserverCapabilitiesProxyProtocol, @unc } private let canChangeDisplayNameReturnValueLock = NSLock() - private var canChangeDisplayNameUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var canChangeDisplayNameUnderlyingReturnValue: Bool! var canChangeDisplayNameReturnValue: Bool! { get { canChangeDisplayNameReturnValueLock.withLock { canChangeDisplayNameUnderlyingReturnValue } } set { canChangeDisplayNameReturnValueLock.withLock { canChangeDisplayNameUnderlyingReturnValue = newValue } } } - var canChangeDisplayNameClosure: (() async -> Bool)? + nonisolated(unsafe) var canChangeDisplayNameClosure: (() async -> Bool)? - func canChangeDisplayName() async -> Bool { + @concurrent func canChangeDisplayName() async -> Bool { canChangeDisplayNameCallsCountLock.withLock { canChangeDisplayNameUnderlyingCallsCount += 1 } if let canChangeDisplayNameClosure = canChangeDisplayNameClosure { return await canChangeDisplayNameClosure() @@ -4831,28 +4831,28 @@ class HomeserverCapabilitiesProxyMock: HomeserverCapabilitiesProxyProtocol, @unc } } } -class InvitedRoomProxyMock: InvitedRoomProxyProtocol, @unchecked Sendable { +nonisolated class InvitedRoomProxyMock: InvitedRoomProxyProtocol, @unchecked Sendable { var info: BaseRoomInfoProxyProtocol { get { return underlyingInfo } set(value) { underlyingInfo = value } } - var underlyingInfo: BaseRoomInfoProxyProtocol! - var inviter: RoomMemberProxyProtocol? + nonisolated(unsafe) var underlyingInfo: BaseRoomInfoProxyProtocol! + nonisolated(unsafe) var inviter: RoomMemberProxyProtocol? var id: String { get { return underlyingId } set(value) { underlyingId = value } } - var underlyingId: String! + nonisolated(unsafe) var underlyingId: String! var ownUserID: String { get { return underlyingOwnUserID } set(value) { underlyingOwnUserID = value } } - var underlyingOwnUserID: String! + nonisolated(unsafe) var underlyingOwnUserID: String! //MARK: - rejectInvitation private let rejectInvitationCallsCountLock = NSLock() - private var rejectInvitationUnderlyingCallsCount = 0 + private nonisolated(unsafe) var rejectInvitationUnderlyingCallsCount = 0 var rejectInvitationCallsCount: Int { get { rejectInvitationCallsCountLock.withLock { rejectInvitationUnderlyingCallsCount } } set { rejectInvitationCallsCountLock.withLock { rejectInvitationUnderlyingCallsCount = newValue } } @@ -4862,14 +4862,14 @@ class InvitedRoomProxyMock: InvitedRoomProxyProtocol, @unchecked Sendable { } private let rejectInvitationReturnValueLock = NSLock() - private var rejectInvitationUnderlyingReturnValue: Result! + private nonisolated(unsafe) var rejectInvitationUnderlyingReturnValue: Result! var rejectInvitationReturnValue: Result! { get { rejectInvitationReturnValueLock.withLock { rejectInvitationUnderlyingReturnValue } } set { rejectInvitationReturnValueLock.withLock { rejectInvitationUnderlyingReturnValue = newValue } } } - var rejectInvitationClosure: (() async -> Result)? + nonisolated(unsafe) var rejectInvitationClosure: (() async -> Result)? - func rejectInvitation() async -> Result { + @concurrent func rejectInvitation() async -> Result { rejectInvitationCallsCountLock.withLock { rejectInvitationUnderlyingCallsCount += 1 } if let rejectInvitationClosure = rejectInvitationClosure { return await rejectInvitationClosure() @@ -4878,54 +4878,54 @@ class InvitedRoomProxyMock: InvitedRoomProxyProtocol, @unchecked Sendable { } } } -class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { +nonisolated class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { var infoPublisher: CurrentValuePublisher { get { return underlyingInfoPublisher } set(value) { underlyingInfoPublisher = value } } - var underlyingInfoPublisher: CurrentValuePublisher! + nonisolated(unsafe) var underlyingInfoPublisher: CurrentValuePublisher! var membersPublisher: CurrentValuePublisher<[RoomMemberProxyProtocol], Never> { get { return underlyingMembersPublisher } set(value) { underlyingMembersPublisher = value } } - var underlyingMembersPublisher: CurrentValuePublisher<[RoomMemberProxyProtocol], Never>! + nonisolated(unsafe) var underlyingMembersPublisher: CurrentValuePublisher<[RoomMemberProxyProtocol], Never>! var typingMembersPublisher: CurrentValuePublisher<[String], Never> { get { return underlyingTypingMembersPublisher } set(value) { underlyingTypingMembersPublisher = value } } - var underlyingTypingMembersPublisher: CurrentValuePublisher<[String], Never>! + nonisolated(unsafe) var underlyingTypingMembersPublisher: CurrentValuePublisher<[String], Never>! var identityStatusChangesPublisher: CurrentValuePublisher<[IdentityStatusChange], Never> { get { return underlyingIdentityStatusChangesPublisher } set(value) { underlyingIdentityStatusChangesPublisher = value } } - var underlyingIdentityStatusChangesPublisher: CurrentValuePublisher<[IdentityStatusChange], Never>! + nonisolated(unsafe) var underlyingIdentityStatusChangesPublisher: CurrentValuePublisher<[IdentityStatusChange], Never>! var knockRequestsStatePublisher: CurrentValuePublisher { get { return underlyingKnockRequestsStatePublisher } set(value) { underlyingKnockRequestsStatePublisher = value } } - var underlyingKnockRequestsStatePublisher: CurrentValuePublisher! + nonisolated(unsafe) var underlyingKnockRequestsStatePublisher: CurrentValuePublisher! var timeline: TimelineProxyProtocol { get { return underlyingTimeline } set(value) { underlyingTimeline = value } } - var underlyingTimeline: TimelineProxyProtocol! - var predecessorRoom: PredecessorRoom? - var successorRoom: SuccessorRoom? + nonisolated(unsafe) var underlyingTimeline: TimelineProxyProtocol! + nonisolated(unsafe) var predecessorRoom: PredecessorRoom? + nonisolated(unsafe) var successorRoom: SuccessorRoom? var id: String { get { return underlyingId } set(value) { underlyingId = value } } - var underlyingId: String! + nonisolated(unsafe) var underlyingId: String! var ownUserID: String { get { return underlyingOwnUserID } set(value) { underlyingOwnUserID = value } } - var underlyingOwnUserID: String! + nonisolated(unsafe) var underlyingOwnUserID: String! //MARK: - subscribeForUpdates private let subscribeForUpdatesCallsCountLock = NSLock() - private var subscribeForUpdatesUnderlyingCallsCount = 0 + private nonisolated(unsafe) var subscribeForUpdatesUnderlyingCallsCount = 0 var subscribeForUpdatesCallsCount: Int { get { subscribeForUpdatesCallsCountLock.withLock { subscribeForUpdatesUnderlyingCallsCount } } set { subscribeForUpdatesCallsCountLock.withLock { subscribeForUpdatesUnderlyingCallsCount = newValue } } @@ -4933,16 +4933,16 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { var subscribeForUpdatesCalled: Bool { return subscribeForUpdatesCallsCount > 0 } - var subscribeForUpdatesClosure: (() async -> Void)? + nonisolated(unsafe) var subscribeForUpdatesClosure: (() async -> Void)? - func subscribeForUpdates() async { + @concurrent func subscribeForUpdates() async { subscribeForUpdatesCallsCountLock.withLock { subscribeForUpdatesUnderlyingCallsCount += 1 } await subscribeForUpdatesClosure?() } //MARK: - subscribeToRoomInfoUpdates private let subscribeToRoomInfoUpdatesCallsCountLock = NSLock() - private var subscribeToRoomInfoUpdatesUnderlyingCallsCount = 0 + private nonisolated(unsafe) var subscribeToRoomInfoUpdatesUnderlyingCallsCount = 0 var subscribeToRoomInfoUpdatesCallsCount: Int { get { subscribeToRoomInfoUpdatesCallsCountLock.withLock { subscribeToRoomInfoUpdatesUnderlyingCallsCount } } set { subscribeToRoomInfoUpdatesCallsCountLock.withLock { subscribeToRoomInfoUpdatesUnderlyingCallsCount = newValue } } @@ -4950,7 +4950,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { var subscribeToRoomInfoUpdatesCalled: Bool { return subscribeToRoomInfoUpdatesCallsCount > 0 } - var subscribeToRoomInfoUpdatesClosure: (() -> Void)? + nonisolated(unsafe) var subscribeToRoomInfoUpdatesClosure: (() -> Void)? func subscribeToRoomInfoUpdates() { subscribeToRoomInfoUpdatesCallsCountLock.withLock { subscribeToRoomInfoUpdatesUnderlyingCallsCount += 1 } @@ -4959,7 +4959,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - timelineFocusedOnEvent private let timelineFocusedOnEventEventIDNumberOfEventsCallsCountLock = NSLock() - private var timelineFocusedOnEventEventIDNumberOfEventsUnderlyingCallsCount = 0 + private nonisolated(unsafe) var timelineFocusedOnEventEventIDNumberOfEventsUnderlyingCallsCount = 0 var timelineFocusedOnEventEventIDNumberOfEventsCallsCount: Int { get { timelineFocusedOnEventEventIDNumberOfEventsCallsCountLock.withLock { timelineFocusedOnEventEventIDNumberOfEventsUnderlyingCallsCount } } set { timelineFocusedOnEventEventIDNumberOfEventsCallsCountLock.withLock { timelineFocusedOnEventEventIDNumberOfEventsUnderlyingCallsCount = newValue } } @@ -4968,27 +4968,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return timelineFocusedOnEventEventIDNumberOfEventsCallsCount > 0 } private let timelineFocusedOnEventEventIDNumberOfEventsReceivedArgumentsLock = NSLock() - private var timelineFocusedOnEventEventIDNumberOfEventsUnderlyingReceivedArguments: (eventID: String, numberOfEvents: UInt16)? + private nonisolated(unsafe) var timelineFocusedOnEventEventIDNumberOfEventsUnderlyingReceivedArguments: (eventID: String, numberOfEvents: UInt16)? var timelineFocusedOnEventEventIDNumberOfEventsReceivedArguments: (eventID: String, numberOfEvents: UInt16)? { get { timelineFocusedOnEventEventIDNumberOfEventsReceivedArgumentsLock.withLock { timelineFocusedOnEventEventIDNumberOfEventsUnderlyingReceivedArguments } } set { timelineFocusedOnEventEventIDNumberOfEventsReceivedArgumentsLock.withLock { timelineFocusedOnEventEventIDNumberOfEventsUnderlyingReceivedArguments = newValue } } } private let timelineFocusedOnEventEventIDNumberOfEventsReceivedInvocationsLock = NSLock() - private var timelineFocusedOnEventEventIDNumberOfEventsUnderlyingReceivedInvocations: [(eventID: String, numberOfEvents: UInt16)] = [] + private nonisolated(unsafe) var timelineFocusedOnEventEventIDNumberOfEventsUnderlyingReceivedInvocations: [(eventID: String, numberOfEvents: UInt16)] = [] var timelineFocusedOnEventEventIDNumberOfEventsReceivedInvocations: [(eventID: String, numberOfEvents: UInt16)] { get { timelineFocusedOnEventEventIDNumberOfEventsReceivedInvocationsLock.withLock { timelineFocusedOnEventEventIDNumberOfEventsUnderlyingReceivedInvocations } } set { timelineFocusedOnEventEventIDNumberOfEventsReceivedInvocationsLock.withLock { timelineFocusedOnEventEventIDNumberOfEventsUnderlyingReceivedInvocations = newValue } } } private let timelineFocusedOnEventEventIDNumberOfEventsReturnValueLock = NSLock() - private var timelineFocusedOnEventEventIDNumberOfEventsUnderlyingReturnValue: Result! + private nonisolated(unsafe) var timelineFocusedOnEventEventIDNumberOfEventsUnderlyingReturnValue: Result! var timelineFocusedOnEventEventIDNumberOfEventsReturnValue: Result! { get { timelineFocusedOnEventEventIDNumberOfEventsReturnValueLock.withLock { timelineFocusedOnEventEventIDNumberOfEventsUnderlyingReturnValue } } set { timelineFocusedOnEventEventIDNumberOfEventsReturnValueLock.withLock { timelineFocusedOnEventEventIDNumberOfEventsUnderlyingReturnValue = newValue } } } - var timelineFocusedOnEventEventIDNumberOfEventsClosure: ((String, UInt16) async -> Result)? + nonisolated(unsafe) var timelineFocusedOnEventEventIDNumberOfEventsClosure: ((String, UInt16) async -> Result)? - func timelineFocusedOnEvent(eventID: String, numberOfEvents: UInt16) async -> Result { + @concurrent func timelineFocusedOnEvent(eventID: String, numberOfEvents: UInt16) async -> Result { timelineFocusedOnEventEventIDNumberOfEventsCallsCountLock.withLock { timelineFocusedOnEventEventIDNumberOfEventsUnderlyingCallsCount += 1 } timelineFocusedOnEventEventIDNumberOfEventsReceivedArguments = (eventID: eventID, numberOfEvents: numberOfEvents) timelineFocusedOnEventEventIDNumberOfEventsReceivedInvocationsLock.withLock { timelineFocusedOnEventEventIDNumberOfEventsUnderlyingReceivedInvocations.append((eventID: eventID, numberOfEvents: numberOfEvents)) } @@ -5001,7 +5001,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - threadTimeline private let threadTimelineEventIDCallsCountLock = NSLock() - private var threadTimelineEventIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var threadTimelineEventIDUnderlyingCallsCount = 0 var threadTimelineEventIDCallsCount: Int { get { threadTimelineEventIDCallsCountLock.withLock { threadTimelineEventIDUnderlyingCallsCount } } set { threadTimelineEventIDCallsCountLock.withLock { threadTimelineEventIDUnderlyingCallsCount = newValue } } @@ -5010,27 +5010,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return threadTimelineEventIDCallsCount > 0 } private let threadTimelineEventIDReceivedEventIDLock = NSLock() - private var threadTimelineEventIDUnderlyingReceivedEventID: String? + private nonisolated(unsafe) var threadTimelineEventIDUnderlyingReceivedEventID: String? var threadTimelineEventIDReceivedEventID: String? { get { threadTimelineEventIDReceivedEventIDLock.withLock { threadTimelineEventIDUnderlyingReceivedEventID } } set { threadTimelineEventIDReceivedEventIDLock.withLock { threadTimelineEventIDUnderlyingReceivedEventID = newValue } } } private let threadTimelineEventIDReceivedInvocationsLock = NSLock() - private var threadTimelineEventIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var threadTimelineEventIDUnderlyingReceivedInvocations: [String] = [] var threadTimelineEventIDReceivedInvocations: [String] { get { threadTimelineEventIDReceivedInvocationsLock.withLock { threadTimelineEventIDUnderlyingReceivedInvocations } } set { threadTimelineEventIDReceivedInvocationsLock.withLock { threadTimelineEventIDUnderlyingReceivedInvocations = newValue } } } private let threadTimelineEventIDReturnValueLock = NSLock() - private var threadTimelineEventIDUnderlyingReturnValue: Result! + private nonisolated(unsafe) var threadTimelineEventIDUnderlyingReturnValue: Result! var threadTimelineEventIDReturnValue: Result! { get { threadTimelineEventIDReturnValueLock.withLock { threadTimelineEventIDUnderlyingReturnValue } } set { threadTimelineEventIDReturnValueLock.withLock { threadTimelineEventIDUnderlyingReturnValue = newValue } } } - var threadTimelineEventIDClosure: ((String) async -> Result)? + nonisolated(unsafe) var threadTimelineEventIDClosure: ((String) async -> Result)? - func threadTimeline(eventID: String) async -> Result { + @concurrent func threadTimeline(eventID: String) async -> Result { threadTimelineEventIDCallsCountLock.withLock { threadTimelineEventIDUnderlyingCallsCount += 1 } threadTimelineEventIDReceivedEventID = eventID threadTimelineEventIDReceivedInvocationsLock.withLock { threadTimelineEventIDUnderlyingReceivedInvocations.append(eventID) } @@ -5043,7 +5043,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - threadListService private let threadListServiceCallsCountLock = NSLock() - private var threadListServiceUnderlyingCallsCount = 0 + private nonisolated(unsafe) var threadListServiceUnderlyingCallsCount = 0 var threadListServiceCallsCount: Int { get { threadListServiceCallsCountLock.withLock { threadListServiceUnderlyingCallsCount } } set { threadListServiceCallsCountLock.withLock { threadListServiceUnderlyingCallsCount = newValue } } @@ -5053,12 +5053,12 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { } private let threadListServiceReturnValueLock = NSLock() - private var threadListServiceUnderlyingReturnValue: RoomThreadListServiceProxyProtocol! + private nonisolated(unsafe) var threadListServiceUnderlyingReturnValue: RoomThreadListServiceProxyProtocol! var threadListServiceReturnValue: RoomThreadListServiceProxyProtocol! { get { threadListServiceReturnValueLock.withLock { threadListServiceUnderlyingReturnValue } } set { threadListServiceReturnValueLock.withLock { threadListServiceUnderlyingReturnValue = newValue } } } - var threadListServiceClosure: (() -> RoomThreadListServiceProxyProtocol)? + nonisolated(unsafe) var threadListServiceClosure: (() -> RoomThreadListServiceProxyProtocol)? func threadListService() -> RoomThreadListServiceProxyProtocol { threadListServiceCallsCountLock.withLock { threadListServiceUnderlyingCallsCount += 1 } @@ -5071,7 +5071,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - loadOrFetchEventDetails private let loadOrFetchEventDetailsForCallsCountLock = NSLock() - private var loadOrFetchEventDetailsForUnderlyingCallsCount = 0 + private nonisolated(unsafe) var loadOrFetchEventDetailsForUnderlyingCallsCount = 0 var loadOrFetchEventDetailsForCallsCount: Int { get { loadOrFetchEventDetailsForCallsCountLock.withLock { loadOrFetchEventDetailsForUnderlyingCallsCount } } set { loadOrFetchEventDetailsForCallsCountLock.withLock { loadOrFetchEventDetailsForUnderlyingCallsCount = newValue } } @@ -5080,27 +5080,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return loadOrFetchEventDetailsForCallsCount > 0 } private let loadOrFetchEventDetailsForReceivedEventIDLock = NSLock() - private var loadOrFetchEventDetailsForUnderlyingReceivedEventID: String? + private nonisolated(unsafe) var loadOrFetchEventDetailsForUnderlyingReceivedEventID: String? var loadOrFetchEventDetailsForReceivedEventID: String? { get { loadOrFetchEventDetailsForReceivedEventIDLock.withLock { loadOrFetchEventDetailsForUnderlyingReceivedEventID } } set { loadOrFetchEventDetailsForReceivedEventIDLock.withLock { loadOrFetchEventDetailsForUnderlyingReceivedEventID = newValue } } } private let loadOrFetchEventDetailsForReceivedInvocationsLock = NSLock() - private var loadOrFetchEventDetailsForUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var loadOrFetchEventDetailsForUnderlyingReceivedInvocations: [String] = [] var loadOrFetchEventDetailsForReceivedInvocations: [String] { get { loadOrFetchEventDetailsForReceivedInvocationsLock.withLock { loadOrFetchEventDetailsForUnderlyingReceivedInvocations } } set { loadOrFetchEventDetailsForReceivedInvocationsLock.withLock { loadOrFetchEventDetailsForUnderlyingReceivedInvocations = newValue } } } private let loadOrFetchEventDetailsForReturnValueLock = NSLock() - private var loadOrFetchEventDetailsForUnderlyingReturnValue: Result! + private nonisolated(unsafe) var loadOrFetchEventDetailsForUnderlyingReturnValue: Result! var loadOrFetchEventDetailsForReturnValue: Result! { get { loadOrFetchEventDetailsForReturnValueLock.withLock { loadOrFetchEventDetailsForUnderlyingReturnValue } } set { loadOrFetchEventDetailsForReturnValueLock.withLock { loadOrFetchEventDetailsForUnderlyingReturnValue = newValue } } } - var loadOrFetchEventDetailsForClosure: ((String) async -> Result)? + nonisolated(unsafe) var loadOrFetchEventDetailsForClosure: ((String) async -> Result)? - func loadOrFetchEventDetails(for eventID: String) async -> Result { + @concurrent func loadOrFetchEventDetails(for eventID: String) async -> Result { loadOrFetchEventDetailsForCallsCountLock.withLock { loadOrFetchEventDetailsForUnderlyingCallsCount += 1 } loadOrFetchEventDetailsForReceivedEventID = eventID loadOrFetchEventDetailsForReceivedInvocationsLock.withLock { loadOrFetchEventDetailsForUnderlyingReceivedInvocations.append(eventID) } @@ -5113,7 +5113,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - messageFilteredTimeline private let messageFilteredTimelineFocusAllowedMessageTypesPresentationCallsCountLock = NSLock() - private var messageFilteredTimelineFocusAllowedMessageTypesPresentationUnderlyingCallsCount = 0 + private nonisolated(unsafe) var messageFilteredTimelineFocusAllowedMessageTypesPresentationUnderlyingCallsCount = 0 var messageFilteredTimelineFocusAllowedMessageTypesPresentationCallsCount: Int { get { messageFilteredTimelineFocusAllowedMessageTypesPresentationCallsCountLock.withLock { messageFilteredTimelineFocusAllowedMessageTypesPresentationUnderlyingCallsCount } } set { messageFilteredTimelineFocusAllowedMessageTypesPresentationCallsCountLock.withLock { messageFilteredTimelineFocusAllowedMessageTypesPresentationUnderlyingCallsCount = newValue } } @@ -5122,27 +5122,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return messageFilteredTimelineFocusAllowedMessageTypesPresentationCallsCount > 0 } private let messageFilteredTimelineFocusAllowedMessageTypesPresentationReceivedArgumentsLock = NSLock() - private var messageFilteredTimelineFocusAllowedMessageTypesPresentationUnderlyingReceivedArguments: (focus: TimelineFocus, allowedMessageTypes: [TimelineAllowedMessageType], presentation: TimelineKind.MediaPresentation)? + private nonisolated(unsafe) var messageFilteredTimelineFocusAllowedMessageTypesPresentationUnderlyingReceivedArguments: (focus: TimelineFocus, allowedMessageTypes: [TimelineAllowedMessageType], presentation: TimelineKind.MediaPresentation)? var messageFilteredTimelineFocusAllowedMessageTypesPresentationReceivedArguments: (focus: TimelineFocus, allowedMessageTypes: [TimelineAllowedMessageType], presentation: TimelineKind.MediaPresentation)? { get { messageFilteredTimelineFocusAllowedMessageTypesPresentationReceivedArgumentsLock.withLock { messageFilteredTimelineFocusAllowedMessageTypesPresentationUnderlyingReceivedArguments } } set { messageFilteredTimelineFocusAllowedMessageTypesPresentationReceivedArgumentsLock.withLock { messageFilteredTimelineFocusAllowedMessageTypesPresentationUnderlyingReceivedArguments = newValue } } } private let messageFilteredTimelineFocusAllowedMessageTypesPresentationReceivedInvocationsLock = NSLock() - private var messageFilteredTimelineFocusAllowedMessageTypesPresentationUnderlyingReceivedInvocations: [(focus: TimelineFocus, allowedMessageTypes: [TimelineAllowedMessageType], presentation: TimelineKind.MediaPresentation)] = [] + private nonisolated(unsafe) var messageFilteredTimelineFocusAllowedMessageTypesPresentationUnderlyingReceivedInvocations: [(focus: TimelineFocus, allowedMessageTypes: [TimelineAllowedMessageType], presentation: TimelineKind.MediaPresentation)] = [] var messageFilteredTimelineFocusAllowedMessageTypesPresentationReceivedInvocations: [(focus: TimelineFocus, allowedMessageTypes: [TimelineAllowedMessageType], presentation: TimelineKind.MediaPresentation)] { get { messageFilteredTimelineFocusAllowedMessageTypesPresentationReceivedInvocationsLock.withLock { messageFilteredTimelineFocusAllowedMessageTypesPresentationUnderlyingReceivedInvocations } } set { messageFilteredTimelineFocusAllowedMessageTypesPresentationReceivedInvocationsLock.withLock { messageFilteredTimelineFocusAllowedMessageTypesPresentationUnderlyingReceivedInvocations = newValue } } } private let messageFilteredTimelineFocusAllowedMessageTypesPresentationReturnValueLock = NSLock() - private var messageFilteredTimelineFocusAllowedMessageTypesPresentationUnderlyingReturnValue: Result! + private nonisolated(unsafe) var messageFilteredTimelineFocusAllowedMessageTypesPresentationUnderlyingReturnValue: Result! var messageFilteredTimelineFocusAllowedMessageTypesPresentationReturnValue: Result! { get { messageFilteredTimelineFocusAllowedMessageTypesPresentationReturnValueLock.withLock { messageFilteredTimelineFocusAllowedMessageTypesPresentationUnderlyingReturnValue } } set { messageFilteredTimelineFocusAllowedMessageTypesPresentationReturnValueLock.withLock { messageFilteredTimelineFocusAllowedMessageTypesPresentationUnderlyingReturnValue = newValue } } } - var messageFilteredTimelineFocusAllowedMessageTypesPresentationClosure: ((TimelineFocus, [TimelineAllowedMessageType], TimelineKind.MediaPresentation) async -> Result)? + nonisolated(unsafe) var messageFilteredTimelineFocusAllowedMessageTypesPresentationClosure: ((TimelineFocus, [TimelineAllowedMessageType], TimelineKind.MediaPresentation) async -> Result)? - func messageFilteredTimeline(focus: TimelineFocus, allowedMessageTypes: [TimelineAllowedMessageType], presentation: TimelineKind.MediaPresentation) async -> Result { + @concurrent func messageFilteredTimeline(focus: TimelineFocus, allowedMessageTypes: [TimelineAllowedMessageType], presentation: TimelineKind.MediaPresentation) async -> Result { messageFilteredTimelineFocusAllowedMessageTypesPresentationCallsCountLock.withLock { messageFilteredTimelineFocusAllowedMessageTypesPresentationUnderlyingCallsCount += 1 } messageFilteredTimelineFocusAllowedMessageTypesPresentationReceivedArguments = (focus: focus, allowedMessageTypes: allowedMessageTypes, presentation: presentation) messageFilteredTimelineFocusAllowedMessageTypesPresentationReceivedInvocationsLock.withLock { messageFilteredTimelineFocusAllowedMessageTypesPresentationUnderlyingReceivedInvocations.append((focus: focus, allowedMessageTypes: allowedMessageTypes, presentation: presentation)) } @@ -5155,7 +5155,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - pinnedEventsTimeline private let pinnedEventsTimelineCallsCountLock = NSLock() - private var pinnedEventsTimelineUnderlyingCallsCount = 0 + private nonisolated(unsafe) var pinnedEventsTimelineUnderlyingCallsCount = 0 var pinnedEventsTimelineCallsCount: Int { get { pinnedEventsTimelineCallsCountLock.withLock { pinnedEventsTimelineUnderlyingCallsCount } } set { pinnedEventsTimelineCallsCountLock.withLock { pinnedEventsTimelineUnderlyingCallsCount = newValue } } @@ -5165,14 +5165,14 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { } private let pinnedEventsTimelineReturnValueLock = NSLock() - private var pinnedEventsTimelineUnderlyingReturnValue: Result! + private nonisolated(unsafe) var pinnedEventsTimelineUnderlyingReturnValue: Result! var pinnedEventsTimelineReturnValue: Result! { get { pinnedEventsTimelineReturnValueLock.withLock { pinnedEventsTimelineUnderlyingReturnValue } } set { pinnedEventsTimelineReturnValueLock.withLock { pinnedEventsTimelineUnderlyingReturnValue = newValue } } } - var pinnedEventsTimelineClosure: (() async -> Result)? + nonisolated(unsafe) var pinnedEventsTimelineClosure: (() async -> Result)? - func pinnedEventsTimeline() async -> Result { + @concurrent func pinnedEventsTimeline() async -> Result { pinnedEventsTimelineCallsCountLock.withLock { pinnedEventsTimelineUnderlyingCallsCount += 1 } if let pinnedEventsTimelineClosure = pinnedEventsTimelineClosure { return await pinnedEventsTimelineClosure() @@ -5183,7 +5183,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - enableEncryption private let enableEncryptionCallsCountLock = NSLock() - private var enableEncryptionUnderlyingCallsCount = 0 + private nonisolated(unsafe) var enableEncryptionUnderlyingCallsCount = 0 var enableEncryptionCallsCount: Int { get { enableEncryptionCallsCountLock.withLock { enableEncryptionUnderlyingCallsCount } } set { enableEncryptionCallsCountLock.withLock { enableEncryptionUnderlyingCallsCount = newValue } } @@ -5193,14 +5193,14 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { } private let enableEncryptionReturnValueLock = NSLock() - private var enableEncryptionUnderlyingReturnValue: Result! + private nonisolated(unsafe) var enableEncryptionUnderlyingReturnValue: Result! var enableEncryptionReturnValue: Result! { get { enableEncryptionReturnValueLock.withLock { enableEncryptionUnderlyingReturnValue } } set { enableEncryptionReturnValueLock.withLock { enableEncryptionUnderlyingReturnValue = newValue } } } - var enableEncryptionClosure: (() async -> Result)? + nonisolated(unsafe) var enableEncryptionClosure: (() async -> Result)? - func enableEncryption() async -> Result { + @concurrent func enableEncryption() async -> Result { enableEncryptionCallsCountLock.withLock { enableEncryptionUnderlyingCallsCount += 1 } if let enableEncryptionClosure = enableEncryptionClosure { return await enableEncryptionClosure() @@ -5211,7 +5211,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - redact private let redactCallsCountLock = NSLock() - private var redactUnderlyingCallsCount = 0 + private nonisolated(unsafe) var redactUnderlyingCallsCount = 0 var redactCallsCount: Int { get { redactCallsCountLock.withLock { redactUnderlyingCallsCount } } set { redactCallsCountLock.withLock { redactUnderlyingCallsCount = newValue } } @@ -5220,27 +5220,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return redactCallsCount > 0 } private let redactReceivedEventIDLock = NSLock() - private var redactUnderlyingReceivedEventID: String? + private nonisolated(unsafe) var redactUnderlyingReceivedEventID: String? var redactReceivedEventID: String? { get { redactReceivedEventIDLock.withLock { redactUnderlyingReceivedEventID } } set { redactReceivedEventIDLock.withLock { redactUnderlyingReceivedEventID = newValue } } } private let redactReceivedInvocationsLock = NSLock() - private var redactUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var redactUnderlyingReceivedInvocations: [String] = [] var redactReceivedInvocations: [String] { get { redactReceivedInvocationsLock.withLock { redactUnderlyingReceivedInvocations } } set { redactReceivedInvocationsLock.withLock { redactUnderlyingReceivedInvocations = newValue } } } private let redactReturnValueLock = NSLock() - private var redactUnderlyingReturnValue: Result! + private nonisolated(unsafe) var redactUnderlyingReturnValue: Result! var redactReturnValue: Result! { get { redactReturnValueLock.withLock { redactUnderlyingReturnValue } } set { redactReturnValueLock.withLock { redactUnderlyingReturnValue = newValue } } } - var redactClosure: ((String) async -> Result)? + nonisolated(unsafe) var redactClosure: ((String) async -> Result)? - func redact(_ eventID: String) async -> Result { + @concurrent func redact(_ eventID: String) async -> Result { redactCallsCountLock.withLock { redactUnderlyingCallsCount += 1 } redactReceivedEventID = eventID redactReceivedInvocationsLock.withLock { redactUnderlyingReceivedInvocations.append(eventID) } @@ -5253,7 +5253,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - reportContent private let reportContentReasonCallsCountLock = NSLock() - private var reportContentReasonUnderlyingCallsCount = 0 + private nonisolated(unsafe) var reportContentReasonUnderlyingCallsCount = 0 var reportContentReasonCallsCount: Int { get { reportContentReasonCallsCountLock.withLock { reportContentReasonUnderlyingCallsCount } } set { reportContentReasonCallsCountLock.withLock { reportContentReasonUnderlyingCallsCount = newValue } } @@ -5262,27 +5262,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return reportContentReasonCallsCount > 0 } private let reportContentReasonReceivedArgumentsLock = NSLock() - private var reportContentReasonUnderlyingReceivedArguments: (eventID: String, reason: String?)? + private nonisolated(unsafe) var reportContentReasonUnderlyingReceivedArguments: (eventID: String, reason: String?)? var reportContentReasonReceivedArguments: (eventID: String, reason: String?)? { get { reportContentReasonReceivedArgumentsLock.withLock { reportContentReasonUnderlyingReceivedArguments } } set { reportContentReasonReceivedArgumentsLock.withLock { reportContentReasonUnderlyingReceivedArguments = newValue } } } private let reportContentReasonReceivedInvocationsLock = NSLock() - private var reportContentReasonUnderlyingReceivedInvocations: [(eventID: String, reason: String?)] = [] + private nonisolated(unsafe) var reportContentReasonUnderlyingReceivedInvocations: [(eventID: String, reason: String?)] = [] var reportContentReasonReceivedInvocations: [(eventID: String, reason: String?)] { get { reportContentReasonReceivedInvocationsLock.withLock { reportContentReasonUnderlyingReceivedInvocations } } set { reportContentReasonReceivedInvocationsLock.withLock { reportContentReasonUnderlyingReceivedInvocations = newValue } } } private let reportContentReasonReturnValueLock = NSLock() - private var reportContentReasonUnderlyingReturnValue: Result! + private nonisolated(unsafe) var reportContentReasonUnderlyingReturnValue: Result! var reportContentReasonReturnValue: Result! { get { reportContentReasonReturnValueLock.withLock { reportContentReasonUnderlyingReturnValue } } set { reportContentReasonReturnValueLock.withLock { reportContentReasonUnderlyingReturnValue = newValue } } } - var reportContentReasonClosure: ((String, String?) async -> Result)? + nonisolated(unsafe) var reportContentReasonClosure: ((String, String?) async -> Result)? - func reportContent(_ eventID: String, reason: String?) async -> Result { + @concurrent func reportContent(_ eventID: String, reason: String?) async -> Result { reportContentReasonCallsCountLock.withLock { reportContentReasonUnderlyingCallsCount += 1 } reportContentReasonReceivedArguments = (eventID: eventID, reason: reason) reportContentReasonReceivedInvocationsLock.withLock { reportContentReasonUnderlyingReceivedInvocations.append((eventID: eventID, reason: reason)) } @@ -5295,7 +5295,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - reportRoom private let reportRoomReasonCallsCountLock = NSLock() - private var reportRoomReasonUnderlyingCallsCount = 0 + private nonisolated(unsafe) var reportRoomReasonUnderlyingCallsCount = 0 var reportRoomReasonCallsCount: Int { get { reportRoomReasonCallsCountLock.withLock { reportRoomReasonUnderlyingCallsCount } } set { reportRoomReasonCallsCountLock.withLock { reportRoomReasonUnderlyingCallsCount = newValue } } @@ -5304,27 +5304,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return reportRoomReasonCallsCount > 0 } private let reportRoomReasonReceivedReasonLock = NSLock() - private var reportRoomReasonUnderlyingReceivedReason: String? + private nonisolated(unsafe) var reportRoomReasonUnderlyingReceivedReason: String? var reportRoomReasonReceivedReason: String? { get { reportRoomReasonReceivedReasonLock.withLock { reportRoomReasonUnderlyingReceivedReason } } set { reportRoomReasonReceivedReasonLock.withLock { reportRoomReasonUnderlyingReceivedReason = newValue } } } private let reportRoomReasonReceivedInvocationsLock = NSLock() - private var reportRoomReasonUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var reportRoomReasonUnderlyingReceivedInvocations: [String] = [] var reportRoomReasonReceivedInvocations: [String] { get { reportRoomReasonReceivedInvocationsLock.withLock { reportRoomReasonUnderlyingReceivedInvocations } } set { reportRoomReasonReceivedInvocationsLock.withLock { reportRoomReasonUnderlyingReceivedInvocations = newValue } } } private let reportRoomReasonReturnValueLock = NSLock() - private var reportRoomReasonUnderlyingReturnValue: Result! + private nonisolated(unsafe) var reportRoomReasonUnderlyingReturnValue: Result! var reportRoomReasonReturnValue: Result! { get { reportRoomReasonReturnValueLock.withLock { reportRoomReasonUnderlyingReturnValue } } set { reportRoomReasonReturnValueLock.withLock { reportRoomReasonUnderlyingReturnValue = newValue } } } - var reportRoomReasonClosure: ((String) async -> Result)? + nonisolated(unsafe) var reportRoomReasonClosure: ((String) async -> Result)? - func reportRoom(reason: String) async -> Result { + @concurrent func reportRoom(reason: String) async -> Result { reportRoomReasonCallsCountLock.withLock { reportRoomReasonUnderlyingCallsCount += 1 } reportRoomReasonReceivedReason = reason reportRoomReasonReceivedInvocationsLock.withLock { reportRoomReasonUnderlyingReceivedInvocations.append(reason) } @@ -5337,7 +5337,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - leaveRoom private let leaveRoomCallsCountLock = NSLock() - private var leaveRoomUnderlyingCallsCount = 0 + private nonisolated(unsafe) var leaveRoomUnderlyingCallsCount = 0 var leaveRoomCallsCount: Int { get { leaveRoomCallsCountLock.withLock { leaveRoomUnderlyingCallsCount } } set { leaveRoomCallsCountLock.withLock { leaveRoomUnderlyingCallsCount = newValue } } @@ -5347,14 +5347,14 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { } private let leaveRoomReturnValueLock = NSLock() - private var leaveRoomUnderlyingReturnValue: Result! + private nonisolated(unsafe) var leaveRoomUnderlyingReturnValue: Result! var leaveRoomReturnValue: Result! { get { leaveRoomReturnValueLock.withLock { leaveRoomUnderlyingReturnValue } } set { leaveRoomReturnValueLock.withLock { leaveRoomUnderlyingReturnValue = newValue } } } - var leaveRoomClosure: (() async -> Result)? + nonisolated(unsafe) var leaveRoomClosure: (() async -> Result)? - func leaveRoom() async -> Result { + @concurrent func leaveRoom() async -> Result { leaveRoomCallsCountLock.withLock { leaveRoomUnderlyingCallsCount += 1 } if let leaveRoomClosure = leaveRoomClosure { return await leaveRoomClosure() @@ -5365,7 +5365,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - updateMembers private let updateMembersCallsCountLock = NSLock() - private var updateMembersUnderlyingCallsCount = 0 + private nonisolated(unsafe) var updateMembersUnderlyingCallsCount = 0 var updateMembersCallsCount: Int { get { updateMembersCallsCountLock.withLock { updateMembersUnderlyingCallsCount } } set { updateMembersCallsCountLock.withLock { updateMembersUnderlyingCallsCount = newValue } } @@ -5373,16 +5373,16 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { var updateMembersCalled: Bool { return updateMembersCallsCount > 0 } - var updateMembersClosure: (() async -> Void)? + nonisolated(unsafe) var updateMembersClosure: (() async -> Void)? - func updateMembers() async { + @concurrent func updateMembers() async { updateMembersCallsCountLock.withLock { updateMembersUnderlyingCallsCount += 1 } await updateMembersClosure?() } //MARK: - getMember private let getMemberUserIDCallsCountLock = NSLock() - private var getMemberUserIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var getMemberUserIDUnderlyingCallsCount = 0 var getMemberUserIDCallsCount: Int { get { getMemberUserIDCallsCountLock.withLock { getMemberUserIDUnderlyingCallsCount } } set { getMemberUserIDCallsCountLock.withLock { getMemberUserIDUnderlyingCallsCount = newValue } } @@ -5391,27 +5391,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return getMemberUserIDCallsCount > 0 } private let getMemberUserIDReceivedUserIDLock = NSLock() - private var getMemberUserIDUnderlyingReceivedUserID: String? + private nonisolated(unsafe) var getMemberUserIDUnderlyingReceivedUserID: String? var getMemberUserIDReceivedUserID: String? { get { getMemberUserIDReceivedUserIDLock.withLock { getMemberUserIDUnderlyingReceivedUserID } } set { getMemberUserIDReceivedUserIDLock.withLock { getMemberUserIDUnderlyingReceivedUserID = newValue } } } private let getMemberUserIDReceivedInvocationsLock = NSLock() - private var getMemberUserIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var getMemberUserIDUnderlyingReceivedInvocations: [String] = [] var getMemberUserIDReceivedInvocations: [String] { get { getMemberUserIDReceivedInvocationsLock.withLock { getMemberUserIDUnderlyingReceivedInvocations } } set { getMemberUserIDReceivedInvocationsLock.withLock { getMemberUserIDUnderlyingReceivedInvocations = newValue } } } private let getMemberUserIDReturnValueLock = NSLock() - private var getMemberUserIDUnderlyingReturnValue: Result! + private nonisolated(unsafe) var getMemberUserIDUnderlyingReturnValue: Result! var getMemberUserIDReturnValue: Result! { get { getMemberUserIDReturnValueLock.withLock { getMemberUserIDUnderlyingReturnValue } } set { getMemberUserIDReturnValueLock.withLock { getMemberUserIDUnderlyingReturnValue = newValue } } } - var getMemberUserIDClosure: ((String) async -> Result)? + nonisolated(unsafe) var getMemberUserIDClosure: ((String) async -> Result)? - func getMember(userID: String) async -> Result { + @concurrent func getMember(userID: String) async -> Result { getMemberUserIDCallsCountLock.withLock { getMemberUserIDUnderlyingCallsCount += 1 } getMemberUserIDReceivedUserID = userID getMemberUserIDReceivedInvocationsLock.withLock { getMemberUserIDUnderlyingReceivedInvocations.append(userID) } @@ -5424,7 +5424,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - invite private let inviteUserIDCallsCountLock = NSLock() - private var inviteUserIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var inviteUserIDUnderlyingCallsCount = 0 var inviteUserIDCallsCount: Int { get { inviteUserIDCallsCountLock.withLock { inviteUserIDUnderlyingCallsCount } } set { inviteUserIDCallsCountLock.withLock { inviteUserIDUnderlyingCallsCount = newValue } } @@ -5433,27 +5433,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return inviteUserIDCallsCount > 0 } private let inviteUserIDReceivedUserIDLock = NSLock() - private var inviteUserIDUnderlyingReceivedUserID: String? + private nonisolated(unsafe) var inviteUserIDUnderlyingReceivedUserID: String? var inviteUserIDReceivedUserID: String? { get { inviteUserIDReceivedUserIDLock.withLock { inviteUserIDUnderlyingReceivedUserID } } set { inviteUserIDReceivedUserIDLock.withLock { inviteUserIDUnderlyingReceivedUserID = newValue } } } private let inviteUserIDReceivedInvocationsLock = NSLock() - private var inviteUserIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var inviteUserIDUnderlyingReceivedInvocations: [String] = [] var inviteUserIDReceivedInvocations: [String] { get { inviteUserIDReceivedInvocationsLock.withLock { inviteUserIDUnderlyingReceivedInvocations } } set { inviteUserIDReceivedInvocationsLock.withLock { inviteUserIDUnderlyingReceivedInvocations = newValue } } } private let inviteUserIDReturnValueLock = NSLock() - private var inviteUserIDUnderlyingReturnValue: Result! + private nonisolated(unsafe) var inviteUserIDUnderlyingReturnValue: Result! var inviteUserIDReturnValue: Result! { get { inviteUserIDReturnValueLock.withLock { inviteUserIDUnderlyingReturnValue } } set { inviteUserIDReturnValueLock.withLock { inviteUserIDUnderlyingReturnValue = newValue } } } - var inviteUserIDClosure: ((String) async -> Result)? + nonisolated(unsafe) var inviteUserIDClosure: ((String) async -> Result)? - func invite(userID: String) async -> Result { + @concurrent func invite(userID: String) async -> Result { inviteUserIDCallsCountLock.withLock { inviteUserIDUnderlyingCallsCount += 1 } inviteUserIDReceivedUserID = userID inviteUserIDReceivedInvocationsLock.withLock { inviteUserIDUnderlyingReceivedInvocations.append(userID) } @@ -5466,7 +5466,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - setName private let setNameCallsCountLock = NSLock() - private var setNameUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setNameUnderlyingCallsCount = 0 var setNameCallsCount: Int { get { setNameCallsCountLock.withLock { setNameUnderlyingCallsCount } } set { setNameCallsCountLock.withLock { setNameUnderlyingCallsCount = newValue } } @@ -5475,27 +5475,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return setNameCallsCount > 0 } private let setNameReceivedNameLock = NSLock() - private var setNameUnderlyingReceivedName: String? + private nonisolated(unsafe) var setNameUnderlyingReceivedName: String? var setNameReceivedName: String? { get { setNameReceivedNameLock.withLock { setNameUnderlyingReceivedName } } set { setNameReceivedNameLock.withLock { setNameUnderlyingReceivedName = newValue } } } private let setNameReceivedInvocationsLock = NSLock() - private var setNameUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var setNameUnderlyingReceivedInvocations: [String] = [] var setNameReceivedInvocations: [String] { get { setNameReceivedInvocationsLock.withLock { setNameUnderlyingReceivedInvocations } } set { setNameReceivedInvocationsLock.withLock { setNameUnderlyingReceivedInvocations = newValue } } } private let setNameReturnValueLock = NSLock() - private var setNameUnderlyingReturnValue: Result! + private nonisolated(unsafe) var setNameUnderlyingReturnValue: Result! var setNameReturnValue: Result! { get { setNameReturnValueLock.withLock { setNameUnderlyingReturnValue } } set { setNameReturnValueLock.withLock { setNameUnderlyingReturnValue = newValue } } } - var setNameClosure: ((String) async -> Result)? + nonisolated(unsafe) var setNameClosure: ((String) async -> Result)? - func setName(_ name: String) async -> Result { + @concurrent func setName(_ name: String) async -> Result { setNameCallsCountLock.withLock { setNameUnderlyingCallsCount += 1 } setNameReceivedName = name setNameReceivedInvocationsLock.withLock { setNameUnderlyingReceivedInvocations.append(name) } @@ -5508,7 +5508,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - setTopic private let setTopicCallsCountLock = NSLock() - private var setTopicUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setTopicUnderlyingCallsCount = 0 var setTopicCallsCount: Int { get { setTopicCallsCountLock.withLock { setTopicUnderlyingCallsCount } } set { setTopicCallsCountLock.withLock { setTopicUnderlyingCallsCount = newValue } } @@ -5517,27 +5517,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return setTopicCallsCount > 0 } private let setTopicReceivedTopicLock = NSLock() - private var setTopicUnderlyingReceivedTopic: String? + private nonisolated(unsafe) var setTopicUnderlyingReceivedTopic: String? var setTopicReceivedTopic: String? { get { setTopicReceivedTopicLock.withLock { setTopicUnderlyingReceivedTopic } } set { setTopicReceivedTopicLock.withLock { setTopicUnderlyingReceivedTopic = newValue } } } private let setTopicReceivedInvocationsLock = NSLock() - private var setTopicUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var setTopicUnderlyingReceivedInvocations: [String] = [] var setTopicReceivedInvocations: [String] { get { setTopicReceivedInvocationsLock.withLock { setTopicUnderlyingReceivedInvocations } } set { setTopicReceivedInvocationsLock.withLock { setTopicUnderlyingReceivedInvocations = newValue } } } private let setTopicReturnValueLock = NSLock() - private var setTopicUnderlyingReturnValue: Result! + private nonisolated(unsafe) var setTopicUnderlyingReturnValue: Result! var setTopicReturnValue: Result! { get { setTopicReturnValueLock.withLock { setTopicUnderlyingReturnValue } } set { setTopicReturnValueLock.withLock { setTopicUnderlyingReturnValue = newValue } } } - var setTopicClosure: ((String) async -> Result)? + nonisolated(unsafe) var setTopicClosure: ((String) async -> Result)? - func setTopic(_ topic: String) async -> Result { + @concurrent func setTopic(_ topic: String) async -> Result { setTopicCallsCountLock.withLock { setTopicUnderlyingCallsCount += 1 } setTopicReceivedTopic = topic setTopicReceivedInvocationsLock.withLock { setTopicUnderlyingReceivedInvocations.append(topic) } @@ -5550,7 +5550,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - removeAvatar private let removeAvatarCallsCountLock = NSLock() - private var removeAvatarUnderlyingCallsCount = 0 + private nonisolated(unsafe) var removeAvatarUnderlyingCallsCount = 0 var removeAvatarCallsCount: Int { get { removeAvatarCallsCountLock.withLock { removeAvatarUnderlyingCallsCount } } set { removeAvatarCallsCountLock.withLock { removeAvatarUnderlyingCallsCount = newValue } } @@ -5560,14 +5560,14 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { } private let removeAvatarReturnValueLock = NSLock() - private var removeAvatarUnderlyingReturnValue: Result! + private nonisolated(unsafe) var removeAvatarUnderlyingReturnValue: Result! var removeAvatarReturnValue: Result! { get { removeAvatarReturnValueLock.withLock { removeAvatarUnderlyingReturnValue } } set { removeAvatarReturnValueLock.withLock { removeAvatarUnderlyingReturnValue = newValue } } } - var removeAvatarClosure: (() async -> Result)? + nonisolated(unsafe) var removeAvatarClosure: (() async -> Result)? - func removeAvatar() async -> Result { + @concurrent func removeAvatar() async -> Result { removeAvatarCallsCountLock.withLock { removeAvatarUnderlyingCallsCount += 1 } if let removeAvatarClosure = removeAvatarClosure { return await removeAvatarClosure() @@ -5578,7 +5578,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - uploadAvatar private let uploadAvatarMediaCallsCountLock = NSLock() - private var uploadAvatarMediaUnderlyingCallsCount = 0 + private nonisolated(unsafe) var uploadAvatarMediaUnderlyingCallsCount = 0 var uploadAvatarMediaCallsCount: Int { get { uploadAvatarMediaCallsCountLock.withLock { uploadAvatarMediaUnderlyingCallsCount } } set { uploadAvatarMediaCallsCountLock.withLock { uploadAvatarMediaUnderlyingCallsCount = newValue } } @@ -5587,27 +5587,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return uploadAvatarMediaCallsCount > 0 } private let uploadAvatarMediaReceivedMediaLock = NSLock() - private var uploadAvatarMediaUnderlyingReceivedMedia: MediaInfo? + private nonisolated(unsafe) var uploadAvatarMediaUnderlyingReceivedMedia: MediaInfo? var uploadAvatarMediaReceivedMedia: MediaInfo? { get { uploadAvatarMediaReceivedMediaLock.withLock { uploadAvatarMediaUnderlyingReceivedMedia } } set { uploadAvatarMediaReceivedMediaLock.withLock { uploadAvatarMediaUnderlyingReceivedMedia = newValue } } } private let uploadAvatarMediaReceivedInvocationsLock = NSLock() - private var uploadAvatarMediaUnderlyingReceivedInvocations: [MediaInfo] = [] + private nonisolated(unsafe) var uploadAvatarMediaUnderlyingReceivedInvocations: [MediaInfo] = [] var uploadAvatarMediaReceivedInvocations: [MediaInfo] { get { uploadAvatarMediaReceivedInvocationsLock.withLock { uploadAvatarMediaUnderlyingReceivedInvocations } } set { uploadAvatarMediaReceivedInvocationsLock.withLock { uploadAvatarMediaUnderlyingReceivedInvocations = newValue } } } private let uploadAvatarMediaReturnValueLock = NSLock() - private var uploadAvatarMediaUnderlyingReturnValue: Result! + private nonisolated(unsafe) var uploadAvatarMediaUnderlyingReturnValue: Result! var uploadAvatarMediaReturnValue: Result! { get { uploadAvatarMediaReturnValueLock.withLock { uploadAvatarMediaUnderlyingReturnValue } } set { uploadAvatarMediaReturnValueLock.withLock { uploadAvatarMediaUnderlyingReturnValue = newValue } } } - var uploadAvatarMediaClosure: ((MediaInfo) async -> Result)? + nonisolated(unsafe) var uploadAvatarMediaClosure: ((MediaInfo) async -> Result)? - func uploadAvatar(media: MediaInfo) async -> Result { + @concurrent func uploadAvatar(media: MediaInfo) async -> Result { uploadAvatarMediaCallsCountLock.withLock { uploadAvatarMediaUnderlyingCallsCount += 1 } uploadAvatarMediaReceivedMedia = media uploadAvatarMediaReceivedInvocationsLock.withLock { uploadAvatarMediaUnderlyingReceivedInvocations.append(media) } @@ -5620,7 +5620,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - markAsRead private let markAsReadReceiptTypeCallsCountLock = NSLock() - private var markAsReadReceiptTypeUnderlyingCallsCount = 0 + private nonisolated(unsafe) var markAsReadReceiptTypeUnderlyingCallsCount = 0 var markAsReadReceiptTypeCallsCount: Int { get { markAsReadReceiptTypeCallsCountLock.withLock { markAsReadReceiptTypeUnderlyingCallsCount } } set { markAsReadReceiptTypeCallsCountLock.withLock { markAsReadReceiptTypeUnderlyingCallsCount = newValue } } @@ -5629,27 +5629,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return markAsReadReceiptTypeCallsCount > 0 } private let markAsReadReceiptTypeReceivedReceiptTypeLock = NSLock() - private var markAsReadReceiptTypeUnderlyingReceivedReceiptType: ReceiptType? + private nonisolated(unsafe) var markAsReadReceiptTypeUnderlyingReceivedReceiptType: ReceiptType? var markAsReadReceiptTypeReceivedReceiptType: ReceiptType? { get { markAsReadReceiptTypeReceivedReceiptTypeLock.withLock { markAsReadReceiptTypeUnderlyingReceivedReceiptType } } set { markAsReadReceiptTypeReceivedReceiptTypeLock.withLock { markAsReadReceiptTypeUnderlyingReceivedReceiptType = newValue } } } private let markAsReadReceiptTypeReceivedInvocationsLock = NSLock() - private var markAsReadReceiptTypeUnderlyingReceivedInvocations: [ReceiptType] = [] + private nonisolated(unsafe) var markAsReadReceiptTypeUnderlyingReceivedInvocations: [ReceiptType] = [] var markAsReadReceiptTypeReceivedInvocations: [ReceiptType] { get { markAsReadReceiptTypeReceivedInvocationsLock.withLock { markAsReadReceiptTypeUnderlyingReceivedInvocations } } set { markAsReadReceiptTypeReceivedInvocationsLock.withLock { markAsReadReceiptTypeUnderlyingReceivedInvocations = newValue } } } private let markAsReadReceiptTypeReturnValueLock = NSLock() - private var markAsReadReceiptTypeUnderlyingReturnValue: Result! + private nonisolated(unsafe) var markAsReadReceiptTypeUnderlyingReturnValue: Result! var markAsReadReceiptTypeReturnValue: Result! { get { markAsReadReceiptTypeReturnValueLock.withLock { markAsReadReceiptTypeUnderlyingReturnValue } } set { markAsReadReceiptTypeReturnValueLock.withLock { markAsReadReceiptTypeUnderlyingReturnValue = newValue } } } - var markAsReadReceiptTypeClosure: ((ReceiptType) async -> Result)? + nonisolated(unsafe) var markAsReadReceiptTypeClosure: ((ReceiptType) async -> Result)? - func markAsRead(receiptType: ReceiptType) async -> Result { + @concurrent func markAsRead(receiptType: ReceiptType) async -> Result { markAsReadReceiptTypeCallsCountLock.withLock { markAsReadReceiptTypeUnderlyingCallsCount += 1 } markAsReadReceiptTypeReceivedReceiptType = receiptType markAsReadReceiptTypeReceivedInvocationsLock.withLock { markAsReadReceiptTypeUnderlyingReceivedInvocations.append(receiptType) } @@ -5662,7 +5662,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - edit private let editEventIDNewContentCallsCountLock = NSLock() - private var editEventIDNewContentUnderlyingCallsCount = 0 + private nonisolated(unsafe) var editEventIDNewContentUnderlyingCallsCount = 0 var editEventIDNewContentCallsCount: Int { get { editEventIDNewContentCallsCountLock.withLock { editEventIDNewContentUnderlyingCallsCount } } set { editEventIDNewContentCallsCountLock.withLock { editEventIDNewContentUnderlyingCallsCount = newValue } } @@ -5671,27 +5671,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return editEventIDNewContentCallsCount > 0 } private let editEventIDNewContentReceivedArgumentsLock = NSLock() - private var editEventIDNewContentUnderlyingReceivedArguments: (eventID: String, newContent: RoomMessageEventContentWithoutRelation)? + private nonisolated(unsafe) var editEventIDNewContentUnderlyingReceivedArguments: (eventID: String, newContent: RoomMessageEventContentWithoutRelation)? var editEventIDNewContentReceivedArguments: (eventID: String, newContent: RoomMessageEventContentWithoutRelation)? { get { editEventIDNewContentReceivedArgumentsLock.withLock { editEventIDNewContentUnderlyingReceivedArguments } } set { editEventIDNewContentReceivedArgumentsLock.withLock { editEventIDNewContentUnderlyingReceivedArguments = newValue } } } private let editEventIDNewContentReceivedInvocationsLock = NSLock() - private var editEventIDNewContentUnderlyingReceivedInvocations: [(eventID: String, newContent: RoomMessageEventContentWithoutRelation)] = [] + private nonisolated(unsafe) var editEventIDNewContentUnderlyingReceivedInvocations: [(eventID: String, newContent: RoomMessageEventContentWithoutRelation)] = [] var editEventIDNewContentReceivedInvocations: [(eventID: String, newContent: RoomMessageEventContentWithoutRelation)] { get { editEventIDNewContentReceivedInvocationsLock.withLock { editEventIDNewContentUnderlyingReceivedInvocations } } set { editEventIDNewContentReceivedInvocationsLock.withLock { editEventIDNewContentUnderlyingReceivedInvocations = newValue } } } private let editEventIDNewContentReturnValueLock = NSLock() - private var editEventIDNewContentUnderlyingReturnValue: Result! + private nonisolated(unsafe) var editEventIDNewContentUnderlyingReturnValue: Result! var editEventIDNewContentReturnValue: Result! { get { editEventIDNewContentReturnValueLock.withLock { editEventIDNewContentUnderlyingReturnValue } } set { editEventIDNewContentReturnValueLock.withLock { editEventIDNewContentUnderlyingReturnValue = newValue } } } - var editEventIDNewContentClosure: ((String, RoomMessageEventContentWithoutRelation) async -> Result)? + nonisolated(unsafe) var editEventIDNewContentClosure: ((String, RoomMessageEventContentWithoutRelation) async -> Result)? - func edit(eventID: String, newContent: RoomMessageEventContentWithoutRelation) async -> Result { + @concurrent func edit(eventID: String, newContent: RoomMessageEventContentWithoutRelation) async -> Result { editEventIDNewContentCallsCountLock.withLock { editEventIDNewContentUnderlyingCallsCount += 1 } editEventIDNewContentReceivedArguments = (eventID: eventID, newContent: newContent) editEventIDNewContentReceivedInvocationsLock.withLock { editEventIDNewContentUnderlyingReceivedInvocations.append((eventID: eventID, newContent: newContent)) } @@ -5704,7 +5704,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - sendTypingNotification private let sendTypingNotificationIsTypingCallsCountLock = NSLock() - private var sendTypingNotificationIsTypingUnderlyingCallsCount = 0 + private nonisolated(unsafe) var sendTypingNotificationIsTypingUnderlyingCallsCount = 0 var sendTypingNotificationIsTypingCallsCount: Int { get { sendTypingNotificationIsTypingCallsCountLock.withLock { sendTypingNotificationIsTypingUnderlyingCallsCount } } set { sendTypingNotificationIsTypingCallsCountLock.withLock { sendTypingNotificationIsTypingUnderlyingCallsCount = newValue } } @@ -5713,28 +5713,28 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return sendTypingNotificationIsTypingCallsCount > 0 } private let sendTypingNotificationIsTypingReceivedIsTypingLock = NSLock() - private var sendTypingNotificationIsTypingUnderlyingReceivedIsTyping: Bool? + private nonisolated(unsafe) var sendTypingNotificationIsTypingUnderlyingReceivedIsTyping: Bool? var sendTypingNotificationIsTypingReceivedIsTyping: Bool? { get { sendTypingNotificationIsTypingReceivedIsTypingLock.withLock { sendTypingNotificationIsTypingUnderlyingReceivedIsTyping } } set { sendTypingNotificationIsTypingReceivedIsTypingLock.withLock { sendTypingNotificationIsTypingUnderlyingReceivedIsTyping = newValue } } } private let sendTypingNotificationIsTypingReceivedInvocationsLock = NSLock() - private var sendTypingNotificationIsTypingUnderlyingReceivedInvocations: [Bool] = [] + private nonisolated(unsafe) var sendTypingNotificationIsTypingUnderlyingReceivedInvocations: [Bool] = [] var sendTypingNotificationIsTypingReceivedInvocations: [Bool] { get { sendTypingNotificationIsTypingReceivedInvocationsLock.withLock { sendTypingNotificationIsTypingUnderlyingReceivedInvocations } } set { sendTypingNotificationIsTypingReceivedInvocationsLock.withLock { sendTypingNotificationIsTypingUnderlyingReceivedInvocations = newValue } } } private let sendTypingNotificationIsTypingReturnValueLock = NSLock() - private var sendTypingNotificationIsTypingUnderlyingReturnValue: Result! + private nonisolated(unsafe) var sendTypingNotificationIsTypingUnderlyingReturnValue: Result! var sendTypingNotificationIsTypingReturnValue: Result! { get { sendTypingNotificationIsTypingReturnValueLock.withLock { sendTypingNotificationIsTypingUnderlyingReturnValue } } set { sendTypingNotificationIsTypingReturnValueLock.withLock { sendTypingNotificationIsTypingUnderlyingReturnValue = newValue } } } - var sendTypingNotificationIsTypingClosure: ((Bool) async -> Result)? + nonisolated(unsafe) var sendTypingNotificationIsTypingClosure: ((Bool) async -> Result)? @discardableResult - func sendTypingNotification(isTyping: Bool) async -> Result { + @concurrent func sendTypingNotification(isTyping: Bool) async -> Result { sendTypingNotificationIsTypingCallsCountLock.withLock { sendTypingNotificationIsTypingUnderlyingCallsCount += 1 } sendTypingNotificationIsTypingReceivedIsTyping = isTyping sendTypingNotificationIsTypingReceivedInvocationsLock.withLock { sendTypingNotificationIsTypingUnderlyingReceivedInvocations.append(isTyping) } @@ -5747,7 +5747,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - ignoreDeviceTrustAndResend private let ignoreDeviceTrustAndResendDevicesSendHandleCallsCountLock = NSLock() - private var ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingCallsCount = 0 + private nonisolated(unsafe) var ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingCallsCount = 0 var ignoreDeviceTrustAndResendDevicesSendHandleCallsCount: Int { get { ignoreDeviceTrustAndResendDevicesSendHandleCallsCountLock.withLock { ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingCallsCount } } set { ignoreDeviceTrustAndResendDevicesSendHandleCallsCountLock.withLock { ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingCallsCount = newValue } } @@ -5756,27 +5756,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return ignoreDeviceTrustAndResendDevicesSendHandleCallsCount > 0 } private let ignoreDeviceTrustAndResendDevicesSendHandleReceivedArgumentsLock = NSLock() - private var ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingReceivedArguments: (devices: [String: [String]], sendHandle: SendHandleProxy)? + private nonisolated(unsafe) var ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingReceivedArguments: (devices: [String: [String]], sendHandle: SendHandleProxy)? var ignoreDeviceTrustAndResendDevicesSendHandleReceivedArguments: (devices: [String: [String]], sendHandle: SendHandleProxy)? { get { ignoreDeviceTrustAndResendDevicesSendHandleReceivedArgumentsLock.withLock { ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingReceivedArguments } } set { ignoreDeviceTrustAndResendDevicesSendHandleReceivedArgumentsLock.withLock { ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingReceivedArguments = newValue } } } private let ignoreDeviceTrustAndResendDevicesSendHandleReceivedInvocationsLock = NSLock() - private var ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingReceivedInvocations: [(devices: [String: [String]], sendHandle: SendHandleProxy)] = [] + private nonisolated(unsafe) var ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingReceivedInvocations: [(devices: [String: [String]], sendHandle: SendHandleProxy)] = [] var ignoreDeviceTrustAndResendDevicesSendHandleReceivedInvocations: [(devices: [String: [String]], sendHandle: SendHandleProxy)] { get { ignoreDeviceTrustAndResendDevicesSendHandleReceivedInvocationsLock.withLock { ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingReceivedInvocations } } set { ignoreDeviceTrustAndResendDevicesSendHandleReceivedInvocationsLock.withLock { ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingReceivedInvocations = newValue } } } private let ignoreDeviceTrustAndResendDevicesSendHandleReturnValueLock = NSLock() - private var ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingReturnValue: Result! + private nonisolated(unsafe) var ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingReturnValue: Result! var ignoreDeviceTrustAndResendDevicesSendHandleReturnValue: Result! { get { ignoreDeviceTrustAndResendDevicesSendHandleReturnValueLock.withLock { ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingReturnValue } } set { ignoreDeviceTrustAndResendDevicesSendHandleReturnValueLock.withLock { ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingReturnValue = newValue } } } - var ignoreDeviceTrustAndResendDevicesSendHandleClosure: (([String: [String]], SendHandleProxy) async -> Result)? + nonisolated(unsafe) var ignoreDeviceTrustAndResendDevicesSendHandleClosure: (([String: [String]], SendHandleProxy) async -> Result)? - func ignoreDeviceTrustAndResend(devices: [String: [String]], sendHandle: SendHandleProxy) async -> Result { + @concurrent func ignoreDeviceTrustAndResend(devices: [String: [String]], sendHandle: SendHandleProxy) async -> Result { ignoreDeviceTrustAndResendDevicesSendHandleCallsCountLock.withLock { ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingCallsCount += 1 } ignoreDeviceTrustAndResendDevicesSendHandleReceivedArguments = (devices: devices, sendHandle: sendHandle) ignoreDeviceTrustAndResendDevicesSendHandleReceivedInvocationsLock.withLock { ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingReceivedInvocations.append((devices: devices, sendHandle: sendHandle)) } @@ -5789,7 +5789,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - withdrawVerificationAndResend private let withdrawVerificationAndResendUserIDsSendHandleCallsCountLock = NSLock() - private var withdrawVerificationAndResendUserIDsSendHandleUnderlyingCallsCount = 0 + private nonisolated(unsafe) var withdrawVerificationAndResendUserIDsSendHandleUnderlyingCallsCount = 0 var withdrawVerificationAndResendUserIDsSendHandleCallsCount: Int { get { withdrawVerificationAndResendUserIDsSendHandleCallsCountLock.withLock { withdrawVerificationAndResendUserIDsSendHandleUnderlyingCallsCount } } set { withdrawVerificationAndResendUserIDsSendHandleCallsCountLock.withLock { withdrawVerificationAndResendUserIDsSendHandleUnderlyingCallsCount = newValue } } @@ -5798,27 +5798,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return withdrawVerificationAndResendUserIDsSendHandleCallsCount > 0 } private let withdrawVerificationAndResendUserIDsSendHandleReceivedArgumentsLock = NSLock() - private var withdrawVerificationAndResendUserIDsSendHandleUnderlyingReceivedArguments: (userIDs: [String], sendHandle: SendHandleProxy)? + private nonisolated(unsafe) var withdrawVerificationAndResendUserIDsSendHandleUnderlyingReceivedArguments: (userIDs: [String], sendHandle: SendHandleProxy)? var withdrawVerificationAndResendUserIDsSendHandleReceivedArguments: (userIDs: [String], sendHandle: SendHandleProxy)? { get { withdrawVerificationAndResendUserIDsSendHandleReceivedArgumentsLock.withLock { withdrawVerificationAndResendUserIDsSendHandleUnderlyingReceivedArguments } } set { withdrawVerificationAndResendUserIDsSendHandleReceivedArgumentsLock.withLock { withdrawVerificationAndResendUserIDsSendHandleUnderlyingReceivedArguments = newValue } } } private let withdrawVerificationAndResendUserIDsSendHandleReceivedInvocationsLock = NSLock() - private var withdrawVerificationAndResendUserIDsSendHandleUnderlyingReceivedInvocations: [(userIDs: [String], sendHandle: SendHandleProxy)] = [] + private nonisolated(unsafe) var withdrawVerificationAndResendUserIDsSendHandleUnderlyingReceivedInvocations: [(userIDs: [String], sendHandle: SendHandleProxy)] = [] var withdrawVerificationAndResendUserIDsSendHandleReceivedInvocations: [(userIDs: [String], sendHandle: SendHandleProxy)] { get { withdrawVerificationAndResendUserIDsSendHandleReceivedInvocationsLock.withLock { withdrawVerificationAndResendUserIDsSendHandleUnderlyingReceivedInvocations } } set { withdrawVerificationAndResendUserIDsSendHandleReceivedInvocationsLock.withLock { withdrawVerificationAndResendUserIDsSendHandleUnderlyingReceivedInvocations = newValue } } } private let withdrawVerificationAndResendUserIDsSendHandleReturnValueLock = NSLock() - private var withdrawVerificationAndResendUserIDsSendHandleUnderlyingReturnValue: Result! + private nonisolated(unsafe) var withdrawVerificationAndResendUserIDsSendHandleUnderlyingReturnValue: Result! var withdrawVerificationAndResendUserIDsSendHandleReturnValue: Result! { get { withdrawVerificationAndResendUserIDsSendHandleReturnValueLock.withLock { withdrawVerificationAndResendUserIDsSendHandleUnderlyingReturnValue } } set { withdrawVerificationAndResendUserIDsSendHandleReturnValueLock.withLock { withdrawVerificationAndResendUserIDsSendHandleUnderlyingReturnValue = newValue } } } - var withdrawVerificationAndResendUserIDsSendHandleClosure: (([String], SendHandleProxy) async -> Result)? + nonisolated(unsafe) var withdrawVerificationAndResendUserIDsSendHandleClosure: (([String], SendHandleProxy) async -> Result)? - func withdrawVerificationAndResend(userIDs: [String], sendHandle: SendHandleProxy) async -> Result { + @concurrent func withdrawVerificationAndResend(userIDs: [String], sendHandle: SendHandleProxy) async -> Result { withdrawVerificationAndResendUserIDsSendHandleCallsCountLock.withLock { withdrawVerificationAndResendUserIDsSendHandleUnderlyingCallsCount += 1 } withdrawVerificationAndResendUserIDsSendHandleReceivedArguments = (userIDs: userIDs, sendHandle: sendHandle) withdrawVerificationAndResendUserIDsSendHandleReceivedInvocationsLock.withLock { withdrawVerificationAndResendUserIDsSendHandleUnderlyingReceivedInvocations.append((userIDs: userIDs, sendHandle: sendHandle)) } @@ -5831,7 +5831,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - updateJoinRule private let updateJoinRuleCallsCountLock = NSLock() - private var updateJoinRuleUnderlyingCallsCount = 0 + private nonisolated(unsafe) var updateJoinRuleUnderlyingCallsCount = 0 var updateJoinRuleCallsCount: Int { get { updateJoinRuleCallsCountLock.withLock { updateJoinRuleUnderlyingCallsCount } } set { updateJoinRuleCallsCountLock.withLock { updateJoinRuleUnderlyingCallsCount = newValue } } @@ -5840,27 +5840,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return updateJoinRuleCallsCount > 0 } private let updateJoinRuleReceivedRuleLock = NSLock() - private var updateJoinRuleUnderlyingReceivedRule: JoinRule? + private nonisolated(unsafe) var updateJoinRuleUnderlyingReceivedRule: JoinRule? var updateJoinRuleReceivedRule: JoinRule? { get { updateJoinRuleReceivedRuleLock.withLock { updateJoinRuleUnderlyingReceivedRule } } set { updateJoinRuleReceivedRuleLock.withLock { updateJoinRuleUnderlyingReceivedRule = newValue } } } private let updateJoinRuleReceivedInvocationsLock = NSLock() - private var updateJoinRuleUnderlyingReceivedInvocations: [JoinRule] = [] + private nonisolated(unsafe) var updateJoinRuleUnderlyingReceivedInvocations: [JoinRule] = [] var updateJoinRuleReceivedInvocations: [JoinRule] { get { updateJoinRuleReceivedInvocationsLock.withLock { updateJoinRuleUnderlyingReceivedInvocations } } set { updateJoinRuleReceivedInvocationsLock.withLock { updateJoinRuleUnderlyingReceivedInvocations = newValue } } } private let updateJoinRuleReturnValueLock = NSLock() - private var updateJoinRuleUnderlyingReturnValue: Result! + private nonisolated(unsafe) var updateJoinRuleUnderlyingReturnValue: Result! var updateJoinRuleReturnValue: Result! { get { updateJoinRuleReturnValueLock.withLock { updateJoinRuleUnderlyingReturnValue } } set { updateJoinRuleReturnValueLock.withLock { updateJoinRuleUnderlyingReturnValue = newValue } } } - var updateJoinRuleClosure: ((JoinRule) async -> Result)? + nonisolated(unsafe) var updateJoinRuleClosure: ((JoinRule) async -> Result)? - func updateJoinRule(_ rule: JoinRule) async -> Result { + @concurrent func updateJoinRule(_ rule: JoinRule) async -> Result { updateJoinRuleCallsCountLock.withLock { updateJoinRuleUnderlyingCallsCount += 1 } updateJoinRuleReceivedRule = rule updateJoinRuleReceivedInvocationsLock.withLock { updateJoinRuleUnderlyingReceivedInvocations.append(rule) } @@ -5873,7 +5873,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - updateHistoryVisibility private let updateHistoryVisibilityCallsCountLock = NSLock() - private var updateHistoryVisibilityUnderlyingCallsCount = 0 + private nonisolated(unsafe) var updateHistoryVisibilityUnderlyingCallsCount = 0 var updateHistoryVisibilityCallsCount: Int { get { updateHistoryVisibilityCallsCountLock.withLock { updateHistoryVisibilityUnderlyingCallsCount } } set { updateHistoryVisibilityCallsCountLock.withLock { updateHistoryVisibilityUnderlyingCallsCount = newValue } } @@ -5882,27 +5882,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return updateHistoryVisibilityCallsCount > 0 } private let updateHistoryVisibilityReceivedVisibilityLock = NSLock() - private var updateHistoryVisibilityUnderlyingReceivedVisibility: RoomHistoryVisibility? + private nonisolated(unsafe) var updateHistoryVisibilityUnderlyingReceivedVisibility: RoomHistoryVisibility? var updateHistoryVisibilityReceivedVisibility: RoomHistoryVisibility? { get { updateHistoryVisibilityReceivedVisibilityLock.withLock { updateHistoryVisibilityUnderlyingReceivedVisibility } } set { updateHistoryVisibilityReceivedVisibilityLock.withLock { updateHistoryVisibilityUnderlyingReceivedVisibility = newValue } } } private let updateHistoryVisibilityReceivedInvocationsLock = NSLock() - private var updateHistoryVisibilityUnderlyingReceivedInvocations: [RoomHistoryVisibility] = [] + private nonisolated(unsafe) var updateHistoryVisibilityUnderlyingReceivedInvocations: [RoomHistoryVisibility] = [] var updateHistoryVisibilityReceivedInvocations: [RoomHistoryVisibility] { get { updateHistoryVisibilityReceivedInvocationsLock.withLock { updateHistoryVisibilityUnderlyingReceivedInvocations } } set { updateHistoryVisibilityReceivedInvocationsLock.withLock { updateHistoryVisibilityUnderlyingReceivedInvocations = newValue } } } private let updateHistoryVisibilityReturnValueLock = NSLock() - private var updateHistoryVisibilityUnderlyingReturnValue: Result! + private nonisolated(unsafe) var updateHistoryVisibilityUnderlyingReturnValue: Result! var updateHistoryVisibilityReturnValue: Result! { get { updateHistoryVisibilityReturnValueLock.withLock { updateHistoryVisibilityUnderlyingReturnValue } } set { updateHistoryVisibilityReturnValueLock.withLock { updateHistoryVisibilityUnderlyingReturnValue = newValue } } } - var updateHistoryVisibilityClosure: ((RoomHistoryVisibility) async -> Result)? + nonisolated(unsafe) var updateHistoryVisibilityClosure: ((RoomHistoryVisibility) async -> Result)? - func updateHistoryVisibility(_ visibility: RoomHistoryVisibility) async -> Result { + @concurrent func updateHistoryVisibility(_ visibility: RoomHistoryVisibility) async -> Result { updateHistoryVisibilityCallsCountLock.withLock { updateHistoryVisibilityUnderlyingCallsCount += 1 } updateHistoryVisibilityReceivedVisibility = visibility updateHistoryVisibilityReceivedInvocationsLock.withLock { updateHistoryVisibilityUnderlyingReceivedInvocations.append(visibility) } @@ -5915,7 +5915,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - isVisibleInRoomDirectory private let isVisibleInRoomDirectoryCallsCountLock = NSLock() - private var isVisibleInRoomDirectoryUnderlyingCallsCount = 0 + private nonisolated(unsafe) var isVisibleInRoomDirectoryUnderlyingCallsCount = 0 var isVisibleInRoomDirectoryCallsCount: Int { get { isVisibleInRoomDirectoryCallsCountLock.withLock { isVisibleInRoomDirectoryUnderlyingCallsCount } } set { isVisibleInRoomDirectoryCallsCountLock.withLock { isVisibleInRoomDirectoryUnderlyingCallsCount = newValue } } @@ -5925,14 +5925,14 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { } private let isVisibleInRoomDirectoryReturnValueLock = NSLock() - private var isVisibleInRoomDirectoryUnderlyingReturnValue: Result! + private nonisolated(unsafe) var isVisibleInRoomDirectoryUnderlyingReturnValue: Result! var isVisibleInRoomDirectoryReturnValue: Result! { get { isVisibleInRoomDirectoryReturnValueLock.withLock { isVisibleInRoomDirectoryUnderlyingReturnValue } } set { isVisibleInRoomDirectoryReturnValueLock.withLock { isVisibleInRoomDirectoryUnderlyingReturnValue = newValue } } } - var isVisibleInRoomDirectoryClosure: (() async -> Result)? + nonisolated(unsafe) var isVisibleInRoomDirectoryClosure: (() async -> Result)? - func isVisibleInRoomDirectory() async -> Result { + @concurrent func isVisibleInRoomDirectory() async -> Result { isVisibleInRoomDirectoryCallsCountLock.withLock { isVisibleInRoomDirectoryUnderlyingCallsCount += 1 } if let isVisibleInRoomDirectoryClosure = isVisibleInRoomDirectoryClosure { return await isVisibleInRoomDirectoryClosure() @@ -5943,7 +5943,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - updateRoomDirectoryVisibility private let updateRoomDirectoryVisibilityCallsCountLock = NSLock() - private var updateRoomDirectoryVisibilityUnderlyingCallsCount = 0 + private nonisolated(unsafe) var updateRoomDirectoryVisibilityUnderlyingCallsCount = 0 var updateRoomDirectoryVisibilityCallsCount: Int { get { updateRoomDirectoryVisibilityCallsCountLock.withLock { updateRoomDirectoryVisibilityUnderlyingCallsCount } } set { updateRoomDirectoryVisibilityCallsCountLock.withLock { updateRoomDirectoryVisibilityUnderlyingCallsCount = newValue } } @@ -5952,27 +5952,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return updateRoomDirectoryVisibilityCallsCount > 0 } private let updateRoomDirectoryVisibilityReceivedVisibilityLock = NSLock() - private var updateRoomDirectoryVisibilityUnderlyingReceivedVisibility: RoomVisibility? + private nonisolated(unsafe) var updateRoomDirectoryVisibilityUnderlyingReceivedVisibility: RoomVisibility? var updateRoomDirectoryVisibilityReceivedVisibility: RoomVisibility? { get { updateRoomDirectoryVisibilityReceivedVisibilityLock.withLock { updateRoomDirectoryVisibilityUnderlyingReceivedVisibility } } set { updateRoomDirectoryVisibilityReceivedVisibilityLock.withLock { updateRoomDirectoryVisibilityUnderlyingReceivedVisibility = newValue } } } private let updateRoomDirectoryVisibilityReceivedInvocationsLock = NSLock() - private var updateRoomDirectoryVisibilityUnderlyingReceivedInvocations: [RoomVisibility] = [] + private nonisolated(unsafe) var updateRoomDirectoryVisibilityUnderlyingReceivedInvocations: [RoomVisibility] = [] var updateRoomDirectoryVisibilityReceivedInvocations: [RoomVisibility] { get { updateRoomDirectoryVisibilityReceivedInvocationsLock.withLock { updateRoomDirectoryVisibilityUnderlyingReceivedInvocations } } set { updateRoomDirectoryVisibilityReceivedInvocationsLock.withLock { updateRoomDirectoryVisibilityUnderlyingReceivedInvocations = newValue } } } private let updateRoomDirectoryVisibilityReturnValueLock = NSLock() - private var updateRoomDirectoryVisibilityUnderlyingReturnValue: Result! + private nonisolated(unsafe) var updateRoomDirectoryVisibilityUnderlyingReturnValue: Result! var updateRoomDirectoryVisibilityReturnValue: Result! { get { updateRoomDirectoryVisibilityReturnValueLock.withLock { updateRoomDirectoryVisibilityUnderlyingReturnValue } } set { updateRoomDirectoryVisibilityReturnValueLock.withLock { updateRoomDirectoryVisibilityUnderlyingReturnValue = newValue } } } - var updateRoomDirectoryVisibilityClosure: ((RoomVisibility) async -> Result)? + nonisolated(unsafe) var updateRoomDirectoryVisibilityClosure: ((RoomVisibility) async -> Result)? - func updateRoomDirectoryVisibility(_ visibility: RoomVisibility) async -> Result { + @concurrent func updateRoomDirectoryVisibility(_ visibility: RoomVisibility) async -> Result { updateRoomDirectoryVisibilityCallsCountLock.withLock { updateRoomDirectoryVisibilityUnderlyingCallsCount += 1 } updateRoomDirectoryVisibilityReceivedVisibility = visibility updateRoomDirectoryVisibilityReceivedInvocationsLock.withLock { updateRoomDirectoryVisibilityUnderlyingReceivedInvocations.append(visibility) } @@ -5985,7 +5985,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - updateCanonicalAlias private let updateCanonicalAliasAltAliasesCallsCountLock = NSLock() - private var updateCanonicalAliasAltAliasesUnderlyingCallsCount = 0 + private nonisolated(unsafe) var updateCanonicalAliasAltAliasesUnderlyingCallsCount = 0 var updateCanonicalAliasAltAliasesCallsCount: Int { get { updateCanonicalAliasAltAliasesCallsCountLock.withLock { updateCanonicalAliasAltAliasesUnderlyingCallsCount } } set { updateCanonicalAliasAltAliasesCallsCountLock.withLock { updateCanonicalAliasAltAliasesUnderlyingCallsCount = newValue } } @@ -5994,27 +5994,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return updateCanonicalAliasAltAliasesCallsCount > 0 } private let updateCanonicalAliasAltAliasesReceivedArgumentsLock = NSLock() - private var updateCanonicalAliasAltAliasesUnderlyingReceivedArguments: (alias: String?, altAliases: [String])? + private nonisolated(unsafe) var updateCanonicalAliasAltAliasesUnderlyingReceivedArguments: (alias: String?, altAliases: [String])? var updateCanonicalAliasAltAliasesReceivedArguments: (alias: String?, altAliases: [String])? { get { updateCanonicalAliasAltAliasesReceivedArgumentsLock.withLock { updateCanonicalAliasAltAliasesUnderlyingReceivedArguments } } set { updateCanonicalAliasAltAliasesReceivedArgumentsLock.withLock { updateCanonicalAliasAltAliasesUnderlyingReceivedArguments = newValue } } } private let updateCanonicalAliasAltAliasesReceivedInvocationsLock = NSLock() - private var updateCanonicalAliasAltAliasesUnderlyingReceivedInvocations: [(alias: String?, altAliases: [String])] = [] + private nonisolated(unsafe) var updateCanonicalAliasAltAliasesUnderlyingReceivedInvocations: [(alias: String?, altAliases: [String])] = [] var updateCanonicalAliasAltAliasesReceivedInvocations: [(alias: String?, altAliases: [String])] { get { updateCanonicalAliasAltAliasesReceivedInvocationsLock.withLock { updateCanonicalAliasAltAliasesUnderlyingReceivedInvocations } } set { updateCanonicalAliasAltAliasesReceivedInvocationsLock.withLock { updateCanonicalAliasAltAliasesUnderlyingReceivedInvocations = newValue } } } private let updateCanonicalAliasAltAliasesReturnValueLock = NSLock() - private var updateCanonicalAliasAltAliasesUnderlyingReturnValue: Result! + private nonisolated(unsafe) var updateCanonicalAliasAltAliasesUnderlyingReturnValue: Result! var updateCanonicalAliasAltAliasesReturnValue: Result! { get { updateCanonicalAliasAltAliasesReturnValueLock.withLock { updateCanonicalAliasAltAliasesUnderlyingReturnValue } } set { updateCanonicalAliasAltAliasesReturnValueLock.withLock { updateCanonicalAliasAltAliasesUnderlyingReturnValue = newValue } } } - var updateCanonicalAliasAltAliasesClosure: ((String?, [String]) async -> Result)? + nonisolated(unsafe) var updateCanonicalAliasAltAliasesClosure: ((String?, [String]) async -> Result)? - func updateCanonicalAlias(_ alias: String?, altAliases: [String]) async -> Result { + @concurrent func updateCanonicalAlias(_ alias: String?, altAliases: [String]) async -> Result { updateCanonicalAliasAltAliasesCallsCountLock.withLock { updateCanonicalAliasAltAliasesUnderlyingCallsCount += 1 } updateCanonicalAliasAltAliasesReceivedArguments = (alias: alias, altAliases: altAliases) updateCanonicalAliasAltAliasesReceivedInvocationsLock.withLock { updateCanonicalAliasAltAliasesUnderlyingReceivedInvocations.append((alias: alias, altAliases: altAliases)) } @@ -6027,7 +6027,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - publishRoomAliasInRoomDirectory private let publishRoomAliasInRoomDirectoryCallsCountLock = NSLock() - private var publishRoomAliasInRoomDirectoryUnderlyingCallsCount = 0 + private nonisolated(unsafe) var publishRoomAliasInRoomDirectoryUnderlyingCallsCount = 0 var publishRoomAliasInRoomDirectoryCallsCount: Int { get { publishRoomAliasInRoomDirectoryCallsCountLock.withLock { publishRoomAliasInRoomDirectoryUnderlyingCallsCount } } set { publishRoomAliasInRoomDirectoryCallsCountLock.withLock { publishRoomAliasInRoomDirectoryUnderlyingCallsCount = newValue } } @@ -6036,27 +6036,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return publishRoomAliasInRoomDirectoryCallsCount > 0 } private let publishRoomAliasInRoomDirectoryReceivedAliasLock = NSLock() - private var publishRoomAliasInRoomDirectoryUnderlyingReceivedAlias: String? + private nonisolated(unsafe) var publishRoomAliasInRoomDirectoryUnderlyingReceivedAlias: String? var publishRoomAliasInRoomDirectoryReceivedAlias: String? { get { publishRoomAliasInRoomDirectoryReceivedAliasLock.withLock { publishRoomAliasInRoomDirectoryUnderlyingReceivedAlias } } set { publishRoomAliasInRoomDirectoryReceivedAliasLock.withLock { publishRoomAliasInRoomDirectoryUnderlyingReceivedAlias = newValue } } } private let publishRoomAliasInRoomDirectoryReceivedInvocationsLock = NSLock() - private var publishRoomAliasInRoomDirectoryUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var publishRoomAliasInRoomDirectoryUnderlyingReceivedInvocations: [String] = [] var publishRoomAliasInRoomDirectoryReceivedInvocations: [String] { get { publishRoomAliasInRoomDirectoryReceivedInvocationsLock.withLock { publishRoomAliasInRoomDirectoryUnderlyingReceivedInvocations } } set { publishRoomAliasInRoomDirectoryReceivedInvocationsLock.withLock { publishRoomAliasInRoomDirectoryUnderlyingReceivedInvocations = newValue } } } private let publishRoomAliasInRoomDirectoryReturnValueLock = NSLock() - private var publishRoomAliasInRoomDirectoryUnderlyingReturnValue: Result! + private nonisolated(unsafe) var publishRoomAliasInRoomDirectoryUnderlyingReturnValue: Result! var publishRoomAliasInRoomDirectoryReturnValue: Result! { get { publishRoomAliasInRoomDirectoryReturnValueLock.withLock { publishRoomAliasInRoomDirectoryUnderlyingReturnValue } } set { publishRoomAliasInRoomDirectoryReturnValueLock.withLock { publishRoomAliasInRoomDirectoryUnderlyingReturnValue = newValue } } } - var publishRoomAliasInRoomDirectoryClosure: ((String) async -> Result)? + nonisolated(unsafe) var publishRoomAliasInRoomDirectoryClosure: ((String) async -> Result)? - func publishRoomAliasInRoomDirectory(_ alias: String) async -> Result { + @concurrent func publishRoomAliasInRoomDirectory(_ alias: String) async -> Result { publishRoomAliasInRoomDirectoryCallsCountLock.withLock { publishRoomAliasInRoomDirectoryUnderlyingCallsCount += 1 } publishRoomAliasInRoomDirectoryReceivedAlias = alias publishRoomAliasInRoomDirectoryReceivedInvocationsLock.withLock { publishRoomAliasInRoomDirectoryUnderlyingReceivedInvocations.append(alias) } @@ -6069,7 +6069,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - removeRoomAliasFromRoomDirectory private let removeRoomAliasFromRoomDirectoryCallsCountLock = NSLock() - private var removeRoomAliasFromRoomDirectoryUnderlyingCallsCount = 0 + private nonisolated(unsafe) var removeRoomAliasFromRoomDirectoryUnderlyingCallsCount = 0 var removeRoomAliasFromRoomDirectoryCallsCount: Int { get { removeRoomAliasFromRoomDirectoryCallsCountLock.withLock { removeRoomAliasFromRoomDirectoryUnderlyingCallsCount } } set { removeRoomAliasFromRoomDirectoryCallsCountLock.withLock { removeRoomAliasFromRoomDirectoryUnderlyingCallsCount = newValue } } @@ -6078,27 +6078,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return removeRoomAliasFromRoomDirectoryCallsCount > 0 } private let removeRoomAliasFromRoomDirectoryReceivedAliasLock = NSLock() - private var removeRoomAliasFromRoomDirectoryUnderlyingReceivedAlias: String? + private nonisolated(unsafe) var removeRoomAliasFromRoomDirectoryUnderlyingReceivedAlias: String? var removeRoomAliasFromRoomDirectoryReceivedAlias: String? { get { removeRoomAliasFromRoomDirectoryReceivedAliasLock.withLock { removeRoomAliasFromRoomDirectoryUnderlyingReceivedAlias } } set { removeRoomAliasFromRoomDirectoryReceivedAliasLock.withLock { removeRoomAliasFromRoomDirectoryUnderlyingReceivedAlias = newValue } } } private let removeRoomAliasFromRoomDirectoryReceivedInvocationsLock = NSLock() - private var removeRoomAliasFromRoomDirectoryUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var removeRoomAliasFromRoomDirectoryUnderlyingReceivedInvocations: [String] = [] var removeRoomAliasFromRoomDirectoryReceivedInvocations: [String] { get { removeRoomAliasFromRoomDirectoryReceivedInvocationsLock.withLock { removeRoomAliasFromRoomDirectoryUnderlyingReceivedInvocations } } set { removeRoomAliasFromRoomDirectoryReceivedInvocationsLock.withLock { removeRoomAliasFromRoomDirectoryUnderlyingReceivedInvocations = newValue } } } private let removeRoomAliasFromRoomDirectoryReturnValueLock = NSLock() - private var removeRoomAliasFromRoomDirectoryUnderlyingReturnValue: Result! + private nonisolated(unsafe) var removeRoomAliasFromRoomDirectoryUnderlyingReturnValue: Result! var removeRoomAliasFromRoomDirectoryReturnValue: Result! { get { removeRoomAliasFromRoomDirectoryReturnValueLock.withLock { removeRoomAliasFromRoomDirectoryUnderlyingReturnValue } } set { removeRoomAliasFromRoomDirectoryReturnValueLock.withLock { removeRoomAliasFromRoomDirectoryUnderlyingReturnValue = newValue } } } - var removeRoomAliasFromRoomDirectoryClosure: ((String) async -> Result)? + nonisolated(unsafe) var removeRoomAliasFromRoomDirectoryClosure: ((String) async -> Result)? - func removeRoomAliasFromRoomDirectory(_ alias: String) async -> Result { + @concurrent func removeRoomAliasFromRoomDirectory(_ alias: String) async -> Result { removeRoomAliasFromRoomDirectoryCallsCountLock.withLock { removeRoomAliasFromRoomDirectoryUnderlyingCallsCount += 1 } removeRoomAliasFromRoomDirectoryReceivedAlias = alias removeRoomAliasFromRoomDirectoryReceivedInvocationsLock.withLock { removeRoomAliasFromRoomDirectoryUnderlyingReceivedInvocations.append(alias) } @@ -6111,7 +6111,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - flagAsUnread private let flagAsUnreadCallsCountLock = NSLock() - private var flagAsUnreadUnderlyingCallsCount = 0 + private nonisolated(unsafe) var flagAsUnreadUnderlyingCallsCount = 0 var flagAsUnreadCallsCount: Int { get { flagAsUnreadCallsCountLock.withLock { flagAsUnreadUnderlyingCallsCount } } set { flagAsUnreadCallsCountLock.withLock { flagAsUnreadUnderlyingCallsCount = newValue } } @@ -6120,27 +6120,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return flagAsUnreadCallsCount > 0 } private let flagAsUnreadReceivedIsUnreadLock = NSLock() - private var flagAsUnreadUnderlyingReceivedIsUnread: Bool? + private nonisolated(unsafe) var flagAsUnreadUnderlyingReceivedIsUnread: Bool? var flagAsUnreadReceivedIsUnread: Bool? { get { flagAsUnreadReceivedIsUnreadLock.withLock { flagAsUnreadUnderlyingReceivedIsUnread } } set { flagAsUnreadReceivedIsUnreadLock.withLock { flagAsUnreadUnderlyingReceivedIsUnread = newValue } } } private let flagAsUnreadReceivedInvocationsLock = NSLock() - private var flagAsUnreadUnderlyingReceivedInvocations: [Bool] = [] + private nonisolated(unsafe) var flagAsUnreadUnderlyingReceivedInvocations: [Bool] = [] var flagAsUnreadReceivedInvocations: [Bool] { get { flagAsUnreadReceivedInvocationsLock.withLock { flagAsUnreadUnderlyingReceivedInvocations } } set { flagAsUnreadReceivedInvocationsLock.withLock { flagAsUnreadUnderlyingReceivedInvocations = newValue } } } private let flagAsUnreadReturnValueLock = NSLock() - private var flagAsUnreadUnderlyingReturnValue: Result! + private nonisolated(unsafe) var flagAsUnreadUnderlyingReturnValue: Result! var flagAsUnreadReturnValue: Result! { get { flagAsUnreadReturnValueLock.withLock { flagAsUnreadUnderlyingReturnValue } } set { flagAsUnreadReturnValueLock.withLock { flagAsUnreadUnderlyingReturnValue = newValue } } } - var flagAsUnreadClosure: ((Bool) async -> Result)? + nonisolated(unsafe) var flagAsUnreadClosure: ((Bool) async -> Result)? - func flagAsUnread(_ isUnread: Bool) async -> Result { + @concurrent func flagAsUnread(_ isUnread: Bool) async -> Result { flagAsUnreadCallsCountLock.withLock { flagAsUnreadUnderlyingCallsCount += 1 } flagAsUnreadReceivedIsUnread = isUnread flagAsUnreadReceivedInvocationsLock.withLock { flagAsUnreadUnderlyingReceivedInvocations.append(isUnread) } @@ -6153,7 +6153,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - flagAsFavourite private let flagAsFavouriteCallsCountLock = NSLock() - private var flagAsFavouriteUnderlyingCallsCount = 0 + private nonisolated(unsafe) var flagAsFavouriteUnderlyingCallsCount = 0 var flagAsFavouriteCallsCount: Int { get { flagAsFavouriteCallsCountLock.withLock { flagAsFavouriteUnderlyingCallsCount } } set { flagAsFavouriteCallsCountLock.withLock { flagAsFavouriteUnderlyingCallsCount = newValue } } @@ -6162,27 +6162,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return flagAsFavouriteCallsCount > 0 } private let flagAsFavouriteReceivedIsFavouriteLock = NSLock() - private var flagAsFavouriteUnderlyingReceivedIsFavourite: Bool? + private nonisolated(unsafe) var flagAsFavouriteUnderlyingReceivedIsFavourite: Bool? var flagAsFavouriteReceivedIsFavourite: Bool? { get { flagAsFavouriteReceivedIsFavouriteLock.withLock { flagAsFavouriteUnderlyingReceivedIsFavourite } } set { flagAsFavouriteReceivedIsFavouriteLock.withLock { flagAsFavouriteUnderlyingReceivedIsFavourite = newValue } } } private let flagAsFavouriteReceivedInvocationsLock = NSLock() - private var flagAsFavouriteUnderlyingReceivedInvocations: [Bool] = [] + private nonisolated(unsafe) var flagAsFavouriteUnderlyingReceivedInvocations: [Bool] = [] var flagAsFavouriteReceivedInvocations: [Bool] { get { flagAsFavouriteReceivedInvocationsLock.withLock { flagAsFavouriteUnderlyingReceivedInvocations } } set { flagAsFavouriteReceivedInvocationsLock.withLock { flagAsFavouriteUnderlyingReceivedInvocations = newValue } } } private let flagAsFavouriteReturnValueLock = NSLock() - private var flagAsFavouriteUnderlyingReturnValue: Result! + private nonisolated(unsafe) var flagAsFavouriteUnderlyingReturnValue: Result! var flagAsFavouriteReturnValue: Result! { get { flagAsFavouriteReturnValueLock.withLock { flagAsFavouriteUnderlyingReturnValue } } set { flagAsFavouriteReturnValueLock.withLock { flagAsFavouriteUnderlyingReturnValue = newValue } } } - var flagAsFavouriteClosure: ((Bool) async -> Result)? + nonisolated(unsafe) var flagAsFavouriteClosure: ((Bool) async -> Result)? - func flagAsFavourite(_ isFavourite: Bool) async -> Result { + @concurrent func flagAsFavourite(_ isFavourite: Bool) async -> Result { flagAsFavouriteCallsCountLock.withLock { flagAsFavouriteUnderlyingCallsCount += 1 } flagAsFavouriteReceivedIsFavourite = isFavourite flagAsFavouriteReceivedInvocationsLock.withLock { flagAsFavouriteUnderlyingReceivedInvocations.append(isFavourite) } @@ -6195,7 +6195,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - powerLevels private let powerLevelsCallsCountLock = NSLock() - private var powerLevelsUnderlyingCallsCount = 0 + private nonisolated(unsafe) var powerLevelsUnderlyingCallsCount = 0 var powerLevelsCallsCount: Int { get { powerLevelsCallsCountLock.withLock { powerLevelsUnderlyingCallsCount } } set { powerLevelsCallsCountLock.withLock { powerLevelsUnderlyingCallsCount = newValue } } @@ -6205,14 +6205,14 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { } private let powerLevelsReturnValueLock = NSLock() - private var powerLevelsUnderlyingReturnValue: Result! + private nonisolated(unsafe) var powerLevelsUnderlyingReturnValue: Result! var powerLevelsReturnValue: Result! { get { powerLevelsReturnValueLock.withLock { powerLevelsUnderlyingReturnValue } } set { powerLevelsReturnValueLock.withLock { powerLevelsUnderlyingReturnValue = newValue } } } - var powerLevelsClosure: (() async -> Result)? + nonisolated(unsafe) var powerLevelsClosure: (() async -> Result)? - func powerLevels() async -> Result { + @concurrent func powerLevels() async -> Result { powerLevelsCallsCountLock.withLock { powerLevelsUnderlyingCallsCount += 1 } if let powerLevelsClosure = powerLevelsClosure { return await powerLevelsClosure() @@ -6223,7 +6223,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - applyPowerLevelChanges private let applyPowerLevelChangesCallsCountLock = NSLock() - private var applyPowerLevelChangesUnderlyingCallsCount = 0 + private nonisolated(unsafe) var applyPowerLevelChangesUnderlyingCallsCount = 0 var applyPowerLevelChangesCallsCount: Int { get { applyPowerLevelChangesCallsCountLock.withLock { applyPowerLevelChangesUnderlyingCallsCount } } set { applyPowerLevelChangesCallsCountLock.withLock { applyPowerLevelChangesUnderlyingCallsCount = newValue } } @@ -6232,27 +6232,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return applyPowerLevelChangesCallsCount > 0 } private let applyPowerLevelChangesReceivedChangesLock = NSLock() - private var applyPowerLevelChangesUnderlyingReceivedChanges: RoomPowerLevelChanges? + private nonisolated(unsafe) var applyPowerLevelChangesUnderlyingReceivedChanges: RoomPowerLevelChanges? var applyPowerLevelChangesReceivedChanges: RoomPowerLevelChanges? { get { applyPowerLevelChangesReceivedChangesLock.withLock { applyPowerLevelChangesUnderlyingReceivedChanges } } set { applyPowerLevelChangesReceivedChangesLock.withLock { applyPowerLevelChangesUnderlyingReceivedChanges = newValue } } } private let applyPowerLevelChangesReceivedInvocationsLock = NSLock() - private var applyPowerLevelChangesUnderlyingReceivedInvocations: [RoomPowerLevelChanges] = [] + private nonisolated(unsafe) var applyPowerLevelChangesUnderlyingReceivedInvocations: [RoomPowerLevelChanges] = [] var applyPowerLevelChangesReceivedInvocations: [RoomPowerLevelChanges] { get { applyPowerLevelChangesReceivedInvocationsLock.withLock { applyPowerLevelChangesUnderlyingReceivedInvocations } } set { applyPowerLevelChangesReceivedInvocationsLock.withLock { applyPowerLevelChangesUnderlyingReceivedInvocations = newValue } } } private let applyPowerLevelChangesReturnValueLock = NSLock() - private var applyPowerLevelChangesUnderlyingReturnValue: Result! + private nonisolated(unsafe) var applyPowerLevelChangesUnderlyingReturnValue: Result! var applyPowerLevelChangesReturnValue: Result! { get { applyPowerLevelChangesReturnValueLock.withLock { applyPowerLevelChangesUnderlyingReturnValue } } set { applyPowerLevelChangesReturnValueLock.withLock { applyPowerLevelChangesUnderlyingReturnValue = newValue } } } - var applyPowerLevelChangesClosure: ((RoomPowerLevelChanges) async -> Result)? + nonisolated(unsafe) var applyPowerLevelChangesClosure: ((RoomPowerLevelChanges) async -> Result)? - func applyPowerLevelChanges(_ changes: RoomPowerLevelChanges) async -> Result { + @concurrent func applyPowerLevelChanges(_ changes: RoomPowerLevelChanges) async -> Result { applyPowerLevelChangesCallsCountLock.withLock { applyPowerLevelChangesUnderlyingCallsCount += 1 } applyPowerLevelChangesReceivedChanges = changes applyPowerLevelChangesReceivedInvocationsLock.withLock { applyPowerLevelChangesUnderlyingReceivedInvocations.append(changes) } @@ -6265,7 +6265,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - resetPowerLevels private let resetPowerLevelsCallsCountLock = NSLock() - private var resetPowerLevelsUnderlyingCallsCount = 0 + private nonisolated(unsafe) var resetPowerLevelsUnderlyingCallsCount = 0 var resetPowerLevelsCallsCount: Int { get { resetPowerLevelsCallsCountLock.withLock { resetPowerLevelsUnderlyingCallsCount } } set { resetPowerLevelsCallsCountLock.withLock { resetPowerLevelsUnderlyingCallsCount = newValue } } @@ -6275,14 +6275,14 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { } private let resetPowerLevelsReturnValueLock = NSLock() - private var resetPowerLevelsUnderlyingReturnValue: Result! + private nonisolated(unsafe) var resetPowerLevelsUnderlyingReturnValue: Result! var resetPowerLevelsReturnValue: Result! { get { resetPowerLevelsReturnValueLock.withLock { resetPowerLevelsUnderlyingReturnValue } } set { resetPowerLevelsReturnValueLock.withLock { resetPowerLevelsUnderlyingReturnValue = newValue } } } - var resetPowerLevelsClosure: (() async -> Result)? + nonisolated(unsafe) var resetPowerLevelsClosure: (() async -> Result)? - func resetPowerLevels() async -> Result { + @concurrent func resetPowerLevels() async -> Result { resetPowerLevelsCallsCountLock.withLock { resetPowerLevelsUnderlyingCallsCount += 1 } if let resetPowerLevelsClosure = resetPowerLevelsClosure { return await resetPowerLevelsClosure() @@ -6293,7 +6293,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - suggestedRole private let suggestedRoleForCallsCountLock = NSLock() - private var suggestedRoleForUnderlyingCallsCount = 0 + private nonisolated(unsafe) var suggestedRoleForUnderlyingCallsCount = 0 var suggestedRoleForCallsCount: Int { get { suggestedRoleForCallsCountLock.withLock { suggestedRoleForUnderlyingCallsCount } } set { suggestedRoleForCallsCountLock.withLock { suggestedRoleForUnderlyingCallsCount = newValue } } @@ -6302,27 +6302,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return suggestedRoleForCallsCount > 0 } private let suggestedRoleForReceivedUserIDLock = NSLock() - private var suggestedRoleForUnderlyingReceivedUserID: String? + private nonisolated(unsafe) var suggestedRoleForUnderlyingReceivedUserID: String? var suggestedRoleForReceivedUserID: String? { get { suggestedRoleForReceivedUserIDLock.withLock { suggestedRoleForUnderlyingReceivedUserID } } set { suggestedRoleForReceivedUserIDLock.withLock { suggestedRoleForUnderlyingReceivedUserID = newValue } } } private let suggestedRoleForReceivedInvocationsLock = NSLock() - private var suggestedRoleForUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var suggestedRoleForUnderlyingReceivedInvocations: [String] = [] var suggestedRoleForReceivedInvocations: [String] { get { suggestedRoleForReceivedInvocationsLock.withLock { suggestedRoleForUnderlyingReceivedInvocations } } set { suggestedRoleForReceivedInvocationsLock.withLock { suggestedRoleForUnderlyingReceivedInvocations = newValue } } } private let suggestedRoleForReturnValueLock = NSLock() - private var suggestedRoleForUnderlyingReturnValue: Result! + private nonisolated(unsafe) var suggestedRoleForUnderlyingReturnValue: Result! var suggestedRoleForReturnValue: Result! { get { suggestedRoleForReturnValueLock.withLock { suggestedRoleForUnderlyingReturnValue } } set { suggestedRoleForReturnValueLock.withLock { suggestedRoleForUnderlyingReturnValue = newValue } } } - var suggestedRoleForClosure: ((String) async -> Result)? + nonisolated(unsafe) var suggestedRoleForClosure: ((String) async -> Result)? - func suggestedRole(for userID: String) async -> Result { + @concurrent func suggestedRole(for userID: String) async -> Result { suggestedRoleForCallsCountLock.withLock { suggestedRoleForUnderlyingCallsCount += 1 } suggestedRoleForReceivedUserID = userID suggestedRoleForReceivedInvocationsLock.withLock { suggestedRoleForUnderlyingReceivedInvocations.append(userID) } @@ -6335,7 +6335,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - updatePowerLevelsForUsers private let updatePowerLevelsForUsersCallsCountLock = NSLock() - private var updatePowerLevelsForUsersUnderlyingCallsCount = 0 + private nonisolated(unsafe) var updatePowerLevelsForUsersUnderlyingCallsCount = 0 var updatePowerLevelsForUsersCallsCount: Int { get { updatePowerLevelsForUsersCallsCountLock.withLock { updatePowerLevelsForUsersUnderlyingCallsCount } } set { updatePowerLevelsForUsersCallsCountLock.withLock { updatePowerLevelsForUsersUnderlyingCallsCount = newValue } } @@ -6344,27 +6344,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return updatePowerLevelsForUsersCallsCount > 0 } private let updatePowerLevelsForUsersReceivedUpdatesLock = NSLock() - private var updatePowerLevelsForUsersUnderlyingReceivedUpdates: [(userID: String, powerLevel: Int64)]? + private nonisolated(unsafe) var updatePowerLevelsForUsersUnderlyingReceivedUpdates: [(userID: String, powerLevel: Int64)]? var updatePowerLevelsForUsersReceivedUpdates: [(userID: String, powerLevel: Int64)]? { get { updatePowerLevelsForUsersReceivedUpdatesLock.withLock { updatePowerLevelsForUsersUnderlyingReceivedUpdates } } set { updatePowerLevelsForUsersReceivedUpdatesLock.withLock { updatePowerLevelsForUsersUnderlyingReceivedUpdates = newValue } } } private let updatePowerLevelsForUsersReceivedInvocationsLock = NSLock() - private var updatePowerLevelsForUsersUnderlyingReceivedInvocations: [[(userID: String, powerLevel: Int64)]] = [] + private nonisolated(unsafe) var updatePowerLevelsForUsersUnderlyingReceivedInvocations: [[(userID: String, powerLevel: Int64)]] = [] var updatePowerLevelsForUsersReceivedInvocations: [[(userID: String, powerLevel: Int64)]] { get { updatePowerLevelsForUsersReceivedInvocationsLock.withLock { updatePowerLevelsForUsersUnderlyingReceivedInvocations } } set { updatePowerLevelsForUsersReceivedInvocationsLock.withLock { updatePowerLevelsForUsersUnderlyingReceivedInvocations = newValue } } } private let updatePowerLevelsForUsersReturnValueLock = NSLock() - private var updatePowerLevelsForUsersUnderlyingReturnValue: Result! + private nonisolated(unsafe) var updatePowerLevelsForUsersUnderlyingReturnValue: Result! var updatePowerLevelsForUsersReturnValue: Result! { get { updatePowerLevelsForUsersReturnValueLock.withLock { updatePowerLevelsForUsersUnderlyingReturnValue } } set { updatePowerLevelsForUsersReturnValueLock.withLock { updatePowerLevelsForUsersUnderlyingReturnValue = newValue } } } - var updatePowerLevelsForUsersClosure: (([(userID: String, powerLevel: Int64)]) async -> Result)? + nonisolated(unsafe) var updatePowerLevelsForUsersClosure: (([(userID: String, powerLevel: Int64)]) async -> Result)? - func updatePowerLevelsForUsers(_ updates: [(userID: String, powerLevel: Int64)]) async -> Result { + @concurrent func updatePowerLevelsForUsers(_ updates: [(userID: String, powerLevel: Int64)]) async -> Result { updatePowerLevelsForUsersCallsCountLock.withLock { updatePowerLevelsForUsersUnderlyingCallsCount += 1 } updatePowerLevelsForUsersReceivedUpdates = updates updatePowerLevelsForUsersReceivedInvocationsLock.withLock { updatePowerLevelsForUsersUnderlyingReceivedInvocations.append(updates) } @@ -6377,7 +6377,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - kickUser private let kickUserReasonCallsCountLock = NSLock() - private var kickUserReasonUnderlyingCallsCount = 0 + private nonisolated(unsafe) var kickUserReasonUnderlyingCallsCount = 0 var kickUserReasonCallsCount: Int { get { kickUserReasonCallsCountLock.withLock { kickUserReasonUnderlyingCallsCount } } set { kickUserReasonCallsCountLock.withLock { kickUserReasonUnderlyingCallsCount = newValue } } @@ -6386,27 +6386,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return kickUserReasonCallsCount > 0 } private let kickUserReasonReceivedArgumentsLock = NSLock() - private var kickUserReasonUnderlyingReceivedArguments: (userID: String, reason: String?)? + private nonisolated(unsafe) var kickUserReasonUnderlyingReceivedArguments: (userID: String, reason: String?)? var kickUserReasonReceivedArguments: (userID: String, reason: String?)? { get { kickUserReasonReceivedArgumentsLock.withLock { kickUserReasonUnderlyingReceivedArguments } } set { kickUserReasonReceivedArgumentsLock.withLock { kickUserReasonUnderlyingReceivedArguments = newValue } } } private let kickUserReasonReceivedInvocationsLock = NSLock() - private var kickUserReasonUnderlyingReceivedInvocations: [(userID: String, reason: String?)] = [] + private nonisolated(unsafe) var kickUserReasonUnderlyingReceivedInvocations: [(userID: String, reason: String?)] = [] var kickUserReasonReceivedInvocations: [(userID: String, reason: String?)] { get { kickUserReasonReceivedInvocationsLock.withLock { kickUserReasonUnderlyingReceivedInvocations } } set { kickUserReasonReceivedInvocationsLock.withLock { kickUserReasonUnderlyingReceivedInvocations = newValue } } } private let kickUserReasonReturnValueLock = NSLock() - private var kickUserReasonUnderlyingReturnValue: Result! + private nonisolated(unsafe) var kickUserReasonUnderlyingReturnValue: Result! var kickUserReasonReturnValue: Result! { get { kickUserReasonReturnValueLock.withLock { kickUserReasonUnderlyingReturnValue } } set { kickUserReasonReturnValueLock.withLock { kickUserReasonUnderlyingReturnValue = newValue } } } - var kickUserReasonClosure: ((String, String?) async -> Result)? + nonisolated(unsafe) var kickUserReasonClosure: ((String, String?) async -> Result)? - func kickUser(_ userID: String, reason: String?) async -> Result { + @concurrent func kickUser(_ userID: String, reason: String?) async -> Result { kickUserReasonCallsCountLock.withLock { kickUserReasonUnderlyingCallsCount += 1 } kickUserReasonReceivedArguments = (userID: userID, reason: reason) kickUserReasonReceivedInvocationsLock.withLock { kickUserReasonUnderlyingReceivedInvocations.append((userID: userID, reason: reason)) } @@ -6419,7 +6419,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - banUser private let banUserReasonCallsCountLock = NSLock() - private var banUserReasonUnderlyingCallsCount = 0 + private nonisolated(unsafe) var banUserReasonUnderlyingCallsCount = 0 var banUserReasonCallsCount: Int { get { banUserReasonCallsCountLock.withLock { banUserReasonUnderlyingCallsCount } } set { banUserReasonCallsCountLock.withLock { banUserReasonUnderlyingCallsCount = newValue } } @@ -6428,27 +6428,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return banUserReasonCallsCount > 0 } private let banUserReasonReceivedArgumentsLock = NSLock() - private var banUserReasonUnderlyingReceivedArguments: (userID: String, reason: String?)? + private nonisolated(unsafe) var banUserReasonUnderlyingReceivedArguments: (userID: String, reason: String?)? var banUserReasonReceivedArguments: (userID: String, reason: String?)? { get { banUserReasonReceivedArgumentsLock.withLock { banUserReasonUnderlyingReceivedArguments } } set { banUserReasonReceivedArgumentsLock.withLock { banUserReasonUnderlyingReceivedArguments = newValue } } } private let banUserReasonReceivedInvocationsLock = NSLock() - private var banUserReasonUnderlyingReceivedInvocations: [(userID: String, reason: String?)] = [] + private nonisolated(unsafe) var banUserReasonUnderlyingReceivedInvocations: [(userID: String, reason: String?)] = [] var banUserReasonReceivedInvocations: [(userID: String, reason: String?)] { get { banUserReasonReceivedInvocationsLock.withLock { banUserReasonUnderlyingReceivedInvocations } } set { banUserReasonReceivedInvocationsLock.withLock { banUserReasonUnderlyingReceivedInvocations = newValue } } } private let banUserReasonReturnValueLock = NSLock() - private var banUserReasonUnderlyingReturnValue: Result! + private nonisolated(unsafe) var banUserReasonUnderlyingReturnValue: Result! var banUserReasonReturnValue: Result! { get { banUserReasonReturnValueLock.withLock { banUserReasonUnderlyingReturnValue } } set { banUserReasonReturnValueLock.withLock { banUserReasonUnderlyingReturnValue = newValue } } } - var banUserReasonClosure: ((String, String?) async -> Result)? + nonisolated(unsafe) var banUserReasonClosure: ((String, String?) async -> Result)? - func banUser(_ userID: String, reason: String?) async -> Result { + @concurrent func banUser(_ userID: String, reason: String?) async -> Result { banUserReasonCallsCountLock.withLock { banUserReasonUnderlyingCallsCount += 1 } banUserReasonReceivedArguments = (userID: userID, reason: reason) banUserReasonReceivedInvocationsLock.withLock { banUserReasonUnderlyingReceivedInvocations.append((userID: userID, reason: reason)) } @@ -6461,7 +6461,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - unbanUser private let unbanUserCallsCountLock = NSLock() - private var unbanUserUnderlyingCallsCount = 0 + private nonisolated(unsafe) var unbanUserUnderlyingCallsCount = 0 var unbanUserCallsCount: Int { get { unbanUserCallsCountLock.withLock { unbanUserUnderlyingCallsCount } } set { unbanUserCallsCountLock.withLock { unbanUserUnderlyingCallsCount = newValue } } @@ -6470,27 +6470,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return unbanUserCallsCount > 0 } private let unbanUserReceivedUserIDLock = NSLock() - private var unbanUserUnderlyingReceivedUserID: String? + private nonisolated(unsafe) var unbanUserUnderlyingReceivedUserID: String? var unbanUserReceivedUserID: String? { get { unbanUserReceivedUserIDLock.withLock { unbanUserUnderlyingReceivedUserID } } set { unbanUserReceivedUserIDLock.withLock { unbanUserUnderlyingReceivedUserID = newValue } } } private let unbanUserReceivedInvocationsLock = NSLock() - private var unbanUserUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var unbanUserUnderlyingReceivedInvocations: [String] = [] var unbanUserReceivedInvocations: [String] { get { unbanUserReceivedInvocationsLock.withLock { unbanUserUnderlyingReceivedInvocations } } set { unbanUserReceivedInvocationsLock.withLock { unbanUserUnderlyingReceivedInvocations = newValue } } } private let unbanUserReturnValueLock = NSLock() - private var unbanUserUnderlyingReturnValue: Result! + private nonisolated(unsafe) var unbanUserUnderlyingReturnValue: Result! var unbanUserReturnValue: Result! { get { unbanUserReturnValueLock.withLock { unbanUserUnderlyingReturnValue } } set { unbanUserReturnValueLock.withLock { unbanUserUnderlyingReturnValue = newValue } } } - var unbanUserClosure: ((String) async -> Result)? + nonisolated(unsafe) var unbanUserClosure: ((String) async -> Result)? - func unbanUser(_ userID: String) async -> Result { + @concurrent func unbanUser(_ userID: String) async -> Result { unbanUserCallsCountLock.withLock { unbanUserUnderlyingCallsCount += 1 } unbanUserReceivedUserID = userID unbanUserReceivedInvocationsLock.withLock { unbanUserUnderlyingReceivedInvocations.append(userID) } @@ -6503,7 +6503,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - elementCallWidgetDriver private let elementCallWidgetDriverDeviceIDCallsCountLock = NSLock() - private var elementCallWidgetDriverDeviceIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var elementCallWidgetDriverDeviceIDUnderlyingCallsCount = 0 var elementCallWidgetDriverDeviceIDCallsCount: Int { get { elementCallWidgetDriverDeviceIDCallsCountLock.withLock { elementCallWidgetDriverDeviceIDUnderlyingCallsCount } } set { elementCallWidgetDriverDeviceIDCallsCountLock.withLock { elementCallWidgetDriverDeviceIDUnderlyingCallsCount = newValue } } @@ -6512,25 +6512,25 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return elementCallWidgetDriverDeviceIDCallsCount > 0 } private let elementCallWidgetDriverDeviceIDReceivedDeviceIDLock = NSLock() - private var elementCallWidgetDriverDeviceIDUnderlyingReceivedDeviceID: String? + private nonisolated(unsafe) var elementCallWidgetDriverDeviceIDUnderlyingReceivedDeviceID: String? var elementCallWidgetDriverDeviceIDReceivedDeviceID: String? { get { elementCallWidgetDriverDeviceIDReceivedDeviceIDLock.withLock { elementCallWidgetDriverDeviceIDUnderlyingReceivedDeviceID } } set { elementCallWidgetDriverDeviceIDReceivedDeviceIDLock.withLock { elementCallWidgetDriverDeviceIDUnderlyingReceivedDeviceID = newValue } } } private let elementCallWidgetDriverDeviceIDReceivedInvocationsLock = NSLock() - private var elementCallWidgetDriverDeviceIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var elementCallWidgetDriverDeviceIDUnderlyingReceivedInvocations: [String] = [] var elementCallWidgetDriverDeviceIDReceivedInvocations: [String] { get { elementCallWidgetDriverDeviceIDReceivedInvocationsLock.withLock { elementCallWidgetDriverDeviceIDUnderlyingReceivedInvocations } } set { elementCallWidgetDriverDeviceIDReceivedInvocationsLock.withLock { elementCallWidgetDriverDeviceIDUnderlyingReceivedInvocations = newValue } } } private let elementCallWidgetDriverDeviceIDReturnValueLock = NSLock() - private var elementCallWidgetDriverDeviceIDUnderlyingReturnValue: ElementCallWidgetDriverProtocol! + private nonisolated(unsafe) var elementCallWidgetDriverDeviceIDUnderlyingReturnValue: ElementCallWidgetDriverProtocol! var elementCallWidgetDriverDeviceIDReturnValue: ElementCallWidgetDriverProtocol! { get { elementCallWidgetDriverDeviceIDReturnValueLock.withLock { elementCallWidgetDriverDeviceIDUnderlyingReturnValue } } set { elementCallWidgetDriverDeviceIDReturnValueLock.withLock { elementCallWidgetDriverDeviceIDUnderlyingReturnValue = newValue } } } - var elementCallWidgetDriverDeviceIDClosure: ((String) -> ElementCallWidgetDriverProtocol)? + nonisolated(unsafe) var elementCallWidgetDriverDeviceIDClosure: ((String) -> ElementCallWidgetDriverProtocol)? func elementCallWidgetDriver(deviceID: String) -> ElementCallWidgetDriverProtocol { elementCallWidgetDriverDeviceIDCallsCountLock.withLock { elementCallWidgetDriverDeviceIDUnderlyingCallsCount += 1 } @@ -6545,7 +6545,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - declineCall private let declineCallNotificationIDCallsCountLock = NSLock() - private var declineCallNotificationIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var declineCallNotificationIDUnderlyingCallsCount = 0 var declineCallNotificationIDCallsCount: Int { get { declineCallNotificationIDCallsCountLock.withLock { declineCallNotificationIDUnderlyingCallsCount } } set { declineCallNotificationIDCallsCountLock.withLock { declineCallNotificationIDUnderlyingCallsCount = newValue } } @@ -6554,27 +6554,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return declineCallNotificationIDCallsCount > 0 } private let declineCallNotificationIDReceivedNotificationIDLock = NSLock() - private var declineCallNotificationIDUnderlyingReceivedNotificationID: String? + private nonisolated(unsafe) var declineCallNotificationIDUnderlyingReceivedNotificationID: String? var declineCallNotificationIDReceivedNotificationID: String? { get { declineCallNotificationIDReceivedNotificationIDLock.withLock { declineCallNotificationIDUnderlyingReceivedNotificationID } } set { declineCallNotificationIDReceivedNotificationIDLock.withLock { declineCallNotificationIDUnderlyingReceivedNotificationID = newValue } } } private let declineCallNotificationIDReceivedInvocationsLock = NSLock() - private var declineCallNotificationIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var declineCallNotificationIDUnderlyingReceivedInvocations: [String] = [] var declineCallNotificationIDReceivedInvocations: [String] { get { declineCallNotificationIDReceivedInvocationsLock.withLock { declineCallNotificationIDUnderlyingReceivedInvocations } } set { declineCallNotificationIDReceivedInvocationsLock.withLock { declineCallNotificationIDUnderlyingReceivedInvocations = newValue } } } private let declineCallNotificationIDReturnValueLock = NSLock() - private var declineCallNotificationIDUnderlyingReturnValue: Result! + private nonisolated(unsafe) var declineCallNotificationIDUnderlyingReturnValue: Result! var declineCallNotificationIDReturnValue: Result! { get { declineCallNotificationIDReturnValueLock.withLock { declineCallNotificationIDUnderlyingReturnValue } } set { declineCallNotificationIDReturnValueLock.withLock { declineCallNotificationIDUnderlyingReturnValue = newValue } } } - var declineCallNotificationIDClosure: ((String) async -> Result)? + nonisolated(unsafe) var declineCallNotificationIDClosure: ((String) async -> Result)? - func declineCall(notificationID: String) async -> Result { + @concurrent func declineCall(notificationID: String) async -> Result { declineCallNotificationIDCallsCountLock.withLock { declineCallNotificationIDUnderlyingCallsCount += 1 } declineCallNotificationIDReceivedNotificationID = notificationID declineCallNotificationIDReceivedInvocationsLock.withLock { declineCallNotificationIDUnderlyingReceivedInvocations.append(notificationID) } @@ -6587,7 +6587,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - subscribeToCallDeclineEvents private let subscribeToCallDeclineEventsRtcNotificationEventIDListenerCallsCountLock = NSLock() - private var subscribeToCallDeclineEventsRtcNotificationEventIDListenerUnderlyingCallsCount = 0 + private nonisolated(unsafe) var subscribeToCallDeclineEventsRtcNotificationEventIDListenerUnderlyingCallsCount = 0 var subscribeToCallDeclineEventsRtcNotificationEventIDListenerCallsCount: Int { get { subscribeToCallDeclineEventsRtcNotificationEventIDListenerCallsCountLock.withLock { subscribeToCallDeclineEventsRtcNotificationEventIDListenerUnderlyingCallsCount } } set { subscribeToCallDeclineEventsRtcNotificationEventIDListenerCallsCountLock.withLock { subscribeToCallDeclineEventsRtcNotificationEventIDListenerUnderlyingCallsCount = newValue } } @@ -6596,25 +6596,25 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return subscribeToCallDeclineEventsRtcNotificationEventIDListenerCallsCount > 0 } private let subscribeToCallDeclineEventsRtcNotificationEventIDListenerReceivedArgumentsLock = NSLock() - private var subscribeToCallDeclineEventsRtcNotificationEventIDListenerUnderlyingReceivedArguments: (rtcNotificationEventID: String, listener: CallDeclineListener)? + private nonisolated(unsafe) var subscribeToCallDeclineEventsRtcNotificationEventIDListenerUnderlyingReceivedArguments: (rtcNotificationEventID: String, listener: CallDeclineListener)? var subscribeToCallDeclineEventsRtcNotificationEventIDListenerReceivedArguments: (rtcNotificationEventID: String, listener: CallDeclineListener)? { get { subscribeToCallDeclineEventsRtcNotificationEventIDListenerReceivedArgumentsLock.withLock { subscribeToCallDeclineEventsRtcNotificationEventIDListenerUnderlyingReceivedArguments } } set { subscribeToCallDeclineEventsRtcNotificationEventIDListenerReceivedArgumentsLock.withLock { subscribeToCallDeclineEventsRtcNotificationEventIDListenerUnderlyingReceivedArguments = newValue } } } private let subscribeToCallDeclineEventsRtcNotificationEventIDListenerReceivedInvocationsLock = NSLock() - private var subscribeToCallDeclineEventsRtcNotificationEventIDListenerUnderlyingReceivedInvocations: [(rtcNotificationEventID: String, listener: CallDeclineListener)] = [] + private nonisolated(unsafe) var subscribeToCallDeclineEventsRtcNotificationEventIDListenerUnderlyingReceivedInvocations: [(rtcNotificationEventID: String, listener: CallDeclineListener)] = [] var subscribeToCallDeclineEventsRtcNotificationEventIDListenerReceivedInvocations: [(rtcNotificationEventID: String, listener: CallDeclineListener)] { get { subscribeToCallDeclineEventsRtcNotificationEventIDListenerReceivedInvocationsLock.withLock { subscribeToCallDeclineEventsRtcNotificationEventIDListenerUnderlyingReceivedInvocations } } set { subscribeToCallDeclineEventsRtcNotificationEventIDListenerReceivedInvocationsLock.withLock { subscribeToCallDeclineEventsRtcNotificationEventIDListenerUnderlyingReceivedInvocations = newValue } } } private let subscribeToCallDeclineEventsRtcNotificationEventIDListenerReturnValueLock = NSLock() - private var subscribeToCallDeclineEventsRtcNotificationEventIDListenerUnderlyingReturnValue: Result! + private nonisolated(unsafe) var subscribeToCallDeclineEventsRtcNotificationEventIDListenerUnderlyingReturnValue: Result! var subscribeToCallDeclineEventsRtcNotificationEventIDListenerReturnValue: Result! { get { subscribeToCallDeclineEventsRtcNotificationEventIDListenerReturnValueLock.withLock { subscribeToCallDeclineEventsRtcNotificationEventIDListenerUnderlyingReturnValue } } set { subscribeToCallDeclineEventsRtcNotificationEventIDListenerReturnValueLock.withLock { subscribeToCallDeclineEventsRtcNotificationEventIDListenerUnderlyingReturnValue = newValue } } } - var subscribeToCallDeclineEventsRtcNotificationEventIDListenerClosure: ((String, CallDeclineListener) -> Result)? + nonisolated(unsafe) var subscribeToCallDeclineEventsRtcNotificationEventIDListenerClosure: ((String, CallDeclineListener) -> Result)? func subscribeToCallDeclineEvents(rtcNotificationEventID: String, listener: CallDeclineListener) -> Result { subscribeToCallDeclineEventsRtcNotificationEventIDListenerCallsCountLock.withLock { subscribeToCallDeclineEventsRtcNotificationEventIDListenerUnderlyingCallsCount += 1 } @@ -6629,7 +6629,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - matrixToPermalink private let matrixToPermalinkCallsCountLock = NSLock() - private var matrixToPermalinkUnderlyingCallsCount = 0 + private nonisolated(unsafe) var matrixToPermalinkUnderlyingCallsCount = 0 var matrixToPermalinkCallsCount: Int { get { matrixToPermalinkCallsCountLock.withLock { matrixToPermalinkUnderlyingCallsCount } } set { matrixToPermalinkCallsCountLock.withLock { matrixToPermalinkUnderlyingCallsCount = newValue } } @@ -6639,14 +6639,14 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { } private let matrixToPermalinkReturnValueLock = NSLock() - private var matrixToPermalinkUnderlyingReturnValue: Result! + private nonisolated(unsafe) var matrixToPermalinkUnderlyingReturnValue: Result! var matrixToPermalinkReturnValue: Result! { get { matrixToPermalinkReturnValueLock.withLock { matrixToPermalinkUnderlyingReturnValue } } set { matrixToPermalinkReturnValueLock.withLock { matrixToPermalinkUnderlyingReturnValue = newValue } } } - var matrixToPermalinkClosure: (() async -> Result)? + nonisolated(unsafe) var matrixToPermalinkClosure: (() async -> Result)? - func matrixToPermalink() async -> Result { + @concurrent func matrixToPermalink() async -> Result { matrixToPermalinkCallsCountLock.withLock { matrixToPermalinkUnderlyingCallsCount += 1 } if let matrixToPermalinkClosure = matrixToPermalinkClosure { return await matrixToPermalinkClosure() @@ -6657,7 +6657,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - matrixToEventPermalink private let matrixToEventPermalinkCallsCountLock = NSLock() - private var matrixToEventPermalinkUnderlyingCallsCount = 0 + private nonisolated(unsafe) var matrixToEventPermalinkUnderlyingCallsCount = 0 var matrixToEventPermalinkCallsCount: Int { get { matrixToEventPermalinkCallsCountLock.withLock { matrixToEventPermalinkUnderlyingCallsCount } } set { matrixToEventPermalinkCallsCountLock.withLock { matrixToEventPermalinkUnderlyingCallsCount = newValue } } @@ -6666,27 +6666,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return matrixToEventPermalinkCallsCount > 0 } private let matrixToEventPermalinkReceivedEventIDLock = NSLock() - private var matrixToEventPermalinkUnderlyingReceivedEventID: String? + private nonisolated(unsafe) var matrixToEventPermalinkUnderlyingReceivedEventID: String? var matrixToEventPermalinkReceivedEventID: String? { get { matrixToEventPermalinkReceivedEventIDLock.withLock { matrixToEventPermalinkUnderlyingReceivedEventID } } set { matrixToEventPermalinkReceivedEventIDLock.withLock { matrixToEventPermalinkUnderlyingReceivedEventID = newValue } } } private let matrixToEventPermalinkReceivedInvocationsLock = NSLock() - private var matrixToEventPermalinkUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var matrixToEventPermalinkUnderlyingReceivedInvocations: [String] = [] var matrixToEventPermalinkReceivedInvocations: [String] { get { matrixToEventPermalinkReceivedInvocationsLock.withLock { matrixToEventPermalinkUnderlyingReceivedInvocations } } set { matrixToEventPermalinkReceivedInvocationsLock.withLock { matrixToEventPermalinkUnderlyingReceivedInvocations = newValue } } } private let matrixToEventPermalinkReturnValueLock = NSLock() - private var matrixToEventPermalinkUnderlyingReturnValue: Result! + private nonisolated(unsafe) var matrixToEventPermalinkUnderlyingReturnValue: Result! var matrixToEventPermalinkReturnValue: Result! { get { matrixToEventPermalinkReturnValueLock.withLock { matrixToEventPermalinkUnderlyingReturnValue } } set { matrixToEventPermalinkReturnValueLock.withLock { matrixToEventPermalinkUnderlyingReturnValue = newValue } } } - var matrixToEventPermalinkClosure: ((String) async -> Result)? + nonisolated(unsafe) var matrixToEventPermalinkClosure: ((String) async -> Result)? - func matrixToEventPermalink(_ eventID: String) async -> Result { + @concurrent func matrixToEventPermalink(_ eventID: String) async -> Result { matrixToEventPermalinkCallsCountLock.withLock { matrixToEventPermalinkUnderlyingCallsCount += 1 } matrixToEventPermalinkReceivedEventID = eventID matrixToEventPermalinkReceivedInvocationsLock.withLock { matrixToEventPermalinkUnderlyingReceivedInvocations.append(eventID) } @@ -6699,7 +6699,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - saveDraft private let saveDraftThreadRootEventIDCallsCountLock = NSLock() - private var saveDraftThreadRootEventIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var saveDraftThreadRootEventIDUnderlyingCallsCount = 0 var saveDraftThreadRootEventIDCallsCount: Int { get { saveDraftThreadRootEventIDCallsCountLock.withLock { saveDraftThreadRootEventIDUnderlyingCallsCount } } set { saveDraftThreadRootEventIDCallsCountLock.withLock { saveDraftThreadRootEventIDUnderlyingCallsCount = newValue } } @@ -6708,27 +6708,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return saveDraftThreadRootEventIDCallsCount > 0 } private let saveDraftThreadRootEventIDReceivedArgumentsLock = NSLock() - private var saveDraftThreadRootEventIDUnderlyingReceivedArguments: (draft: ComposerDraft, threadRootEventID: String?)? + private nonisolated(unsafe) var saveDraftThreadRootEventIDUnderlyingReceivedArguments: (draft: ComposerDraft, threadRootEventID: String?)? var saveDraftThreadRootEventIDReceivedArguments: (draft: ComposerDraft, threadRootEventID: String?)? { get { saveDraftThreadRootEventIDReceivedArgumentsLock.withLock { saveDraftThreadRootEventIDUnderlyingReceivedArguments } } set { saveDraftThreadRootEventIDReceivedArgumentsLock.withLock { saveDraftThreadRootEventIDUnderlyingReceivedArguments = newValue } } } private let saveDraftThreadRootEventIDReceivedInvocationsLock = NSLock() - private var saveDraftThreadRootEventIDUnderlyingReceivedInvocations: [(draft: ComposerDraft, threadRootEventID: String?)] = [] + private nonisolated(unsafe) var saveDraftThreadRootEventIDUnderlyingReceivedInvocations: [(draft: ComposerDraft, threadRootEventID: String?)] = [] var saveDraftThreadRootEventIDReceivedInvocations: [(draft: ComposerDraft, threadRootEventID: String?)] { get { saveDraftThreadRootEventIDReceivedInvocationsLock.withLock { saveDraftThreadRootEventIDUnderlyingReceivedInvocations } } set { saveDraftThreadRootEventIDReceivedInvocationsLock.withLock { saveDraftThreadRootEventIDUnderlyingReceivedInvocations = newValue } } } private let saveDraftThreadRootEventIDReturnValueLock = NSLock() - private var saveDraftThreadRootEventIDUnderlyingReturnValue: Result! + private nonisolated(unsafe) var saveDraftThreadRootEventIDUnderlyingReturnValue: Result! var saveDraftThreadRootEventIDReturnValue: Result! { get { saveDraftThreadRootEventIDReturnValueLock.withLock { saveDraftThreadRootEventIDUnderlyingReturnValue } } set { saveDraftThreadRootEventIDReturnValueLock.withLock { saveDraftThreadRootEventIDUnderlyingReturnValue = newValue } } } - var saveDraftThreadRootEventIDClosure: ((ComposerDraft, String?) async -> Result)? + nonisolated(unsafe) var saveDraftThreadRootEventIDClosure: ((ComposerDraft, String?) async -> Result)? - func saveDraft(_ draft: ComposerDraft, threadRootEventID: String?) async -> Result { + @concurrent func saveDraft(_ draft: ComposerDraft, threadRootEventID: String?) async -> Result { saveDraftThreadRootEventIDCallsCountLock.withLock { saveDraftThreadRootEventIDUnderlyingCallsCount += 1 } saveDraftThreadRootEventIDReceivedArguments = (draft: draft, threadRootEventID: threadRootEventID) saveDraftThreadRootEventIDReceivedInvocationsLock.withLock { saveDraftThreadRootEventIDUnderlyingReceivedInvocations.append((draft: draft, threadRootEventID: threadRootEventID)) } @@ -6741,7 +6741,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - loadDraft private let loadDraftThreadRootEventIDCallsCountLock = NSLock() - private var loadDraftThreadRootEventIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var loadDraftThreadRootEventIDUnderlyingCallsCount = 0 var loadDraftThreadRootEventIDCallsCount: Int { get { loadDraftThreadRootEventIDCallsCountLock.withLock { loadDraftThreadRootEventIDUnderlyingCallsCount } } set { loadDraftThreadRootEventIDCallsCountLock.withLock { loadDraftThreadRootEventIDUnderlyingCallsCount = newValue } } @@ -6750,27 +6750,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return loadDraftThreadRootEventIDCallsCount > 0 } private let loadDraftThreadRootEventIDReceivedThreadRootEventIDLock = NSLock() - private var loadDraftThreadRootEventIDUnderlyingReceivedThreadRootEventID: String? + private nonisolated(unsafe) var loadDraftThreadRootEventIDUnderlyingReceivedThreadRootEventID: String? var loadDraftThreadRootEventIDReceivedThreadRootEventID: String? { get { loadDraftThreadRootEventIDReceivedThreadRootEventIDLock.withLock { loadDraftThreadRootEventIDUnderlyingReceivedThreadRootEventID } } set { loadDraftThreadRootEventIDReceivedThreadRootEventIDLock.withLock { loadDraftThreadRootEventIDUnderlyingReceivedThreadRootEventID = newValue } } } private let loadDraftThreadRootEventIDReceivedInvocationsLock = NSLock() - private var loadDraftThreadRootEventIDUnderlyingReceivedInvocations: [String?] = [] + private nonisolated(unsafe) var loadDraftThreadRootEventIDUnderlyingReceivedInvocations: [String?] = [] var loadDraftThreadRootEventIDReceivedInvocations: [String?] { get { loadDraftThreadRootEventIDReceivedInvocationsLock.withLock { loadDraftThreadRootEventIDUnderlyingReceivedInvocations } } set { loadDraftThreadRootEventIDReceivedInvocationsLock.withLock { loadDraftThreadRootEventIDUnderlyingReceivedInvocations = newValue } } } private let loadDraftThreadRootEventIDReturnValueLock = NSLock() - private var loadDraftThreadRootEventIDUnderlyingReturnValue: Result! + private nonisolated(unsafe) var loadDraftThreadRootEventIDUnderlyingReturnValue: Result! var loadDraftThreadRootEventIDReturnValue: Result! { get { loadDraftThreadRootEventIDReturnValueLock.withLock { loadDraftThreadRootEventIDUnderlyingReturnValue } } set { loadDraftThreadRootEventIDReturnValueLock.withLock { loadDraftThreadRootEventIDUnderlyingReturnValue = newValue } } } - var loadDraftThreadRootEventIDClosure: ((String?) async -> Result)? + nonisolated(unsafe) var loadDraftThreadRootEventIDClosure: ((String?) async -> Result)? - func loadDraft(threadRootEventID: String?) async -> Result { + @concurrent func loadDraft(threadRootEventID: String?) async -> Result { loadDraftThreadRootEventIDCallsCountLock.withLock { loadDraftThreadRootEventIDUnderlyingCallsCount += 1 } loadDraftThreadRootEventIDReceivedThreadRootEventID = threadRootEventID loadDraftThreadRootEventIDReceivedInvocationsLock.withLock { loadDraftThreadRootEventIDUnderlyingReceivedInvocations.append(threadRootEventID) } @@ -6783,7 +6783,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - clearDraft private let clearDraftThreadRootEventIDCallsCountLock = NSLock() - private var clearDraftThreadRootEventIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var clearDraftThreadRootEventIDUnderlyingCallsCount = 0 var clearDraftThreadRootEventIDCallsCount: Int { get { clearDraftThreadRootEventIDCallsCountLock.withLock { clearDraftThreadRootEventIDUnderlyingCallsCount } } set { clearDraftThreadRootEventIDCallsCountLock.withLock { clearDraftThreadRootEventIDUnderlyingCallsCount = newValue } } @@ -6792,27 +6792,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return clearDraftThreadRootEventIDCallsCount > 0 } private let clearDraftThreadRootEventIDReceivedThreadRootEventIDLock = NSLock() - private var clearDraftThreadRootEventIDUnderlyingReceivedThreadRootEventID: String? + private nonisolated(unsafe) var clearDraftThreadRootEventIDUnderlyingReceivedThreadRootEventID: String? var clearDraftThreadRootEventIDReceivedThreadRootEventID: String? { get { clearDraftThreadRootEventIDReceivedThreadRootEventIDLock.withLock { clearDraftThreadRootEventIDUnderlyingReceivedThreadRootEventID } } set { clearDraftThreadRootEventIDReceivedThreadRootEventIDLock.withLock { clearDraftThreadRootEventIDUnderlyingReceivedThreadRootEventID = newValue } } } private let clearDraftThreadRootEventIDReceivedInvocationsLock = NSLock() - private var clearDraftThreadRootEventIDUnderlyingReceivedInvocations: [String?] = [] + private nonisolated(unsafe) var clearDraftThreadRootEventIDUnderlyingReceivedInvocations: [String?] = [] var clearDraftThreadRootEventIDReceivedInvocations: [String?] { get { clearDraftThreadRootEventIDReceivedInvocationsLock.withLock { clearDraftThreadRootEventIDUnderlyingReceivedInvocations } } set { clearDraftThreadRootEventIDReceivedInvocationsLock.withLock { clearDraftThreadRootEventIDUnderlyingReceivedInvocations = newValue } } } private let clearDraftThreadRootEventIDReturnValueLock = NSLock() - private var clearDraftThreadRootEventIDUnderlyingReturnValue: Result! + private nonisolated(unsafe) var clearDraftThreadRootEventIDUnderlyingReturnValue: Result! var clearDraftThreadRootEventIDReturnValue: Result! { get { clearDraftThreadRootEventIDReturnValueLock.withLock { clearDraftThreadRootEventIDUnderlyingReturnValue } } set { clearDraftThreadRootEventIDReturnValueLock.withLock { clearDraftThreadRootEventIDUnderlyingReturnValue = newValue } } } - var clearDraftThreadRootEventIDClosure: ((String?) async -> Result)? + nonisolated(unsafe) var clearDraftThreadRootEventIDClosure: ((String?) async -> Result)? - func clearDraft(threadRootEventID: String?) async -> Result { + @concurrent func clearDraft(threadRootEventID: String?) async -> Result { clearDraftThreadRootEventIDCallsCountLock.withLock { clearDraftThreadRootEventIDUnderlyingCallsCount += 1 } clearDraftThreadRootEventIDReceivedThreadRootEventID = threadRootEventID clearDraftThreadRootEventIDReceivedInvocationsLock.withLock { clearDraftThreadRootEventIDUnderlyingReceivedInvocations.append(threadRootEventID) } @@ -6825,7 +6825,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - makeLiveLocationService private let makeLiveLocationServiceCallsCountLock = NSLock() - private var makeLiveLocationServiceUnderlyingCallsCount = 0 + private nonisolated(unsafe) var makeLiveLocationServiceUnderlyingCallsCount = 0 var makeLiveLocationServiceCallsCount: Int { get { makeLiveLocationServiceCallsCountLock.withLock { makeLiveLocationServiceUnderlyingCallsCount } } set { makeLiveLocationServiceCallsCountLock.withLock { makeLiveLocationServiceUnderlyingCallsCount = newValue } } @@ -6835,14 +6835,14 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { } private let makeLiveLocationServiceReturnValueLock = NSLock() - private var makeLiveLocationServiceUnderlyingReturnValue: RoomLiveLocationServiceProtocol! + private nonisolated(unsafe) var makeLiveLocationServiceUnderlyingReturnValue: RoomLiveLocationServiceProtocol! var makeLiveLocationServiceReturnValue: RoomLiveLocationServiceProtocol! { get { makeLiveLocationServiceReturnValueLock.withLock { makeLiveLocationServiceUnderlyingReturnValue } } set { makeLiveLocationServiceReturnValueLock.withLock { makeLiveLocationServiceUnderlyingReturnValue = newValue } } } - var makeLiveLocationServiceClosure: (() async -> RoomLiveLocationServiceProtocol)? + nonisolated(unsafe) var makeLiveLocationServiceClosure: (() async -> RoomLiveLocationServiceProtocol)? - func makeLiveLocationService() async -> RoomLiveLocationServiceProtocol { + @concurrent func makeLiveLocationService() async -> RoomLiveLocationServiceProtocol { makeLiveLocationServiceCallsCountLock.withLock { makeLiveLocationServiceUnderlyingCallsCount += 1 } if let makeLiveLocationServiceClosure = makeLiveLocationServiceClosure { return await makeLiveLocationServiceClosure() @@ -6853,7 +6853,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - startLiveLocationShare private let startLiveLocationShareDurationCallsCountLock = NSLock() - private var startLiveLocationShareDurationUnderlyingCallsCount = 0 + private nonisolated(unsafe) var startLiveLocationShareDurationUnderlyingCallsCount = 0 var startLiveLocationShareDurationCallsCount: Int { get { startLiveLocationShareDurationCallsCountLock.withLock { startLiveLocationShareDurationUnderlyingCallsCount } } set { startLiveLocationShareDurationCallsCountLock.withLock { startLiveLocationShareDurationUnderlyingCallsCount = newValue } } @@ -6862,27 +6862,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return startLiveLocationShareDurationCallsCount > 0 } private let startLiveLocationShareDurationReceivedDurationLock = NSLock() - private var startLiveLocationShareDurationUnderlyingReceivedDuration: Duration? + private nonisolated(unsafe) var startLiveLocationShareDurationUnderlyingReceivedDuration: Duration? var startLiveLocationShareDurationReceivedDuration: Duration? { get { startLiveLocationShareDurationReceivedDurationLock.withLock { startLiveLocationShareDurationUnderlyingReceivedDuration } } set { startLiveLocationShareDurationReceivedDurationLock.withLock { startLiveLocationShareDurationUnderlyingReceivedDuration = newValue } } } private let startLiveLocationShareDurationReceivedInvocationsLock = NSLock() - private var startLiveLocationShareDurationUnderlyingReceivedInvocations: [Duration] = [] + private nonisolated(unsafe) var startLiveLocationShareDurationUnderlyingReceivedInvocations: [Duration] = [] var startLiveLocationShareDurationReceivedInvocations: [Duration] { get { startLiveLocationShareDurationReceivedInvocationsLock.withLock { startLiveLocationShareDurationUnderlyingReceivedInvocations } } set { startLiveLocationShareDurationReceivedInvocationsLock.withLock { startLiveLocationShareDurationUnderlyingReceivedInvocations = newValue } } } private let startLiveLocationShareDurationReturnValueLock = NSLock() - private var startLiveLocationShareDurationUnderlyingReturnValue: Result! + private nonisolated(unsafe) var startLiveLocationShareDurationUnderlyingReturnValue: Result! var startLiveLocationShareDurationReturnValue: Result! { get { startLiveLocationShareDurationReturnValueLock.withLock { startLiveLocationShareDurationUnderlyingReturnValue } } set { startLiveLocationShareDurationReturnValueLock.withLock { startLiveLocationShareDurationUnderlyingReturnValue = newValue } } } - var startLiveLocationShareDurationClosure: ((Duration) async -> Result)? + nonisolated(unsafe) var startLiveLocationShareDurationClosure: ((Duration) async -> Result)? - func startLiveLocationShare(duration: Duration) async -> Result { + @concurrent func startLiveLocationShare(duration: Duration) async -> Result { startLiveLocationShareDurationCallsCountLock.withLock { startLiveLocationShareDurationUnderlyingCallsCount += 1 } startLiveLocationShareDurationReceivedDuration = duration startLiveLocationShareDurationReceivedInvocationsLock.withLock { startLiveLocationShareDurationUnderlyingReceivedInvocations.append(duration) } @@ -6895,7 +6895,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - sendLiveLocation private let sendLiveLocationGeoURICallsCountLock = NSLock() - private var sendLiveLocationGeoURIUnderlyingCallsCount = 0 + private nonisolated(unsafe) var sendLiveLocationGeoURIUnderlyingCallsCount = 0 var sendLiveLocationGeoURICallsCount: Int { get { sendLiveLocationGeoURICallsCountLock.withLock { sendLiveLocationGeoURIUnderlyingCallsCount } } set { sendLiveLocationGeoURICallsCountLock.withLock { sendLiveLocationGeoURIUnderlyingCallsCount = newValue } } @@ -6904,27 +6904,27 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { return sendLiveLocationGeoURICallsCount > 0 } private let sendLiveLocationGeoURIReceivedGeoURILock = NSLock() - private var sendLiveLocationGeoURIUnderlyingReceivedGeoURI: GeoURI? + private nonisolated(unsafe) var sendLiveLocationGeoURIUnderlyingReceivedGeoURI: GeoURI? var sendLiveLocationGeoURIReceivedGeoURI: GeoURI? { get { sendLiveLocationGeoURIReceivedGeoURILock.withLock { sendLiveLocationGeoURIUnderlyingReceivedGeoURI } } set { sendLiveLocationGeoURIReceivedGeoURILock.withLock { sendLiveLocationGeoURIUnderlyingReceivedGeoURI = newValue } } } private let sendLiveLocationGeoURIReceivedInvocationsLock = NSLock() - private var sendLiveLocationGeoURIUnderlyingReceivedInvocations: [GeoURI] = [] + private nonisolated(unsafe) var sendLiveLocationGeoURIUnderlyingReceivedInvocations: [GeoURI] = [] var sendLiveLocationGeoURIReceivedInvocations: [GeoURI] { get { sendLiveLocationGeoURIReceivedInvocationsLock.withLock { sendLiveLocationGeoURIUnderlyingReceivedInvocations } } set { sendLiveLocationGeoURIReceivedInvocationsLock.withLock { sendLiveLocationGeoURIUnderlyingReceivedInvocations = newValue } } } private let sendLiveLocationGeoURIReturnValueLock = NSLock() - private var sendLiveLocationGeoURIUnderlyingReturnValue: Result! + private nonisolated(unsafe) var sendLiveLocationGeoURIUnderlyingReturnValue: Result! var sendLiveLocationGeoURIReturnValue: Result! { get { sendLiveLocationGeoURIReturnValueLock.withLock { sendLiveLocationGeoURIUnderlyingReturnValue } } set { sendLiveLocationGeoURIReturnValueLock.withLock { sendLiveLocationGeoURIUnderlyingReturnValue = newValue } } } - var sendLiveLocationGeoURIClosure: ((GeoURI) async -> Result)? + nonisolated(unsafe) var sendLiveLocationGeoURIClosure: ((GeoURI) async -> Result)? - func sendLiveLocation(geoURI: GeoURI) async -> Result { + @concurrent func sendLiveLocation(geoURI: GeoURI) async -> Result { sendLiveLocationGeoURICallsCountLock.withLock { sendLiveLocationGeoURIUnderlyingCallsCount += 1 } sendLiveLocationGeoURIReceivedGeoURI = geoURI sendLiveLocationGeoURIReceivedInvocationsLock.withLock { sendLiveLocationGeoURIUnderlyingReceivedInvocations.append(geoURI) } @@ -6937,7 +6937,7 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { //MARK: - stopLiveLocationShare private let stopLiveLocationShareCallsCountLock = NSLock() - private var stopLiveLocationShareUnderlyingCallsCount = 0 + private nonisolated(unsafe) var stopLiveLocationShareUnderlyingCallsCount = 0 var stopLiveLocationShareCallsCount: Int { get { stopLiveLocationShareCallsCountLock.withLock { stopLiveLocationShareUnderlyingCallsCount } } set { stopLiveLocationShareCallsCountLock.withLock { stopLiveLocationShareUnderlyingCallsCount = newValue } } @@ -6947,14 +6947,14 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { } private let stopLiveLocationShareReturnValueLock = NSLock() - private var stopLiveLocationShareUnderlyingReturnValue: Result! + private nonisolated(unsafe) var stopLiveLocationShareUnderlyingReturnValue: Result! var stopLiveLocationShareReturnValue: Result! { get { stopLiveLocationShareReturnValueLock.withLock { stopLiveLocationShareUnderlyingReturnValue } } set { stopLiveLocationShareReturnValueLock.withLock { stopLiveLocationShareUnderlyingReturnValue = newValue } } } - var stopLiveLocationShareClosure: (() async -> Result)? + nonisolated(unsafe) var stopLiveLocationShareClosure: (() async -> Result)? - func stopLiveLocationShare() async -> Result { + @concurrent func stopLiveLocationShare() async -> Result { stopLiveLocationShareCallsCountLock.withLock { stopLiveLocationShareUnderlyingCallsCount += 1 } if let stopLiveLocationShareClosure = stopLiveLocationShareClosure { return await stopLiveLocationShareClosure() @@ -6963,12 +6963,12 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable { } } } -class KeychainControllerMock: KeychainControllerProtocol, @unchecked Sendable { +nonisolated class KeychainControllerMock: KeychainControllerProtocol, @unchecked Sendable { //MARK: - setRestorationToken private let setRestorationTokenForUsernameCallsCountLock = NSLock() - private var setRestorationTokenForUsernameUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setRestorationTokenForUsernameUnderlyingCallsCount = 0 var setRestorationTokenForUsernameCallsCount: Int { get { setRestorationTokenForUsernameCallsCountLock.withLock { setRestorationTokenForUsernameUnderlyingCallsCount } } set { setRestorationTokenForUsernameCallsCountLock.withLock { setRestorationTokenForUsernameUnderlyingCallsCount = newValue } } @@ -6977,18 +6977,18 @@ class KeychainControllerMock: KeychainControllerProtocol, @unchecked Sendable { return setRestorationTokenForUsernameCallsCount > 0 } private let setRestorationTokenForUsernameReceivedArgumentsLock = NSLock() - private var setRestorationTokenForUsernameUnderlyingReceivedArguments: (restorationToken: RestorationToken, forUsername: String)? + private nonisolated(unsafe) var setRestorationTokenForUsernameUnderlyingReceivedArguments: (restorationToken: RestorationToken, forUsername: String)? var setRestorationTokenForUsernameReceivedArguments: (restorationToken: RestorationToken, forUsername: String)? { get { setRestorationTokenForUsernameReceivedArgumentsLock.withLock { setRestorationTokenForUsernameUnderlyingReceivedArguments } } set { setRestorationTokenForUsernameReceivedArgumentsLock.withLock { setRestorationTokenForUsernameUnderlyingReceivedArguments = newValue } } } private let setRestorationTokenForUsernameReceivedInvocationsLock = NSLock() - private var setRestorationTokenForUsernameUnderlyingReceivedInvocations: [(restorationToken: RestorationToken, forUsername: String)] = [] + private nonisolated(unsafe) var setRestorationTokenForUsernameUnderlyingReceivedInvocations: [(restorationToken: RestorationToken, forUsername: String)] = [] var setRestorationTokenForUsernameReceivedInvocations: [(restorationToken: RestorationToken, forUsername: String)] { get { setRestorationTokenForUsernameReceivedInvocationsLock.withLock { setRestorationTokenForUsernameUnderlyingReceivedInvocations } } set { setRestorationTokenForUsernameReceivedInvocationsLock.withLock { setRestorationTokenForUsernameUnderlyingReceivedInvocations = newValue } } } - var setRestorationTokenForUsernameClosure: ((RestorationToken, String) -> Void)? + nonisolated(unsafe) var setRestorationTokenForUsernameClosure: ((RestorationToken, String) -> Void)? func setRestorationToken(_ restorationToken: RestorationToken, forUsername: String) { setRestorationTokenForUsernameCallsCountLock.withLock { setRestorationTokenForUsernameUnderlyingCallsCount += 1 } @@ -6999,7 +6999,7 @@ class KeychainControllerMock: KeychainControllerProtocol, @unchecked Sendable { //MARK: - restorationTokens private let restorationTokensCallsCountLock = NSLock() - private var restorationTokensUnderlyingCallsCount = 0 + private nonisolated(unsafe) var restorationTokensUnderlyingCallsCount = 0 var restorationTokensCallsCount: Int { get { restorationTokensCallsCountLock.withLock { restorationTokensUnderlyingCallsCount } } set { restorationTokensCallsCountLock.withLock { restorationTokensUnderlyingCallsCount = newValue } } @@ -7009,12 +7009,12 @@ class KeychainControllerMock: KeychainControllerProtocol, @unchecked Sendable { } private let restorationTokensReturnValueLock = NSLock() - private var restorationTokensUnderlyingReturnValue: [KeychainCredentials]! + private nonisolated(unsafe) var restorationTokensUnderlyingReturnValue: [KeychainCredentials]! var restorationTokensReturnValue: [KeychainCredentials]! { get { restorationTokensReturnValueLock.withLock { restorationTokensUnderlyingReturnValue } } set { restorationTokensReturnValueLock.withLock { restorationTokensUnderlyingReturnValue = newValue } } } - var restorationTokensClosure: (() -> [KeychainCredentials])? + nonisolated(unsafe) var restorationTokensClosure: (() -> [KeychainCredentials])? func restorationTokens() -> [KeychainCredentials] { restorationTokensCallsCountLock.withLock { restorationTokensUnderlyingCallsCount += 1 } @@ -7027,7 +7027,7 @@ class KeychainControllerMock: KeychainControllerProtocol, @unchecked Sendable { //MARK: - removeRestorationTokenForUsername private let removeRestorationTokenForUsernameCallsCountLock = NSLock() - private var removeRestorationTokenForUsernameUnderlyingCallsCount = 0 + private nonisolated(unsafe) var removeRestorationTokenForUsernameUnderlyingCallsCount = 0 var removeRestorationTokenForUsernameCallsCount: Int { get { removeRestorationTokenForUsernameCallsCountLock.withLock { removeRestorationTokenForUsernameUnderlyingCallsCount } } set { removeRestorationTokenForUsernameCallsCountLock.withLock { removeRestorationTokenForUsernameUnderlyingCallsCount = newValue } } @@ -7036,18 +7036,18 @@ class KeychainControllerMock: KeychainControllerProtocol, @unchecked Sendable { return removeRestorationTokenForUsernameCallsCount > 0 } private let removeRestorationTokenForUsernameReceivedUsernameLock = NSLock() - private var removeRestorationTokenForUsernameUnderlyingReceivedUsername: String? + private nonisolated(unsafe) var removeRestorationTokenForUsernameUnderlyingReceivedUsername: String? var removeRestorationTokenForUsernameReceivedUsername: String? { get { removeRestorationTokenForUsernameReceivedUsernameLock.withLock { removeRestorationTokenForUsernameUnderlyingReceivedUsername } } set { removeRestorationTokenForUsernameReceivedUsernameLock.withLock { removeRestorationTokenForUsernameUnderlyingReceivedUsername = newValue } } } private let removeRestorationTokenForUsernameReceivedInvocationsLock = NSLock() - private var removeRestorationTokenForUsernameUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var removeRestorationTokenForUsernameUnderlyingReceivedInvocations: [String] = [] var removeRestorationTokenForUsernameReceivedInvocations: [String] { get { removeRestorationTokenForUsernameReceivedInvocationsLock.withLock { removeRestorationTokenForUsernameUnderlyingReceivedInvocations } } set { removeRestorationTokenForUsernameReceivedInvocationsLock.withLock { removeRestorationTokenForUsernameUnderlyingReceivedInvocations = newValue } } } - var removeRestorationTokenForUsernameClosure: ((String) -> Void)? + nonisolated(unsafe) var removeRestorationTokenForUsernameClosure: ((String) -> Void)? func removeRestorationTokenForUsername(_ username: String) { removeRestorationTokenForUsernameCallsCountLock.withLock { removeRestorationTokenForUsernameUnderlyingCallsCount += 1 } @@ -7058,7 +7058,7 @@ class KeychainControllerMock: KeychainControllerProtocol, @unchecked Sendable { //MARK: - removeAllRestorationTokens private let removeAllRestorationTokensCallsCountLock = NSLock() - private var removeAllRestorationTokensUnderlyingCallsCount = 0 + private nonisolated(unsafe) var removeAllRestorationTokensUnderlyingCallsCount = 0 var removeAllRestorationTokensCallsCount: Int { get { removeAllRestorationTokensCallsCountLock.withLock { removeAllRestorationTokensUnderlyingCallsCount } } set { removeAllRestorationTokensCallsCountLock.withLock { removeAllRestorationTokensUnderlyingCallsCount = newValue } } @@ -7066,7 +7066,7 @@ class KeychainControllerMock: KeychainControllerProtocol, @unchecked Sendable { var removeAllRestorationTokensCalled: Bool { return removeAllRestorationTokensCallsCount > 0 } - var removeAllRestorationTokensClosure: (() -> Void)? + nonisolated(unsafe) var removeAllRestorationTokensClosure: (() -> Void)? func removeAllRestorationTokens() { removeAllRestorationTokensCallsCountLock.withLock { removeAllRestorationTokensUnderlyingCallsCount += 1 } @@ -7074,9 +7074,9 @@ class KeychainControllerMock: KeychainControllerProtocol, @unchecked Sendable { } //MARK: - containsPINCode - var containsPINCodeThrowableError: Error? + nonisolated(unsafe) var containsPINCodeThrowableError: Error? private let containsPINCodeCallsCountLock = NSLock() - private var containsPINCodeUnderlyingCallsCount = 0 + private nonisolated(unsafe) var containsPINCodeUnderlyingCallsCount = 0 var containsPINCodeCallsCount: Int { get { containsPINCodeCallsCountLock.withLock { containsPINCodeUnderlyingCallsCount } } set { containsPINCodeCallsCountLock.withLock { containsPINCodeUnderlyingCallsCount = newValue } } @@ -7086,12 +7086,12 @@ class KeychainControllerMock: KeychainControllerProtocol, @unchecked Sendable { } private let containsPINCodeReturnValueLock = NSLock() - private var containsPINCodeUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var containsPINCodeUnderlyingReturnValue: Bool! var containsPINCodeReturnValue: Bool! { get { containsPINCodeReturnValueLock.withLock { containsPINCodeUnderlyingReturnValue } } set { containsPINCodeReturnValueLock.withLock { containsPINCodeUnderlyingReturnValue = newValue } } } - var containsPINCodeClosure: (() throws -> Bool)? + nonisolated(unsafe) var containsPINCodeClosure: (() throws -> Bool)? func containsPINCode() throws -> Bool { if let error = containsPINCodeThrowableError { @@ -7106,9 +7106,9 @@ class KeychainControllerMock: KeychainControllerProtocol, @unchecked Sendable { } //MARK: - setPINCode - var setPINCodeThrowableError: Error? + nonisolated(unsafe) var setPINCodeThrowableError: Error? private let setPINCodeCallsCountLock = NSLock() - private var setPINCodeUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setPINCodeUnderlyingCallsCount = 0 var setPINCodeCallsCount: Int { get { setPINCodeCallsCountLock.withLock { setPINCodeUnderlyingCallsCount } } set { setPINCodeCallsCountLock.withLock { setPINCodeUnderlyingCallsCount = newValue } } @@ -7117,18 +7117,18 @@ class KeychainControllerMock: KeychainControllerProtocol, @unchecked Sendable { return setPINCodeCallsCount > 0 } private let setPINCodeReceivedPinCodeLock = NSLock() - private var setPINCodeUnderlyingReceivedPinCode: String? + private nonisolated(unsafe) var setPINCodeUnderlyingReceivedPinCode: String? var setPINCodeReceivedPinCode: String? { get { setPINCodeReceivedPinCodeLock.withLock { setPINCodeUnderlyingReceivedPinCode } } set { setPINCodeReceivedPinCodeLock.withLock { setPINCodeUnderlyingReceivedPinCode = newValue } } } private let setPINCodeReceivedInvocationsLock = NSLock() - private var setPINCodeUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var setPINCodeUnderlyingReceivedInvocations: [String] = [] var setPINCodeReceivedInvocations: [String] { get { setPINCodeReceivedInvocationsLock.withLock { setPINCodeUnderlyingReceivedInvocations } } set { setPINCodeReceivedInvocationsLock.withLock { setPINCodeUnderlyingReceivedInvocations = newValue } } } - var setPINCodeClosure: ((String) throws -> Void)? + nonisolated(unsafe) var setPINCodeClosure: ((String) throws -> Void)? func setPINCode(_ pinCode: String) throws { if let error = setPINCodeThrowableError { @@ -7142,7 +7142,7 @@ class KeychainControllerMock: KeychainControllerProtocol, @unchecked Sendable { //MARK: - pinCode private let pinCodeCallsCountLock = NSLock() - private var pinCodeUnderlyingCallsCount = 0 + private nonisolated(unsafe) var pinCodeUnderlyingCallsCount = 0 var pinCodeCallsCount: Int { get { pinCodeCallsCountLock.withLock { pinCodeUnderlyingCallsCount } } set { pinCodeCallsCountLock.withLock { pinCodeUnderlyingCallsCount = newValue } } @@ -7152,12 +7152,12 @@ class KeychainControllerMock: KeychainControllerProtocol, @unchecked Sendable { } private let pinCodeReturnValueLock = NSLock() - private var pinCodeUnderlyingReturnValue: String? + private nonisolated(unsafe) var pinCodeUnderlyingReturnValue: String? var pinCodeReturnValue: String? { get { pinCodeReturnValueLock.withLock { pinCodeUnderlyingReturnValue } } set { pinCodeReturnValueLock.withLock { pinCodeUnderlyingReturnValue = newValue } } } - var pinCodeClosure: (() -> String?)? + nonisolated(unsafe) var pinCodeClosure: (() -> String?)? func pinCode() -> String? { pinCodeCallsCountLock.withLock { pinCodeUnderlyingCallsCount += 1 } @@ -7170,7 +7170,7 @@ class KeychainControllerMock: KeychainControllerProtocol, @unchecked Sendable { //MARK: - removePINCode private let removePINCodeCallsCountLock = NSLock() - private var removePINCodeUnderlyingCallsCount = 0 + private nonisolated(unsafe) var removePINCodeUnderlyingCallsCount = 0 var removePINCodeCallsCount: Int { get { removePINCodeCallsCountLock.withLock { removePINCodeUnderlyingCallsCount } } set { removePINCodeCallsCountLock.withLock { removePINCodeUnderlyingCallsCount = newValue } } @@ -7178,7 +7178,7 @@ class KeychainControllerMock: KeychainControllerProtocol, @unchecked Sendable { var removePINCodeCalled: Bool { return removePINCodeCallsCount > 0 } - var removePINCodeClosure: (() -> Void)? + nonisolated(unsafe) var removePINCodeClosure: (() -> Void)? func removePINCode() { removePINCodeCallsCountLock.withLock { removePINCodeUnderlyingCallsCount += 1 } @@ -7187,7 +7187,7 @@ class KeychainControllerMock: KeychainControllerProtocol, @unchecked Sendable { //MARK: - containsPINCodeBiometricState private let containsPINCodeBiometricStateCallsCountLock = NSLock() - private var containsPINCodeBiometricStateUnderlyingCallsCount = 0 + private nonisolated(unsafe) var containsPINCodeBiometricStateUnderlyingCallsCount = 0 var containsPINCodeBiometricStateCallsCount: Int { get { containsPINCodeBiometricStateCallsCountLock.withLock { containsPINCodeBiometricStateUnderlyingCallsCount } } set { containsPINCodeBiometricStateCallsCountLock.withLock { containsPINCodeBiometricStateUnderlyingCallsCount = newValue } } @@ -7197,12 +7197,12 @@ class KeychainControllerMock: KeychainControllerProtocol, @unchecked Sendable { } private let containsPINCodeBiometricStateReturnValueLock = NSLock() - private var containsPINCodeBiometricStateUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var containsPINCodeBiometricStateUnderlyingReturnValue: Bool! var containsPINCodeBiometricStateReturnValue: Bool! { get { containsPINCodeBiometricStateReturnValueLock.withLock { containsPINCodeBiometricStateUnderlyingReturnValue } } set { containsPINCodeBiometricStateReturnValueLock.withLock { containsPINCodeBiometricStateUnderlyingReturnValue = newValue } } } - var containsPINCodeBiometricStateClosure: (() -> Bool)? + nonisolated(unsafe) var containsPINCodeBiometricStateClosure: (() -> Bool)? func containsPINCodeBiometricState() -> Bool { containsPINCodeBiometricStateCallsCountLock.withLock { containsPINCodeBiometricStateUnderlyingCallsCount += 1 } @@ -7214,9 +7214,9 @@ class KeychainControllerMock: KeychainControllerProtocol, @unchecked Sendable { } //MARK: - setPINCodeBiometricState - var setPINCodeBiometricStateThrowableError: Error? + nonisolated(unsafe) var setPINCodeBiometricStateThrowableError: Error? private let setPINCodeBiometricStateCallsCountLock = NSLock() - private var setPINCodeBiometricStateUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setPINCodeBiometricStateUnderlyingCallsCount = 0 var setPINCodeBiometricStateCallsCount: Int { get { setPINCodeBiometricStateCallsCountLock.withLock { setPINCodeBiometricStateUnderlyingCallsCount } } set { setPINCodeBiometricStateCallsCountLock.withLock { setPINCodeBiometricStateUnderlyingCallsCount = newValue } } @@ -7225,18 +7225,18 @@ class KeychainControllerMock: KeychainControllerProtocol, @unchecked Sendable { return setPINCodeBiometricStateCallsCount > 0 } private let setPINCodeBiometricStateReceivedStateLock = NSLock() - private var setPINCodeBiometricStateUnderlyingReceivedState: Data? + private nonisolated(unsafe) var setPINCodeBiometricStateUnderlyingReceivedState: Data? var setPINCodeBiometricStateReceivedState: Data? { get { setPINCodeBiometricStateReceivedStateLock.withLock { setPINCodeBiometricStateUnderlyingReceivedState } } set { setPINCodeBiometricStateReceivedStateLock.withLock { setPINCodeBiometricStateUnderlyingReceivedState = newValue } } } private let setPINCodeBiometricStateReceivedInvocationsLock = NSLock() - private var setPINCodeBiometricStateUnderlyingReceivedInvocations: [Data] = [] + private nonisolated(unsafe) var setPINCodeBiometricStateUnderlyingReceivedInvocations: [Data] = [] var setPINCodeBiometricStateReceivedInvocations: [Data] { get { setPINCodeBiometricStateReceivedInvocationsLock.withLock { setPINCodeBiometricStateUnderlyingReceivedInvocations } } set { setPINCodeBiometricStateReceivedInvocationsLock.withLock { setPINCodeBiometricStateUnderlyingReceivedInvocations = newValue } } } - var setPINCodeBiometricStateClosure: ((Data) throws -> Void)? + nonisolated(unsafe) var setPINCodeBiometricStateClosure: ((Data) throws -> Void)? func setPINCodeBiometricState(_ state: Data) throws { if let error = setPINCodeBiometricStateThrowableError { @@ -7250,7 +7250,7 @@ class KeychainControllerMock: KeychainControllerProtocol, @unchecked Sendable { //MARK: - pinCodeBiometricState private let pinCodeBiometricStateCallsCountLock = NSLock() - private var pinCodeBiometricStateUnderlyingCallsCount = 0 + private nonisolated(unsafe) var pinCodeBiometricStateUnderlyingCallsCount = 0 var pinCodeBiometricStateCallsCount: Int { get { pinCodeBiometricStateCallsCountLock.withLock { pinCodeBiometricStateUnderlyingCallsCount } } set { pinCodeBiometricStateCallsCountLock.withLock { pinCodeBiometricStateUnderlyingCallsCount = newValue } } @@ -7260,12 +7260,12 @@ class KeychainControllerMock: KeychainControllerProtocol, @unchecked Sendable { } private let pinCodeBiometricStateReturnValueLock = NSLock() - private var pinCodeBiometricStateUnderlyingReturnValue: Data? + private nonisolated(unsafe) var pinCodeBiometricStateUnderlyingReturnValue: Data? var pinCodeBiometricStateReturnValue: Data? { get { pinCodeBiometricStateReturnValueLock.withLock { pinCodeBiometricStateUnderlyingReturnValue } } set { pinCodeBiometricStateReturnValueLock.withLock { pinCodeBiometricStateUnderlyingReturnValue = newValue } } } - var pinCodeBiometricStateClosure: (() -> Data?)? + nonisolated(unsafe) var pinCodeBiometricStateClosure: (() -> Data?)? func pinCodeBiometricState() -> Data? { pinCodeBiometricStateCallsCountLock.withLock { pinCodeBiometricStateUnderlyingCallsCount += 1 } @@ -7278,7 +7278,7 @@ class KeychainControllerMock: KeychainControllerProtocol, @unchecked Sendable { //MARK: - removePINCodeBiometricState private let removePINCodeBiometricStateCallsCountLock = NSLock() - private var removePINCodeBiometricStateUnderlyingCallsCount = 0 + private nonisolated(unsafe) var removePINCodeBiometricStateUnderlyingCallsCount = 0 var removePINCodeBiometricStateCallsCount: Int { get { removePINCodeBiometricStateCallsCountLock.withLock { removePINCodeBiometricStateUnderlyingCallsCount } } set { removePINCodeBiometricStateCallsCountLock.withLock { removePINCodeBiometricStateUnderlyingCallsCount = newValue } } @@ -7286,38 +7286,38 @@ class KeychainControllerMock: KeychainControllerProtocol, @unchecked Sendable { var removePINCodeBiometricStateCalled: Bool { return removePINCodeBiometricStateCallsCount > 0 } - var removePINCodeBiometricStateClosure: (() -> Void)? + nonisolated(unsafe) var removePINCodeBiometricStateClosure: (() -> Void)? func removePINCodeBiometricState() { removePINCodeBiometricStateCallsCountLock.withLock { removePINCodeBiometricStateUnderlyingCallsCount += 1 } removePINCodeBiometricStateClosure?() } } -class KnockRequestProxyMock: KnockRequestProxyProtocol, @unchecked Sendable { +nonisolated class KnockRequestProxyMock: KnockRequestProxyProtocol, @unchecked Sendable { var eventID: String { get { return underlyingEventID } set(value) { underlyingEventID = value } } - var underlyingEventID: String! + nonisolated(unsafe) var underlyingEventID: String! var userID: String { get { return underlyingUserID } set(value) { underlyingUserID = value } } - var underlyingUserID: String! - var displayName: String? - var avatarURL: URL? - var reason: String? - var formattedTimestamp: String? + nonisolated(unsafe) var underlyingUserID: String! + nonisolated(unsafe) var displayName: String? + nonisolated(unsafe) var avatarURL: URL? + nonisolated(unsafe) var reason: String? + nonisolated(unsafe) var formattedTimestamp: String? var isSeen: Bool { get { return underlyingIsSeen } set(value) { underlyingIsSeen = value } } - var underlyingIsSeen: Bool! + nonisolated(unsafe) var underlyingIsSeen: Bool! //MARK: - accept private let acceptCallsCountLock = NSLock() - private var acceptUnderlyingCallsCount = 0 + private nonisolated(unsafe) var acceptUnderlyingCallsCount = 0 var acceptCallsCount: Int { get { acceptCallsCountLock.withLock { acceptUnderlyingCallsCount } } set { acceptCallsCountLock.withLock { acceptUnderlyingCallsCount = newValue } } @@ -7327,14 +7327,14 @@ class KnockRequestProxyMock: KnockRequestProxyProtocol, @unchecked Sendable { } private let acceptReturnValueLock = NSLock() - private var acceptUnderlyingReturnValue: Result! + private nonisolated(unsafe) var acceptUnderlyingReturnValue: Result! var acceptReturnValue: Result! { get { acceptReturnValueLock.withLock { acceptUnderlyingReturnValue } } set { acceptReturnValueLock.withLock { acceptUnderlyingReturnValue = newValue } } } - var acceptClosure: (() async -> Result)? + nonisolated(unsafe) var acceptClosure: (() async -> Result)? - func accept() async -> Result { + @concurrent func accept() async -> Result { acceptCallsCountLock.withLock { acceptUnderlyingCallsCount += 1 } if let acceptClosure = acceptClosure { return await acceptClosure() @@ -7345,7 +7345,7 @@ class KnockRequestProxyMock: KnockRequestProxyProtocol, @unchecked Sendable { //MARK: - decline private let declineCallsCountLock = NSLock() - private var declineUnderlyingCallsCount = 0 + private nonisolated(unsafe) var declineUnderlyingCallsCount = 0 var declineCallsCount: Int { get { declineCallsCountLock.withLock { declineUnderlyingCallsCount } } set { declineCallsCountLock.withLock { declineUnderlyingCallsCount = newValue } } @@ -7355,14 +7355,14 @@ class KnockRequestProxyMock: KnockRequestProxyProtocol, @unchecked Sendable { } private let declineReturnValueLock = NSLock() - private var declineUnderlyingReturnValue: Result! + private nonisolated(unsafe) var declineUnderlyingReturnValue: Result! var declineReturnValue: Result! { get { declineReturnValueLock.withLock { declineUnderlyingReturnValue } } set { declineReturnValueLock.withLock { declineUnderlyingReturnValue = newValue } } } - var declineClosure: (() async -> Result)? + nonisolated(unsafe) var declineClosure: (() async -> Result)? - func decline() async -> Result { + @concurrent func decline() async -> Result { declineCallsCountLock.withLock { declineUnderlyingCallsCount += 1 } if let declineClosure = declineClosure { return await declineClosure() @@ -7373,7 +7373,7 @@ class KnockRequestProxyMock: KnockRequestProxyProtocol, @unchecked Sendable { //MARK: - ban private let banCallsCountLock = NSLock() - private var banUnderlyingCallsCount = 0 + private nonisolated(unsafe) var banUnderlyingCallsCount = 0 var banCallsCount: Int { get { banCallsCountLock.withLock { banUnderlyingCallsCount } } set { banCallsCountLock.withLock { banUnderlyingCallsCount = newValue } } @@ -7383,14 +7383,14 @@ class KnockRequestProxyMock: KnockRequestProxyProtocol, @unchecked Sendable { } private let banReturnValueLock = NSLock() - private var banUnderlyingReturnValue: Result! + private nonisolated(unsafe) var banUnderlyingReturnValue: Result! var banReturnValue: Result! { get { banReturnValueLock.withLock { banUnderlyingReturnValue } } set { banReturnValueLock.withLock { banUnderlyingReturnValue = newValue } } } - var banClosure: (() async -> Result)? + nonisolated(unsafe) var banClosure: (() async -> Result)? - func ban() async -> Result { + @concurrent func ban() async -> Result { banCallsCountLock.withLock { banUnderlyingCallsCount += 1 } if let banClosure = banClosure { return await banClosure() @@ -7401,7 +7401,7 @@ class KnockRequestProxyMock: KnockRequestProxyProtocol, @unchecked Sendable { //MARK: - markAsSeen private let markAsSeenCallsCountLock = NSLock() - private var markAsSeenUnderlyingCallsCount = 0 + private nonisolated(unsafe) var markAsSeenUnderlyingCallsCount = 0 var markAsSeenCallsCount: Int { get { markAsSeenCallsCountLock.withLock { markAsSeenUnderlyingCallsCount } } set { markAsSeenCallsCountLock.withLock { markAsSeenUnderlyingCallsCount = newValue } } @@ -7411,14 +7411,14 @@ class KnockRequestProxyMock: KnockRequestProxyProtocol, @unchecked Sendable { } private let markAsSeenReturnValueLock = NSLock() - private var markAsSeenUnderlyingReturnValue: Result! + private nonisolated(unsafe) var markAsSeenUnderlyingReturnValue: Result! var markAsSeenReturnValue: Result! { get { markAsSeenReturnValueLock.withLock { markAsSeenUnderlyingReturnValue } } set { markAsSeenReturnValueLock.withLock { markAsSeenUnderlyingReturnValue = newValue } } } - var markAsSeenClosure: (() async -> Result)? + nonisolated(unsafe) var markAsSeenClosure: (() async -> Result)? - func markAsSeen() async -> Result { + @concurrent func markAsSeen() async -> Result { markAsSeenCallsCountLock.withLock { markAsSeenUnderlyingCallsCount += 1 } if let markAsSeenClosure = markAsSeenClosure { return await markAsSeenClosure() @@ -7427,27 +7427,27 @@ class KnockRequestProxyMock: KnockRequestProxyProtocol, @unchecked Sendable { } } } -class KnockedRoomProxyMock: KnockedRoomProxyProtocol, @unchecked Sendable { +nonisolated class KnockedRoomProxyMock: KnockedRoomProxyProtocol, @unchecked Sendable { var info: BaseRoomInfoProxyProtocol { get { return underlyingInfo } set(value) { underlyingInfo = value } } - var underlyingInfo: BaseRoomInfoProxyProtocol! + nonisolated(unsafe) var underlyingInfo: BaseRoomInfoProxyProtocol! var id: String { get { return underlyingId } set(value) { underlyingId = value } } - var underlyingId: String! + nonisolated(unsafe) var underlyingId: String! var ownUserID: String { get { return underlyingOwnUserID } set(value) { underlyingOwnUserID = value } } - var underlyingOwnUserID: String! + nonisolated(unsafe) var underlyingOwnUserID: String! //MARK: - cancelKnock private let cancelKnockCallsCountLock = NSLock() - private var cancelKnockUnderlyingCallsCount = 0 + private nonisolated(unsafe) var cancelKnockUnderlyingCallsCount = 0 var cancelKnockCallsCount: Int { get { cancelKnockCallsCountLock.withLock { cancelKnockUnderlyingCallsCount } } set { cancelKnockCallsCountLock.withLock { cancelKnockUnderlyingCallsCount = newValue } } @@ -7457,14 +7457,14 @@ class KnockedRoomProxyMock: KnockedRoomProxyProtocol, @unchecked Sendable { } private let cancelKnockReturnValueLock = NSLock() - private var cancelKnockUnderlyingReturnValue: Result! + private nonisolated(unsafe) var cancelKnockUnderlyingReturnValue: Result! var cancelKnockReturnValue: Result! { get { cancelKnockReturnValueLock.withLock { cancelKnockUnderlyingReturnValue } } set { cancelKnockReturnValueLock.withLock { cancelKnockUnderlyingReturnValue = newValue } } } - var cancelKnockClosure: (() async -> Result)? + nonisolated(unsafe) var cancelKnockClosure: (() async -> Result)? - func cancelKnock() async -> Result { + @concurrent func cancelKnock() async -> Result { cancelKnockCallsCountLock.withLock { cancelKnockUnderlyingCallsCount += 1 } if let cancelKnockClosure = cancelKnockClosure { return await cancelKnockClosure() @@ -7473,12 +7473,12 @@ class KnockedRoomProxyMock: KnockedRoomProxyProtocol, @unchecked Sendable { } } } -class LinkNewDeviceServiceMock: LinkNewDeviceServiceProtocol, @unchecked Sendable { +nonisolated class LinkNewDeviceServiceMock: LinkNewDeviceServiceProtocol, @unchecked Sendable { //MARK: - linkMobileDevice private let linkMobileDeviceCallsCountLock = NSLock() - private var linkMobileDeviceUnderlyingCallsCount = 0 + private nonisolated(unsafe) var linkMobileDeviceUnderlyingCallsCount = 0 var linkMobileDeviceCallsCount: Int { get { linkMobileDeviceCallsCountLock.withLock { linkMobileDeviceUnderlyingCallsCount } } set { linkMobileDeviceCallsCountLock.withLock { linkMobileDeviceUnderlyingCallsCount = newValue } } @@ -7488,12 +7488,12 @@ class LinkNewDeviceServiceMock: LinkNewDeviceServiceProtocol, @unchecked Sendabl } private let linkMobileDeviceReturnValueLock = NSLock() - private var linkMobileDeviceUnderlyingReturnValue: LinkNewDeviceService.LinkMobileProgressPublisher! + private nonisolated(unsafe) var linkMobileDeviceUnderlyingReturnValue: LinkNewDeviceService.LinkMobileProgressPublisher! var linkMobileDeviceReturnValue: LinkNewDeviceService.LinkMobileProgressPublisher! { get { linkMobileDeviceReturnValueLock.withLock { linkMobileDeviceUnderlyingReturnValue } } set { linkMobileDeviceReturnValueLock.withLock { linkMobileDeviceUnderlyingReturnValue = newValue } } } - var linkMobileDeviceClosure: (() -> LinkNewDeviceService.LinkMobileProgressPublisher)? + nonisolated(unsafe) var linkMobileDeviceClosure: (() -> LinkNewDeviceService.LinkMobileProgressPublisher)? func linkMobileDevice() -> LinkNewDeviceService.LinkMobileProgressPublisher { linkMobileDeviceCallsCountLock.withLock { linkMobileDeviceUnderlyingCallsCount += 1 } @@ -7506,7 +7506,7 @@ class LinkNewDeviceServiceMock: LinkNewDeviceServiceProtocol, @unchecked Sendabl //MARK: - linkDesktopDevice private let linkDesktopDeviceWithCallsCountLock = NSLock() - private var linkDesktopDeviceWithUnderlyingCallsCount = 0 + private nonisolated(unsafe) var linkDesktopDeviceWithUnderlyingCallsCount = 0 var linkDesktopDeviceWithCallsCount: Int { get { linkDesktopDeviceWithCallsCountLock.withLock { linkDesktopDeviceWithUnderlyingCallsCount } } set { linkDesktopDeviceWithCallsCountLock.withLock { linkDesktopDeviceWithUnderlyingCallsCount = newValue } } @@ -7515,25 +7515,25 @@ class LinkNewDeviceServiceMock: LinkNewDeviceServiceProtocol, @unchecked Sendabl return linkDesktopDeviceWithCallsCount > 0 } private let linkDesktopDeviceWithReceivedScannedQRDataLock = NSLock() - private var linkDesktopDeviceWithUnderlyingReceivedScannedQRData: Data? + private nonisolated(unsafe) var linkDesktopDeviceWithUnderlyingReceivedScannedQRData: Data? var linkDesktopDeviceWithReceivedScannedQRData: Data? { get { linkDesktopDeviceWithReceivedScannedQRDataLock.withLock { linkDesktopDeviceWithUnderlyingReceivedScannedQRData } } set { linkDesktopDeviceWithReceivedScannedQRDataLock.withLock { linkDesktopDeviceWithUnderlyingReceivedScannedQRData = newValue } } } private let linkDesktopDeviceWithReceivedInvocationsLock = NSLock() - private var linkDesktopDeviceWithUnderlyingReceivedInvocations: [Data] = [] + private nonisolated(unsafe) var linkDesktopDeviceWithUnderlyingReceivedInvocations: [Data] = [] var linkDesktopDeviceWithReceivedInvocations: [Data] { get { linkDesktopDeviceWithReceivedInvocationsLock.withLock { linkDesktopDeviceWithUnderlyingReceivedInvocations } } set { linkDesktopDeviceWithReceivedInvocationsLock.withLock { linkDesktopDeviceWithUnderlyingReceivedInvocations = newValue } } } private let linkDesktopDeviceWithReturnValueLock = NSLock() - private var linkDesktopDeviceWithUnderlyingReturnValue: LinkNewDeviceService.LinkDesktopProgressPublisher! + private nonisolated(unsafe) var linkDesktopDeviceWithUnderlyingReturnValue: LinkNewDeviceService.LinkDesktopProgressPublisher! var linkDesktopDeviceWithReturnValue: LinkNewDeviceService.LinkDesktopProgressPublisher! { get { linkDesktopDeviceWithReturnValueLock.withLock { linkDesktopDeviceWithUnderlyingReturnValue } } set { linkDesktopDeviceWithReturnValueLock.withLock { linkDesktopDeviceWithUnderlyingReturnValue = newValue } } } - var linkDesktopDeviceWithClosure: ((Data) -> LinkNewDeviceService.LinkDesktopProgressPublisher)? + nonisolated(unsafe) var linkDesktopDeviceWithClosure: ((Data) -> LinkNewDeviceService.LinkDesktopProgressPublisher)? func linkDesktopDevice(with scannedQRData: Data) -> LinkNewDeviceService.LinkDesktopProgressPublisher { linkDesktopDeviceWithCallsCountLock.withLock { linkDesktopDeviceWithUnderlyingCallsCount += 1 } @@ -7546,17 +7546,17 @@ class LinkNewDeviceServiceMock: LinkNewDeviceServiceProtocol, @unchecked Sendabl } } } -class LiveLocationManagerMock: LiveLocationManagerProtocol, @unchecked Sendable { +nonisolated class LiveLocationManagerMock: LiveLocationManagerProtocol, @unchecked Sendable { var authorizationStatus: CurrentValuePublisher { get { return underlyingAuthorizationStatus } set(value) { underlyingAuthorizationStatus = value } } - var underlyingAuthorizationStatus: CurrentValuePublisher! + nonisolated(unsafe) var underlyingAuthorizationStatus: CurrentValuePublisher! //MARK: - requestAlwaysAuthorizationIfPossible private let requestAlwaysAuthorizationIfPossibleCallsCountLock = NSLock() - private var requestAlwaysAuthorizationIfPossibleUnderlyingCallsCount = 0 + private nonisolated(unsafe) var requestAlwaysAuthorizationIfPossibleUnderlyingCallsCount = 0 var requestAlwaysAuthorizationIfPossibleCallsCount: Int { get { requestAlwaysAuthorizationIfPossibleCallsCountLock.withLock { requestAlwaysAuthorizationIfPossibleUnderlyingCallsCount } } set { requestAlwaysAuthorizationIfPossibleCallsCountLock.withLock { requestAlwaysAuthorizationIfPossibleUnderlyingCallsCount = newValue } } @@ -7566,12 +7566,12 @@ class LiveLocationManagerMock: LiveLocationManagerProtocol, @unchecked Sendable } private let requestAlwaysAuthorizationIfPossibleReturnValueLock = NSLock() - private var requestAlwaysAuthorizationIfPossibleUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var requestAlwaysAuthorizationIfPossibleUnderlyingReturnValue: Bool! var requestAlwaysAuthorizationIfPossibleReturnValue: Bool! { get { requestAlwaysAuthorizationIfPossibleReturnValueLock.withLock { requestAlwaysAuthorizationIfPossibleUnderlyingReturnValue } } set { requestAlwaysAuthorizationIfPossibleReturnValueLock.withLock { requestAlwaysAuthorizationIfPossibleUnderlyingReturnValue = newValue } } } - var requestAlwaysAuthorizationIfPossibleClosure: (() -> Bool)? + nonisolated(unsafe) var requestAlwaysAuthorizationIfPossibleClosure: (() -> Bool)? @discardableResult func requestAlwaysAuthorizationIfPossible() -> Bool { @@ -7585,7 +7585,7 @@ class LiveLocationManagerMock: LiveLocationManagerProtocol, @unchecked Sendable //MARK: - startLiveLocation private let startLiveLocationRoomIDDurationCallsCountLock = NSLock() - private var startLiveLocationRoomIDDurationUnderlyingCallsCount = 0 + private nonisolated(unsafe) var startLiveLocationRoomIDDurationUnderlyingCallsCount = 0 var startLiveLocationRoomIDDurationCallsCount: Int { get { startLiveLocationRoomIDDurationCallsCountLock.withLock { startLiveLocationRoomIDDurationUnderlyingCallsCount } } set { startLiveLocationRoomIDDurationCallsCountLock.withLock { startLiveLocationRoomIDDurationUnderlyingCallsCount = newValue } } @@ -7594,27 +7594,27 @@ class LiveLocationManagerMock: LiveLocationManagerProtocol, @unchecked Sendable return startLiveLocationRoomIDDurationCallsCount > 0 } private let startLiveLocationRoomIDDurationReceivedArgumentsLock = NSLock() - private var startLiveLocationRoomIDDurationUnderlyingReceivedArguments: (roomID: String, duration: Duration)? + private nonisolated(unsafe) var startLiveLocationRoomIDDurationUnderlyingReceivedArguments: (roomID: String, duration: Duration)? var startLiveLocationRoomIDDurationReceivedArguments: (roomID: String, duration: Duration)? { get { startLiveLocationRoomIDDurationReceivedArgumentsLock.withLock { startLiveLocationRoomIDDurationUnderlyingReceivedArguments } } set { startLiveLocationRoomIDDurationReceivedArgumentsLock.withLock { startLiveLocationRoomIDDurationUnderlyingReceivedArguments = newValue } } } private let startLiveLocationRoomIDDurationReceivedInvocationsLock = NSLock() - private var startLiveLocationRoomIDDurationUnderlyingReceivedInvocations: [(roomID: String, duration: Duration)] = [] + private nonisolated(unsafe) var startLiveLocationRoomIDDurationUnderlyingReceivedInvocations: [(roomID: String, duration: Duration)] = [] var startLiveLocationRoomIDDurationReceivedInvocations: [(roomID: String, duration: Duration)] { get { startLiveLocationRoomIDDurationReceivedInvocationsLock.withLock { startLiveLocationRoomIDDurationUnderlyingReceivedInvocations } } set { startLiveLocationRoomIDDurationReceivedInvocationsLock.withLock { startLiveLocationRoomIDDurationUnderlyingReceivedInvocations = newValue } } } private let startLiveLocationRoomIDDurationReturnValueLock = NSLock() - private var startLiveLocationRoomIDDurationUnderlyingReturnValue: Result! + private nonisolated(unsafe) var startLiveLocationRoomIDDurationUnderlyingReturnValue: Result! var startLiveLocationRoomIDDurationReturnValue: Result! { get { startLiveLocationRoomIDDurationReturnValueLock.withLock { startLiveLocationRoomIDDurationUnderlyingReturnValue } } set { startLiveLocationRoomIDDurationReturnValueLock.withLock { startLiveLocationRoomIDDurationUnderlyingReturnValue = newValue } } } - var startLiveLocationRoomIDDurationClosure: ((String, Duration) async -> Result)? + nonisolated(unsafe) var startLiveLocationRoomIDDurationClosure: ((String, Duration) async -> Result)? - func startLiveLocation(roomID: String, duration: Duration) async -> Result { + @concurrent func startLiveLocation(roomID: String, duration: Duration) async -> Result { startLiveLocationRoomIDDurationCallsCountLock.withLock { startLiveLocationRoomIDDurationUnderlyingCallsCount += 1 } startLiveLocationRoomIDDurationReceivedArguments = (roomID: roomID, duration: duration) startLiveLocationRoomIDDurationReceivedInvocationsLock.withLock { startLiveLocationRoomIDDurationUnderlyingReceivedInvocations.append((roomID: roomID, duration: duration)) } @@ -7627,7 +7627,7 @@ class LiveLocationManagerMock: LiveLocationManagerProtocol, @unchecked Sendable //MARK: - stopLiveLocation private let stopLiveLocationRoomIDCallsCountLock = NSLock() - private var stopLiveLocationRoomIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var stopLiveLocationRoomIDUnderlyingCallsCount = 0 var stopLiveLocationRoomIDCallsCount: Int { get { stopLiveLocationRoomIDCallsCountLock.withLock { stopLiveLocationRoomIDUnderlyingCallsCount } } set { stopLiveLocationRoomIDCallsCountLock.withLock { stopLiveLocationRoomIDUnderlyingCallsCount = newValue } } @@ -7636,33 +7636,33 @@ class LiveLocationManagerMock: LiveLocationManagerProtocol, @unchecked Sendable return stopLiveLocationRoomIDCallsCount > 0 } private let stopLiveLocationRoomIDReceivedRoomIDLock = NSLock() - private var stopLiveLocationRoomIDUnderlyingReceivedRoomID: String? + private nonisolated(unsafe) var stopLiveLocationRoomIDUnderlyingReceivedRoomID: String? var stopLiveLocationRoomIDReceivedRoomID: String? { get { stopLiveLocationRoomIDReceivedRoomIDLock.withLock { stopLiveLocationRoomIDUnderlyingReceivedRoomID } } set { stopLiveLocationRoomIDReceivedRoomIDLock.withLock { stopLiveLocationRoomIDUnderlyingReceivedRoomID = newValue } } } private let stopLiveLocationRoomIDReceivedInvocationsLock = NSLock() - private var stopLiveLocationRoomIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var stopLiveLocationRoomIDUnderlyingReceivedInvocations: [String] = [] var stopLiveLocationRoomIDReceivedInvocations: [String] { get { stopLiveLocationRoomIDReceivedInvocationsLock.withLock { stopLiveLocationRoomIDUnderlyingReceivedInvocations } } set { stopLiveLocationRoomIDReceivedInvocationsLock.withLock { stopLiveLocationRoomIDUnderlyingReceivedInvocations = newValue } } } - var stopLiveLocationRoomIDClosure: ((String) async -> Void)? + nonisolated(unsafe) var stopLiveLocationRoomIDClosure: ((String) async -> Void)? - func stopLiveLocation(roomID: String) async { + @concurrent func stopLiveLocation(roomID: String) async { stopLiveLocationRoomIDCallsCountLock.withLock { stopLiveLocationRoomIDUnderlyingCallsCount += 1 } stopLiveLocationRoomIDReceivedRoomID = roomID stopLiveLocationRoomIDReceivedInvocationsLock.withLock { stopLiveLocationRoomIDUnderlyingReceivedInvocations.append(roomID) } await stopLiveLocationRoomIDClosure?(roomID) } } -class MediaLoaderMock: MediaLoaderProtocol, @unchecked Sendable { +nonisolated class MediaLoaderMock: MediaLoaderProtocol, @unchecked Sendable { //MARK: - loadMediaContentForSource - var loadMediaContentForSourceThrowableError: Error? + nonisolated(unsafe) var loadMediaContentForSourceThrowableError: Error? private let loadMediaContentForSourceCallsCountLock = NSLock() - private var loadMediaContentForSourceUnderlyingCallsCount = 0 + private nonisolated(unsafe) var loadMediaContentForSourceUnderlyingCallsCount = 0 var loadMediaContentForSourceCallsCount: Int { get { loadMediaContentForSourceCallsCountLock.withLock { loadMediaContentForSourceUnderlyingCallsCount } } set { loadMediaContentForSourceCallsCountLock.withLock { loadMediaContentForSourceUnderlyingCallsCount = newValue } } @@ -7671,27 +7671,27 @@ class MediaLoaderMock: MediaLoaderProtocol, @unchecked Sendable { return loadMediaContentForSourceCallsCount > 0 } private let loadMediaContentForSourceReceivedSourceLock = NSLock() - private var loadMediaContentForSourceUnderlyingReceivedSource: MediaSourceProxy? + private nonisolated(unsafe) var loadMediaContentForSourceUnderlyingReceivedSource: MediaSourceProxy? var loadMediaContentForSourceReceivedSource: MediaSourceProxy? { get { loadMediaContentForSourceReceivedSourceLock.withLock { loadMediaContentForSourceUnderlyingReceivedSource } } set { loadMediaContentForSourceReceivedSourceLock.withLock { loadMediaContentForSourceUnderlyingReceivedSource = newValue } } } private let loadMediaContentForSourceReceivedInvocationsLock = NSLock() - private var loadMediaContentForSourceUnderlyingReceivedInvocations: [MediaSourceProxy] = [] + private nonisolated(unsafe) var loadMediaContentForSourceUnderlyingReceivedInvocations: [MediaSourceProxy] = [] var loadMediaContentForSourceReceivedInvocations: [MediaSourceProxy] { get { loadMediaContentForSourceReceivedInvocationsLock.withLock { loadMediaContentForSourceUnderlyingReceivedInvocations } } set { loadMediaContentForSourceReceivedInvocationsLock.withLock { loadMediaContentForSourceUnderlyingReceivedInvocations = newValue } } } private let loadMediaContentForSourceReturnValueLock = NSLock() - private var loadMediaContentForSourceUnderlyingReturnValue: Data! + private nonisolated(unsafe) var loadMediaContentForSourceUnderlyingReturnValue: Data! var loadMediaContentForSourceReturnValue: Data! { get { loadMediaContentForSourceReturnValueLock.withLock { loadMediaContentForSourceUnderlyingReturnValue } } set { loadMediaContentForSourceReturnValueLock.withLock { loadMediaContentForSourceUnderlyingReturnValue = newValue } } } - var loadMediaContentForSourceClosure: ((MediaSourceProxy) async throws -> Data)? + nonisolated(unsafe) var loadMediaContentForSourceClosure: ((MediaSourceProxy) async throws -> Data)? - func loadMediaContentForSource(_ source: MediaSourceProxy) async throws -> Data { + @concurrent func loadMediaContentForSource(_ source: MediaSourceProxy) async throws -> Data { if let error = loadMediaContentForSourceThrowableError { throw error } @@ -7706,9 +7706,9 @@ class MediaLoaderMock: MediaLoaderProtocol, @unchecked Sendable { } //MARK: - loadMediaThumbnailForSource - var loadMediaThumbnailForSourceWidthHeightThrowableError: Error? + nonisolated(unsafe) var loadMediaThumbnailForSourceWidthHeightThrowableError: Error? private let loadMediaThumbnailForSourceWidthHeightCallsCountLock = NSLock() - private var loadMediaThumbnailForSourceWidthHeightUnderlyingCallsCount = 0 + private nonisolated(unsafe) var loadMediaThumbnailForSourceWidthHeightUnderlyingCallsCount = 0 var loadMediaThumbnailForSourceWidthHeightCallsCount: Int { get { loadMediaThumbnailForSourceWidthHeightCallsCountLock.withLock { loadMediaThumbnailForSourceWidthHeightUnderlyingCallsCount } } set { loadMediaThumbnailForSourceWidthHeightCallsCountLock.withLock { loadMediaThumbnailForSourceWidthHeightUnderlyingCallsCount = newValue } } @@ -7717,27 +7717,27 @@ class MediaLoaderMock: MediaLoaderProtocol, @unchecked Sendable { return loadMediaThumbnailForSourceWidthHeightCallsCount > 0 } private let loadMediaThumbnailForSourceWidthHeightReceivedArgumentsLock = NSLock() - private var loadMediaThumbnailForSourceWidthHeightUnderlyingReceivedArguments: (source: MediaSourceProxy, width: UInt, height: UInt)? + private nonisolated(unsafe) var loadMediaThumbnailForSourceWidthHeightUnderlyingReceivedArguments: (source: MediaSourceProxy, width: UInt, height: UInt)? var loadMediaThumbnailForSourceWidthHeightReceivedArguments: (source: MediaSourceProxy, width: UInt, height: UInt)? { get { loadMediaThumbnailForSourceWidthHeightReceivedArgumentsLock.withLock { loadMediaThumbnailForSourceWidthHeightUnderlyingReceivedArguments } } set { loadMediaThumbnailForSourceWidthHeightReceivedArgumentsLock.withLock { loadMediaThumbnailForSourceWidthHeightUnderlyingReceivedArguments = newValue } } } private let loadMediaThumbnailForSourceWidthHeightReceivedInvocationsLock = NSLock() - private var loadMediaThumbnailForSourceWidthHeightUnderlyingReceivedInvocations: [(source: MediaSourceProxy, width: UInt, height: UInt)] = [] + private nonisolated(unsafe) var loadMediaThumbnailForSourceWidthHeightUnderlyingReceivedInvocations: [(source: MediaSourceProxy, width: UInt, height: UInt)] = [] var loadMediaThumbnailForSourceWidthHeightReceivedInvocations: [(source: MediaSourceProxy, width: UInt, height: UInt)] { get { loadMediaThumbnailForSourceWidthHeightReceivedInvocationsLock.withLock { loadMediaThumbnailForSourceWidthHeightUnderlyingReceivedInvocations } } set { loadMediaThumbnailForSourceWidthHeightReceivedInvocationsLock.withLock { loadMediaThumbnailForSourceWidthHeightUnderlyingReceivedInvocations = newValue } } } private let loadMediaThumbnailForSourceWidthHeightReturnValueLock = NSLock() - private var loadMediaThumbnailForSourceWidthHeightUnderlyingReturnValue: Data! + private nonisolated(unsafe) var loadMediaThumbnailForSourceWidthHeightUnderlyingReturnValue: Data! var loadMediaThumbnailForSourceWidthHeightReturnValue: Data! { get { loadMediaThumbnailForSourceWidthHeightReturnValueLock.withLock { loadMediaThumbnailForSourceWidthHeightUnderlyingReturnValue } } set { loadMediaThumbnailForSourceWidthHeightReturnValueLock.withLock { loadMediaThumbnailForSourceWidthHeightUnderlyingReturnValue = newValue } } } - var loadMediaThumbnailForSourceWidthHeightClosure: ((MediaSourceProxy, UInt, UInt) async throws -> Data)? + nonisolated(unsafe) var loadMediaThumbnailForSourceWidthHeightClosure: ((MediaSourceProxy, UInt, UInt) async throws -> Data)? - func loadMediaThumbnailForSource(_ source: MediaSourceProxy, width: UInt, height: UInt) async throws -> Data { + @concurrent func loadMediaThumbnailForSource(_ source: MediaSourceProxy, width: UInt, height: UInt) async throws -> Data { if let error = loadMediaThumbnailForSourceWidthHeightThrowableError { throw error } @@ -7752,9 +7752,9 @@ class MediaLoaderMock: MediaLoaderProtocol, @unchecked Sendable { } //MARK: - loadMediaFileForSource - var loadMediaFileForSourceFilenameThrowableError: Error? + nonisolated(unsafe) var loadMediaFileForSourceFilenameThrowableError: Error? private let loadMediaFileForSourceFilenameCallsCountLock = NSLock() - private var loadMediaFileForSourceFilenameUnderlyingCallsCount = 0 + private nonisolated(unsafe) var loadMediaFileForSourceFilenameUnderlyingCallsCount = 0 var loadMediaFileForSourceFilenameCallsCount: Int { get { loadMediaFileForSourceFilenameCallsCountLock.withLock { loadMediaFileForSourceFilenameUnderlyingCallsCount } } set { loadMediaFileForSourceFilenameCallsCountLock.withLock { loadMediaFileForSourceFilenameUnderlyingCallsCount = newValue } } @@ -7763,27 +7763,27 @@ class MediaLoaderMock: MediaLoaderProtocol, @unchecked Sendable { return loadMediaFileForSourceFilenameCallsCount > 0 } private let loadMediaFileForSourceFilenameReceivedArgumentsLock = NSLock() - private var loadMediaFileForSourceFilenameUnderlyingReceivedArguments: (source: MediaSourceProxy, filename: String?)? + private nonisolated(unsafe) var loadMediaFileForSourceFilenameUnderlyingReceivedArguments: (source: MediaSourceProxy, filename: String?)? var loadMediaFileForSourceFilenameReceivedArguments: (source: MediaSourceProxy, filename: String?)? { get { loadMediaFileForSourceFilenameReceivedArgumentsLock.withLock { loadMediaFileForSourceFilenameUnderlyingReceivedArguments } } set { loadMediaFileForSourceFilenameReceivedArgumentsLock.withLock { loadMediaFileForSourceFilenameUnderlyingReceivedArguments = newValue } } } private let loadMediaFileForSourceFilenameReceivedInvocationsLock = NSLock() - private var loadMediaFileForSourceFilenameUnderlyingReceivedInvocations: [(source: MediaSourceProxy, filename: String?)] = [] + private nonisolated(unsafe) var loadMediaFileForSourceFilenameUnderlyingReceivedInvocations: [(source: MediaSourceProxy, filename: String?)] = [] var loadMediaFileForSourceFilenameReceivedInvocations: [(source: MediaSourceProxy, filename: String?)] { get { loadMediaFileForSourceFilenameReceivedInvocationsLock.withLock { loadMediaFileForSourceFilenameUnderlyingReceivedInvocations } } set { loadMediaFileForSourceFilenameReceivedInvocationsLock.withLock { loadMediaFileForSourceFilenameUnderlyingReceivedInvocations = newValue } } } private let loadMediaFileForSourceFilenameReturnValueLock = NSLock() - private var loadMediaFileForSourceFilenameUnderlyingReturnValue: MediaFileHandleProxy! + private nonisolated(unsafe) var loadMediaFileForSourceFilenameUnderlyingReturnValue: MediaFileHandleProxy! var loadMediaFileForSourceFilenameReturnValue: MediaFileHandleProxy! { get { loadMediaFileForSourceFilenameReturnValueLock.withLock { loadMediaFileForSourceFilenameUnderlyingReturnValue } } set { loadMediaFileForSourceFilenameReturnValueLock.withLock { loadMediaFileForSourceFilenameUnderlyingReturnValue = newValue } } } - var loadMediaFileForSourceFilenameClosure: ((MediaSourceProxy, String?) async throws -> MediaFileHandleProxy)? + nonisolated(unsafe) var loadMediaFileForSourceFilenameClosure: ((MediaSourceProxy, String?) async throws -> MediaFileHandleProxy)? - func loadMediaFileForSource(_ source: MediaSourceProxy, filename: String?) async throws -> MediaFileHandleProxy { + @concurrent func loadMediaFileForSource(_ source: MediaSourceProxy, filename: String?) async throws -> MediaFileHandleProxy { if let error = loadMediaFileForSourceFilenameThrowableError { throw error } @@ -7797,17 +7797,17 @@ class MediaLoaderMock: MediaLoaderProtocol, @unchecked Sendable { } } } -class MediaPlayerProviderMock: MediaPlayerProviderProtocol, @unchecked Sendable { +nonisolated class MediaPlayerProviderMock: MediaPlayerProviderProtocol, @unchecked Sendable { var player: AudioPlayerProtocol { get { return underlyingPlayer } set(value) { underlyingPlayer = value } } - var underlyingPlayer: AudioPlayerProtocol! + nonisolated(unsafe) var underlyingPlayer: AudioPlayerProtocol! //MARK: - playerState private let playerStateForCallsCountLock = NSLock() - private var playerStateForUnderlyingCallsCount = 0 + private nonisolated(unsafe) var playerStateForUnderlyingCallsCount = 0 var playerStateForCallsCount: Int { get { playerStateForCallsCountLock.withLock { playerStateForUnderlyingCallsCount } } set { playerStateForCallsCountLock.withLock { playerStateForUnderlyingCallsCount = newValue } } @@ -7816,25 +7816,25 @@ class MediaPlayerProviderMock: MediaPlayerProviderProtocol, @unchecked Sendable return playerStateForCallsCount > 0 } private let playerStateForReceivedIdLock = NSLock() - private var playerStateForUnderlyingReceivedId: AudioPlayerStateIdentifier? + private nonisolated(unsafe) var playerStateForUnderlyingReceivedId: AudioPlayerStateIdentifier? var playerStateForReceivedId: AudioPlayerStateIdentifier? { get { playerStateForReceivedIdLock.withLock { playerStateForUnderlyingReceivedId } } set { playerStateForReceivedIdLock.withLock { playerStateForUnderlyingReceivedId = newValue } } } private let playerStateForReceivedInvocationsLock = NSLock() - private var playerStateForUnderlyingReceivedInvocations: [AudioPlayerStateIdentifier] = [] + private nonisolated(unsafe) var playerStateForUnderlyingReceivedInvocations: [AudioPlayerStateIdentifier] = [] var playerStateForReceivedInvocations: [AudioPlayerStateIdentifier] { get { playerStateForReceivedInvocationsLock.withLock { playerStateForUnderlyingReceivedInvocations } } set { playerStateForReceivedInvocationsLock.withLock { playerStateForUnderlyingReceivedInvocations = newValue } } } private let playerStateForReturnValueLock = NSLock() - private var playerStateForUnderlyingReturnValue: AudioPlayerState? + private nonisolated(unsafe) var playerStateForUnderlyingReturnValue: AudioPlayerState? var playerStateForReturnValue: AudioPlayerState? { get { playerStateForReturnValueLock.withLock { playerStateForUnderlyingReturnValue } } set { playerStateForReturnValueLock.withLock { playerStateForUnderlyingReturnValue = newValue } } } - var playerStateForClosure: ((AudioPlayerStateIdentifier) -> AudioPlayerState?)? + nonisolated(unsafe) var playerStateForClosure: ((AudioPlayerStateIdentifier) -> AudioPlayerState?)? func playerState(for id: AudioPlayerStateIdentifier) -> AudioPlayerState? { playerStateForCallsCountLock.withLock { playerStateForUnderlyingCallsCount += 1 } @@ -7849,7 +7849,7 @@ class MediaPlayerProviderMock: MediaPlayerProviderProtocol, @unchecked Sendable //MARK: - register private let registerAudioPlayerStateCallsCountLock = NSLock() - private var registerAudioPlayerStateUnderlyingCallsCount = 0 + private nonisolated(unsafe) var registerAudioPlayerStateUnderlyingCallsCount = 0 var registerAudioPlayerStateCallsCount: Int { get { registerAudioPlayerStateCallsCountLock.withLock { registerAudioPlayerStateUnderlyingCallsCount } } set { registerAudioPlayerStateCallsCountLock.withLock { registerAudioPlayerStateUnderlyingCallsCount = newValue } } @@ -7858,18 +7858,18 @@ class MediaPlayerProviderMock: MediaPlayerProviderProtocol, @unchecked Sendable return registerAudioPlayerStateCallsCount > 0 } private let registerAudioPlayerStateReceivedAudioPlayerStateLock = NSLock() - private var registerAudioPlayerStateUnderlyingReceivedAudioPlayerState: AudioPlayerState? + private nonisolated(unsafe) var registerAudioPlayerStateUnderlyingReceivedAudioPlayerState: AudioPlayerState? var registerAudioPlayerStateReceivedAudioPlayerState: AudioPlayerState? { get { registerAudioPlayerStateReceivedAudioPlayerStateLock.withLock { registerAudioPlayerStateUnderlyingReceivedAudioPlayerState } } set { registerAudioPlayerStateReceivedAudioPlayerStateLock.withLock { registerAudioPlayerStateUnderlyingReceivedAudioPlayerState = newValue } } } private let registerAudioPlayerStateReceivedInvocationsLock = NSLock() - private var registerAudioPlayerStateUnderlyingReceivedInvocations: [AudioPlayerState] = [] + private nonisolated(unsafe) var registerAudioPlayerStateUnderlyingReceivedInvocations: [AudioPlayerState] = [] var registerAudioPlayerStateReceivedInvocations: [AudioPlayerState] { get { registerAudioPlayerStateReceivedInvocationsLock.withLock { registerAudioPlayerStateUnderlyingReceivedInvocations } } set { registerAudioPlayerStateReceivedInvocationsLock.withLock { registerAudioPlayerStateUnderlyingReceivedInvocations = newValue } } } - var registerAudioPlayerStateClosure: ((AudioPlayerState) -> Void)? + nonisolated(unsafe) var registerAudioPlayerStateClosure: ((AudioPlayerState) -> Void)? func register(audioPlayerState: AudioPlayerState) { registerAudioPlayerStateCallsCountLock.withLock { registerAudioPlayerStateUnderlyingCallsCount += 1 } @@ -7880,7 +7880,7 @@ class MediaPlayerProviderMock: MediaPlayerProviderProtocol, @unchecked Sendable //MARK: - unregister private let unregisterAudioPlayerStateCallsCountLock = NSLock() - private var unregisterAudioPlayerStateUnderlyingCallsCount = 0 + private nonisolated(unsafe) var unregisterAudioPlayerStateUnderlyingCallsCount = 0 var unregisterAudioPlayerStateCallsCount: Int { get { unregisterAudioPlayerStateCallsCountLock.withLock { unregisterAudioPlayerStateUnderlyingCallsCount } } set { unregisterAudioPlayerStateCallsCountLock.withLock { unregisterAudioPlayerStateUnderlyingCallsCount = newValue } } @@ -7889,18 +7889,18 @@ class MediaPlayerProviderMock: MediaPlayerProviderProtocol, @unchecked Sendable return unregisterAudioPlayerStateCallsCount > 0 } private let unregisterAudioPlayerStateReceivedAudioPlayerStateLock = NSLock() - private var unregisterAudioPlayerStateUnderlyingReceivedAudioPlayerState: AudioPlayerState? + private nonisolated(unsafe) var unregisterAudioPlayerStateUnderlyingReceivedAudioPlayerState: AudioPlayerState? var unregisterAudioPlayerStateReceivedAudioPlayerState: AudioPlayerState? { get { unregisterAudioPlayerStateReceivedAudioPlayerStateLock.withLock { unregisterAudioPlayerStateUnderlyingReceivedAudioPlayerState } } set { unregisterAudioPlayerStateReceivedAudioPlayerStateLock.withLock { unregisterAudioPlayerStateUnderlyingReceivedAudioPlayerState = newValue } } } private let unregisterAudioPlayerStateReceivedInvocationsLock = NSLock() - private var unregisterAudioPlayerStateUnderlyingReceivedInvocations: [AudioPlayerState] = [] + private nonisolated(unsafe) var unregisterAudioPlayerStateUnderlyingReceivedInvocations: [AudioPlayerState] = [] var unregisterAudioPlayerStateReceivedInvocations: [AudioPlayerState] { get { unregisterAudioPlayerStateReceivedInvocationsLock.withLock { unregisterAudioPlayerStateUnderlyingReceivedInvocations } } set { unregisterAudioPlayerStateReceivedInvocationsLock.withLock { unregisterAudioPlayerStateUnderlyingReceivedInvocations = newValue } } } - var unregisterAudioPlayerStateClosure: ((AudioPlayerState) -> Void)? + nonisolated(unsafe) var unregisterAudioPlayerStateClosure: ((AudioPlayerState) -> Void)? func unregister(audioPlayerState: AudioPlayerState) { unregisterAudioPlayerStateCallsCountLock.withLock { unregisterAudioPlayerStateUnderlyingCallsCount += 1 } @@ -7911,7 +7911,7 @@ class MediaPlayerProviderMock: MediaPlayerProviderProtocol, @unchecked Sendable //MARK: - detachAllStates private let detachAllStatesExceptCallsCountLock = NSLock() - private var detachAllStatesExceptUnderlyingCallsCount = 0 + private nonisolated(unsafe) var detachAllStatesExceptUnderlyingCallsCount = 0 var detachAllStatesExceptCallsCount: Int { get { detachAllStatesExceptCallsCountLock.withLock { detachAllStatesExceptUnderlyingCallsCount } } set { detachAllStatesExceptCallsCountLock.withLock { detachAllStatesExceptUnderlyingCallsCount = newValue } } @@ -7920,32 +7920,32 @@ class MediaPlayerProviderMock: MediaPlayerProviderProtocol, @unchecked Sendable return detachAllStatesExceptCallsCount > 0 } private let detachAllStatesExceptReceivedExceptionLock = NSLock() - private var detachAllStatesExceptUnderlyingReceivedException: AudioPlayerState? + private nonisolated(unsafe) var detachAllStatesExceptUnderlyingReceivedException: AudioPlayerState? var detachAllStatesExceptReceivedException: AudioPlayerState? { get { detachAllStatesExceptReceivedExceptionLock.withLock { detachAllStatesExceptUnderlyingReceivedException } } set { detachAllStatesExceptReceivedExceptionLock.withLock { detachAllStatesExceptUnderlyingReceivedException = newValue } } } private let detachAllStatesExceptReceivedInvocationsLock = NSLock() - private var detachAllStatesExceptUnderlyingReceivedInvocations: [AudioPlayerState?] = [] + private nonisolated(unsafe) var detachAllStatesExceptUnderlyingReceivedInvocations: [AudioPlayerState?] = [] var detachAllStatesExceptReceivedInvocations: [AudioPlayerState?] { get { detachAllStatesExceptReceivedInvocationsLock.withLock { detachAllStatesExceptUnderlyingReceivedInvocations } } set { detachAllStatesExceptReceivedInvocationsLock.withLock { detachAllStatesExceptUnderlyingReceivedInvocations = newValue } } } - var detachAllStatesExceptClosure: ((AudioPlayerState?) async -> Void)? + nonisolated(unsafe) var detachAllStatesExceptClosure: ((AudioPlayerState?) async -> Void)? - func detachAllStates(except exception: AudioPlayerState?) async { + @concurrent func detachAllStates(except exception: AudioPlayerState?) async { detachAllStatesExceptCallsCountLock.withLock { detachAllStatesExceptUnderlyingCallsCount += 1 } detachAllStatesExceptReceivedException = exception detachAllStatesExceptReceivedInvocationsLock.withLock { detachAllStatesExceptUnderlyingReceivedInvocations.append(exception) } await detachAllStatesExceptClosure?(exception) } } -class MediaProviderMock: MediaProviderProtocol, @unchecked Sendable { +nonisolated class MediaProviderMock: MediaProviderProtocol, @unchecked Sendable { //MARK: - imageFromSource private let imageFromSourceSizeCallsCountLock = NSLock() - private var imageFromSourceSizeUnderlyingCallsCount = 0 + private nonisolated(unsafe) var imageFromSourceSizeUnderlyingCallsCount = 0 var imageFromSourceSizeCallsCount: Int { get { imageFromSourceSizeCallsCountLock.withLock { imageFromSourceSizeUnderlyingCallsCount } } set { imageFromSourceSizeCallsCountLock.withLock { imageFromSourceSizeUnderlyingCallsCount = newValue } } @@ -7954,25 +7954,25 @@ class MediaProviderMock: MediaProviderProtocol, @unchecked Sendable { return imageFromSourceSizeCallsCount > 0 } private let imageFromSourceSizeReceivedArgumentsLock = NSLock() - private var imageFromSourceSizeUnderlyingReceivedArguments: (source: MediaSourceProxy?, size: CGSize?)? + private nonisolated(unsafe) var imageFromSourceSizeUnderlyingReceivedArguments: (source: MediaSourceProxy?, size: CGSize?)? var imageFromSourceSizeReceivedArguments: (source: MediaSourceProxy?, size: CGSize?)? { get { imageFromSourceSizeReceivedArgumentsLock.withLock { imageFromSourceSizeUnderlyingReceivedArguments } } set { imageFromSourceSizeReceivedArgumentsLock.withLock { imageFromSourceSizeUnderlyingReceivedArguments = newValue } } } private let imageFromSourceSizeReceivedInvocationsLock = NSLock() - private var imageFromSourceSizeUnderlyingReceivedInvocations: [(source: MediaSourceProxy?, size: CGSize?)] = [] + private nonisolated(unsafe) var imageFromSourceSizeUnderlyingReceivedInvocations: [(source: MediaSourceProxy?, size: CGSize?)] = [] var imageFromSourceSizeReceivedInvocations: [(source: MediaSourceProxy?, size: CGSize?)] { get { imageFromSourceSizeReceivedInvocationsLock.withLock { imageFromSourceSizeUnderlyingReceivedInvocations } } set { imageFromSourceSizeReceivedInvocationsLock.withLock { imageFromSourceSizeUnderlyingReceivedInvocations = newValue } } } private let imageFromSourceSizeReturnValueLock = NSLock() - private var imageFromSourceSizeUnderlyingReturnValue: UIImage? + private nonisolated(unsafe) var imageFromSourceSizeUnderlyingReturnValue: UIImage? var imageFromSourceSizeReturnValue: UIImage? { get { imageFromSourceSizeReturnValueLock.withLock { imageFromSourceSizeUnderlyingReturnValue } } set { imageFromSourceSizeReturnValueLock.withLock { imageFromSourceSizeUnderlyingReturnValue = newValue } } } - var imageFromSourceSizeClosure: ((MediaSourceProxy?, CGSize?) -> UIImage?)? + nonisolated(unsafe) var imageFromSourceSizeClosure: ((MediaSourceProxy?, CGSize?) -> UIImage?)? func imageFromSource(_ source: MediaSourceProxy?, size: CGSize?) -> UIImage? { imageFromSourceSizeCallsCountLock.withLock { imageFromSourceSizeUnderlyingCallsCount += 1 } @@ -7987,7 +7987,7 @@ class MediaProviderMock: MediaProviderProtocol, @unchecked Sendable { //MARK: - loadImageFromSource private let loadImageFromSourceSizeCallsCountLock = NSLock() - private var loadImageFromSourceSizeUnderlyingCallsCount = 0 + private nonisolated(unsafe) var loadImageFromSourceSizeUnderlyingCallsCount = 0 var loadImageFromSourceSizeCallsCount: Int { get { loadImageFromSourceSizeCallsCountLock.withLock { loadImageFromSourceSizeUnderlyingCallsCount } } set { loadImageFromSourceSizeCallsCountLock.withLock { loadImageFromSourceSizeUnderlyingCallsCount = newValue } } @@ -7996,27 +7996,27 @@ class MediaProviderMock: MediaProviderProtocol, @unchecked Sendable { return loadImageFromSourceSizeCallsCount > 0 } private let loadImageFromSourceSizeReceivedArgumentsLock = NSLock() - private var loadImageFromSourceSizeUnderlyingReceivedArguments: (source: MediaSourceProxy, size: CGSize?)? + private nonisolated(unsafe) var loadImageFromSourceSizeUnderlyingReceivedArguments: (source: MediaSourceProxy, size: CGSize?)? var loadImageFromSourceSizeReceivedArguments: (source: MediaSourceProxy, size: CGSize?)? { get { loadImageFromSourceSizeReceivedArgumentsLock.withLock { loadImageFromSourceSizeUnderlyingReceivedArguments } } set { loadImageFromSourceSizeReceivedArgumentsLock.withLock { loadImageFromSourceSizeUnderlyingReceivedArguments = newValue } } } private let loadImageFromSourceSizeReceivedInvocationsLock = NSLock() - private var loadImageFromSourceSizeUnderlyingReceivedInvocations: [(source: MediaSourceProxy, size: CGSize?)] = [] + private nonisolated(unsafe) var loadImageFromSourceSizeUnderlyingReceivedInvocations: [(source: MediaSourceProxy, size: CGSize?)] = [] var loadImageFromSourceSizeReceivedInvocations: [(source: MediaSourceProxy, size: CGSize?)] { get { loadImageFromSourceSizeReceivedInvocationsLock.withLock { loadImageFromSourceSizeUnderlyingReceivedInvocations } } set { loadImageFromSourceSizeReceivedInvocationsLock.withLock { loadImageFromSourceSizeUnderlyingReceivedInvocations = newValue } } } private let loadImageFromSourceSizeReturnValueLock = NSLock() - private var loadImageFromSourceSizeUnderlyingReturnValue: Result! + private nonisolated(unsafe) var loadImageFromSourceSizeUnderlyingReturnValue: Result! var loadImageFromSourceSizeReturnValue: Result! { get { loadImageFromSourceSizeReturnValueLock.withLock { loadImageFromSourceSizeUnderlyingReturnValue } } set { loadImageFromSourceSizeReturnValueLock.withLock { loadImageFromSourceSizeUnderlyingReturnValue = newValue } } } - var loadImageFromSourceSizeClosure: ((MediaSourceProxy, CGSize?) async -> Result)? + nonisolated(unsafe) var loadImageFromSourceSizeClosure: ((MediaSourceProxy, CGSize?) async -> Result)? - func loadImageFromSource(_ source: MediaSourceProxy, size: CGSize?) async -> Result { + @concurrent func loadImageFromSource(_ source: MediaSourceProxy, size: CGSize?) async -> Result { loadImageFromSourceSizeCallsCountLock.withLock { loadImageFromSourceSizeUnderlyingCallsCount += 1 } loadImageFromSourceSizeReceivedArguments = (source: source, size: size) loadImageFromSourceSizeReceivedInvocationsLock.withLock { loadImageFromSourceSizeUnderlyingReceivedInvocations.append((source: source, size: size)) } @@ -8029,7 +8029,7 @@ class MediaProviderMock: MediaProviderProtocol, @unchecked Sendable { //MARK: - loadImageDataFromSource private let loadImageDataFromSourceCallsCountLock = NSLock() - private var loadImageDataFromSourceUnderlyingCallsCount = 0 + private nonisolated(unsafe) var loadImageDataFromSourceUnderlyingCallsCount = 0 var loadImageDataFromSourceCallsCount: Int { get { loadImageDataFromSourceCallsCountLock.withLock { loadImageDataFromSourceUnderlyingCallsCount } } set { loadImageDataFromSourceCallsCountLock.withLock { loadImageDataFromSourceUnderlyingCallsCount = newValue } } @@ -8038,27 +8038,27 @@ class MediaProviderMock: MediaProviderProtocol, @unchecked Sendable { return loadImageDataFromSourceCallsCount > 0 } private let loadImageDataFromSourceReceivedSourceLock = NSLock() - private var loadImageDataFromSourceUnderlyingReceivedSource: MediaSourceProxy? + private nonisolated(unsafe) var loadImageDataFromSourceUnderlyingReceivedSource: MediaSourceProxy? var loadImageDataFromSourceReceivedSource: MediaSourceProxy? { get { loadImageDataFromSourceReceivedSourceLock.withLock { loadImageDataFromSourceUnderlyingReceivedSource } } set { loadImageDataFromSourceReceivedSourceLock.withLock { loadImageDataFromSourceUnderlyingReceivedSource = newValue } } } private let loadImageDataFromSourceReceivedInvocationsLock = NSLock() - private var loadImageDataFromSourceUnderlyingReceivedInvocations: [MediaSourceProxy] = [] + private nonisolated(unsafe) var loadImageDataFromSourceUnderlyingReceivedInvocations: [MediaSourceProxy] = [] var loadImageDataFromSourceReceivedInvocations: [MediaSourceProxy] { get { loadImageDataFromSourceReceivedInvocationsLock.withLock { loadImageDataFromSourceUnderlyingReceivedInvocations } } set { loadImageDataFromSourceReceivedInvocationsLock.withLock { loadImageDataFromSourceUnderlyingReceivedInvocations = newValue } } } private let loadImageDataFromSourceReturnValueLock = NSLock() - private var loadImageDataFromSourceUnderlyingReturnValue: Result! + private nonisolated(unsafe) var loadImageDataFromSourceUnderlyingReturnValue: Result! var loadImageDataFromSourceReturnValue: Result! { get { loadImageDataFromSourceReturnValueLock.withLock { loadImageDataFromSourceUnderlyingReturnValue } } set { loadImageDataFromSourceReturnValueLock.withLock { loadImageDataFromSourceUnderlyingReturnValue = newValue } } } - var loadImageDataFromSourceClosure: ((MediaSourceProxy) async -> Result)? + nonisolated(unsafe) var loadImageDataFromSourceClosure: ((MediaSourceProxy) async -> Result)? - func loadImageDataFromSource(_ source: MediaSourceProxy) async -> Result { + @concurrent func loadImageDataFromSource(_ source: MediaSourceProxy) async -> Result { loadImageDataFromSourceCallsCountLock.withLock { loadImageDataFromSourceUnderlyingCallsCount += 1 } loadImageDataFromSourceReceivedSource = source loadImageDataFromSourceReceivedInvocationsLock.withLock { loadImageDataFromSourceUnderlyingReceivedInvocations.append(source) } @@ -8071,7 +8071,7 @@ class MediaProviderMock: MediaProviderProtocol, @unchecked Sendable { //MARK: - loadImageRetryingOnReconnection private let loadImageRetryingOnReconnectionSizeCallsCountLock = NSLock() - private var loadImageRetryingOnReconnectionSizeUnderlyingCallsCount = 0 + private nonisolated(unsafe) var loadImageRetryingOnReconnectionSizeUnderlyingCallsCount = 0 var loadImageRetryingOnReconnectionSizeCallsCount: Int { get { loadImageRetryingOnReconnectionSizeCallsCountLock.withLock { loadImageRetryingOnReconnectionSizeUnderlyingCallsCount } } set { loadImageRetryingOnReconnectionSizeCallsCountLock.withLock { loadImageRetryingOnReconnectionSizeUnderlyingCallsCount = newValue } } @@ -8080,25 +8080,25 @@ class MediaProviderMock: MediaProviderProtocol, @unchecked Sendable { return loadImageRetryingOnReconnectionSizeCallsCount > 0 } private let loadImageRetryingOnReconnectionSizeReceivedArgumentsLock = NSLock() - private var loadImageRetryingOnReconnectionSizeUnderlyingReceivedArguments: (source: MediaSourceProxy, size: CGSize?)? + private nonisolated(unsafe) var loadImageRetryingOnReconnectionSizeUnderlyingReceivedArguments: (source: MediaSourceProxy, size: CGSize?)? var loadImageRetryingOnReconnectionSizeReceivedArguments: (source: MediaSourceProxy, size: CGSize?)? { get { loadImageRetryingOnReconnectionSizeReceivedArgumentsLock.withLock { loadImageRetryingOnReconnectionSizeUnderlyingReceivedArguments } } set { loadImageRetryingOnReconnectionSizeReceivedArgumentsLock.withLock { loadImageRetryingOnReconnectionSizeUnderlyingReceivedArguments = newValue } } } private let loadImageRetryingOnReconnectionSizeReceivedInvocationsLock = NSLock() - private var loadImageRetryingOnReconnectionSizeUnderlyingReceivedInvocations: [(source: MediaSourceProxy, size: CGSize?)] = [] + private nonisolated(unsafe) var loadImageRetryingOnReconnectionSizeUnderlyingReceivedInvocations: [(source: MediaSourceProxy, size: CGSize?)] = [] var loadImageRetryingOnReconnectionSizeReceivedInvocations: [(source: MediaSourceProxy, size: CGSize?)] { get { loadImageRetryingOnReconnectionSizeReceivedInvocationsLock.withLock { loadImageRetryingOnReconnectionSizeUnderlyingReceivedInvocations } } set { loadImageRetryingOnReconnectionSizeReceivedInvocationsLock.withLock { loadImageRetryingOnReconnectionSizeUnderlyingReceivedInvocations = newValue } } } private let loadImageRetryingOnReconnectionSizeReturnValueLock = NSLock() - private var loadImageRetryingOnReconnectionSizeUnderlyingReturnValue: Task! + private nonisolated(unsafe) var loadImageRetryingOnReconnectionSizeUnderlyingReturnValue: Task! var loadImageRetryingOnReconnectionSizeReturnValue: Task! { get { loadImageRetryingOnReconnectionSizeReturnValueLock.withLock { loadImageRetryingOnReconnectionSizeUnderlyingReturnValue } } set { loadImageRetryingOnReconnectionSizeReturnValueLock.withLock { loadImageRetryingOnReconnectionSizeUnderlyingReturnValue = newValue } } } - var loadImageRetryingOnReconnectionSizeClosure: ((MediaSourceProxy, CGSize?) -> Task)? + nonisolated(unsafe) var loadImageRetryingOnReconnectionSizeClosure: ((MediaSourceProxy, CGSize?) -> Task)? func loadImageRetryingOnReconnection(_ source: MediaSourceProxy, size: CGSize?) -> Task { loadImageRetryingOnReconnectionSizeCallsCountLock.withLock { loadImageRetryingOnReconnectionSizeUnderlyingCallsCount += 1 } @@ -8113,7 +8113,7 @@ class MediaProviderMock: MediaProviderProtocol, @unchecked Sendable { //MARK: - loadThumbnailForSource private let loadThumbnailForSourceSourceSizeCallsCountLock = NSLock() - private var loadThumbnailForSourceSourceSizeUnderlyingCallsCount = 0 + private nonisolated(unsafe) var loadThumbnailForSourceSourceSizeUnderlyingCallsCount = 0 var loadThumbnailForSourceSourceSizeCallsCount: Int { get { loadThumbnailForSourceSourceSizeCallsCountLock.withLock { loadThumbnailForSourceSourceSizeUnderlyingCallsCount } } set { loadThumbnailForSourceSourceSizeCallsCountLock.withLock { loadThumbnailForSourceSourceSizeUnderlyingCallsCount = newValue } } @@ -8122,27 +8122,27 @@ class MediaProviderMock: MediaProviderProtocol, @unchecked Sendable { return loadThumbnailForSourceSourceSizeCallsCount > 0 } private let loadThumbnailForSourceSourceSizeReceivedArgumentsLock = NSLock() - private var loadThumbnailForSourceSourceSizeUnderlyingReceivedArguments: (source: MediaSourceProxy, size: CGSize)? + private nonisolated(unsafe) var loadThumbnailForSourceSourceSizeUnderlyingReceivedArguments: (source: MediaSourceProxy, size: CGSize)? var loadThumbnailForSourceSourceSizeReceivedArguments: (source: MediaSourceProxy, size: CGSize)? { get { loadThumbnailForSourceSourceSizeReceivedArgumentsLock.withLock { loadThumbnailForSourceSourceSizeUnderlyingReceivedArguments } } set { loadThumbnailForSourceSourceSizeReceivedArgumentsLock.withLock { loadThumbnailForSourceSourceSizeUnderlyingReceivedArguments = newValue } } } private let loadThumbnailForSourceSourceSizeReceivedInvocationsLock = NSLock() - private var loadThumbnailForSourceSourceSizeUnderlyingReceivedInvocations: [(source: MediaSourceProxy, size: CGSize)] = [] + private nonisolated(unsafe) var loadThumbnailForSourceSourceSizeUnderlyingReceivedInvocations: [(source: MediaSourceProxy, size: CGSize)] = [] var loadThumbnailForSourceSourceSizeReceivedInvocations: [(source: MediaSourceProxy, size: CGSize)] { get { loadThumbnailForSourceSourceSizeReceivedInvocationsLock.withLock { loadThumbnailForSourceSourceSizeUnderlyingReceivedInvocations } } set { loadThumbnailForSourceSourceSizeReceivedInvocationsLock.withLock { loadThumbnailForSourceSourceSizeUnderlyingReceivedInvocations = newValue } } } private let loadThumbnailForSourceSourceSizeReturnValueLock = NSLock() - private var loadThumbnailForSourceSourceSizeUnderlyingReturnValue: Result! + private nonisolated(unsafe) var loadThumbnailForSourceSourceSizeUnderlyingReturnValue: Result! var loadThumbnailForSourceSourceSizeReturnValue: Result! { get { loadThumbnailForSourceSourceSizeReturnValueLock.withLock { loadThumbnailForSourceSourceSizeUnderlyingReturnValue } } set { loadThumbnailForSourceSourceSizeReturnValueLock.withLock { loadThumbnailForSourceSourceSizeUnderlyingReturnValue = newValue } } } - var loadThumbnailForSourceSourceSizeClosure: ((MediaSourceProxy, CGSize) async -> Result)? + nonisolated(unsafe) var loadThumbnailForSourceSourceSizeClosure: ((MediaSourceProxy, CGSize) async -> Result)? - func loadThumbnailForSource(source: MediaSourceProxy, size: CGSize) async -> Result { + @concurrent func loadThumbnailForSource(source: MediaSourceProxy, size: CGSize) async -> Result { loadThumbnailForSourceSourceSizeCallsCountLock.withLock { loadThumbnailForSourceSourceSizeUnderlyingCallsCount += 1 } loadThumbnailForSourceSourceSizeReceivedArguments = (source: source, size: size) loadThumbnailForSourceSourceSizeReceivedInvocationsLock.withLock { loadThumbnailForSourceSourceSizeUnderlyingReceivedInvocations.append((source: source, size: size)) } @@ -8155,7 +8155,7 @@ class MediaProviderMock: MediaProviderProtocol, @unchecked Sendable { //MARK: - loadFileFromSource private let loadFileFromSourceFilenameCallsCountLock = NSLock() - private var loadFileFromSourceFilenameUnderlyingCallsCount = 0 + private nonisolated(unsafe) var loadFileFromSourceFilenameUnderlyingCallsCount = 0 var loadFileFromSourceFilenameCallsCount: Int { get { loadFileFromSourceFilenameCallsCountLock.withLock { loadFileFromSourceFilenameUnderlyingCallsCount } } set { loadFileFromSourceFilenameCallsCountLock.withLock { loadFileFromSourceFilenameUnderlyingCallsCount = newValue } } @@ -8164,27 +8164,27 @@ class MediaProviderMock: MediaProviderProtocol, @unchecked Sendable { return loadFileFromSourceFilenameCallsCount > 0 } private let loadFileFromSourceFilenameReceivedArgumentsLock = NSLock() - private var loadFileFromSourceFilenameUnderlyingReceivedArguments: (source: MediaSourceProxy, filename: String?)? + private nonisolated(unsafe) var loadFileFromSourceFilenameUnderlyingReceivedArguments: (source: MediaSourceProxy, filename: String?)? var loadFileFromSourceFilenameReceivedArguments: (source: MediaSourceProxy, filename: String?)? { get { loadFileFromSourceFilenameReceivedArgumentsLock.withLock { loadFileFromSourceFilenameUnderlyingReceivedArguments } } set { loadFileFromSourceFilenameReceivedArgumentsLock.withLock { loadFileFromSourceFilenameUnderlyingReceivedArguments = newValue } } } private let loadFileFromSourceFilenameReceivedInvocationsLock = NSLock() - private var loadFileFromSourceFilenameUnderlyingReceivedInvocations: [(source: MediaSourceProxy, filename: String?)] = [] + private nonisolated(unsafe) var loadFileFromSourceFilenameUnderlyingReceivedInvocations: [(source: MediaSourceProxy, filename: String?)] = [] var loadFileFromSourceFilenameReceivedInvocations: [(source: MediaSourceProxy, filename: String?)] { get { loadFileFromSourceFilenameReceivedInvocationsLock.withLock { loadFileFromSourceFilenameUnderlyingReceivedInvocations } } set { loadFileFromSourceFilenameReceivedInvocationsLock.withLock { loadFileFromSourceFilenameUnderlyingReceivedInvocations = newValue } } } private let loadFileFromSourceFilenameReturnValueLock = NSLock() - private var loadFileFromSourceFilenameUnderlyingReturnValue: Result! + private nonisolated(unsafe) var loadFileFromSourceFilenameUnderlyingReturnValue: Result! var loadFileFromSourceFilenameReturnValue: Result! { get { loadFileFromSourceFilenameReturnValueLock.withLock { loadFileFromSourceFilenameUnderlyingReturnValue } } set { loadFileFromSourceFilenameReturnValueLock.withLock { loadFileFromSourceFilenameUnderlyingReturnValue = newValue } } } - var loadFileFromSourceFilenameClosure: ((MediaSourceProxy, String?) async -> Result)? + nonisolated(unsafe) var loadFileFromSourceFilenameClosure: ((MediaSourceProxy, String?) async -> Result)? - func loadFileFromSource(_ source: MediaSourceProxy, filename: String?) async -> Result { + @concurrent func loadFileFromSource(_ source: MediaSourceProxy, filename: String?) async -> Result { loadFileFromSourceFilenameCallsCountLock.withLock { loadFileFromSourceFilenameUnderlyingCallsCount += 1 } loadFileFromSourceFilenameReceivedArguments = (source: source, filename: filename) loadFileFromSourceFilenameReceivedInvocationsLock.withLock { loadFileFromSourceFilenameUnderlyingReceivedInvocations.append((source: source, filename: filename)) } @@ -8195,8 +8195,8 @@ class MediaProviderMock: MediaProviderProtocol, @unchecked Sendable { } } } -class NSEUserSessionMock: NSEUserSessionProtocol, @unchecked Sendable { - var inviteAvatarsVisibilityCallsCount = 0 +nonisolated class NSEUserSessionMock: NSEUserSessionProtocol, @unchecked Sendable { + nonisolated(unsafe) var inviteAvatarsVisibilityCallsCount = 0 var inviteAvatarsVisibilityCalled: Bool { return inviteAvatarsVisibilityCallsCount > 0 } @@ -8211,9 +8211,9 @@ class NSEUserSessionMock: NSEUserSessionProtocol, @unchecked Sendable { } } } - var underlyingInviteAvatarsVisibility: InviteAvatars! - var inviteAvatarsVisibilityClosure: (() async -> InviteAvatars)? - var mediaPreviewVisibilityCallsCount = 0 + nonisolated(unsafe) var underlyingInviteAvatarsVisibility: InviteAvatars! + nonisolated(unsafe) var inviteAvatarsVisibilityClosure: (() async -> InviteAvatars)? + nonisolated(unsafe) var mediaPreviewVisibilityCallsCount = 0 var mediaPreviewVisibilityCalled: Bool { return mediaPreviewVisibilityCallsCount > 0 } @@ -8228,18 +8228,18 @@ class NSEUserSessionMock: NSEUserSessionProtocol, @unchecked Sendable { } } } - var underlyingMediaPreviewVisibility: MediaPreviews! - var mediaPreviewVisibilityClosure: (() async -> MediaPreviews)? + nonisolated(unsafe) var underlyingMediaPreviewVisibility: MediaPreviews! + nonisolated(unsafe) var mediaPreviewVisibilityClosure: (() async -> MediaPreviews)? var threadsEnabled: Bool { get { return underlyingThreadsEnabled } set(value) { underlyingThreadsEnabled = value } } - var underlyingThreadsEnabled: Bool! + nonisolated(unsafe) var underlyingThreadsEnabled: Bool! //MARK: - notificationItemProxy private let notificationItemProxyRoomIDEventIDCallsCountLock = NSLock() - private var notificationItemProxyRoomIDEventIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var notificationItemProxyRoomIDEventIDUnderlyingCallsCount = 0 var notificationItemProxyRoomIDEventIDCallsCount: Int { get { notificationItemProxyRoomIDEventIDCallsCountLock.withLock { notificationItemProxyRoomIDEventIDUnderlyingCallsCount } } set { notificationItemProxyRoomIDEventIDCallsCountLock.withLock { notificationItemProxyRoomIDEventIDUnderlyingCallsCount = newValue } } @@ -8248,27 +8248,27 @@ class NSEUserSessionMock: NSEUserSessionProtocol, @unchecked Sendable { return notificationItemProxyRoomIDEventIDCallsCount > 0 } private let notificationItemProxyRoomIDEventIDReceivedArgumentsLock = NSLock() - private var notificationItemProxyRoomIDEventIDUnderlyingReceivedArguments: (roomID: String, eventID: String)? + private nonisolated(unsafe) var notificationItemProxyRoomIDEventIDUnderlyingReceivedArguments: (roomID: String, eventID: String)? var notificationItemProxyRoomIDEventIDReceivedArguments: (roomID: String, eventID: String)? { get { notificationItemProxyRoomIDEventIDReceivedArgumentsLock.withLock { notificationItemProxyRoomIDEventIDUnderlyingReceivedArguments } } set { notificationItemProxyRoomIDEventIDReceivedArgumentsLock.withLock { notificationItemProxyRoomIDEventIDUnderlyingReceivedArguments = newValue } } } private let notificationItemProxyRoomIDEventIDReceivedInvocationsLock = NSLock() - private var notificationItemProxyRoomIDEventIDUnderlyingReceivedInvocations: [(roomID: String, eventID: String)] = [] + private nonisolated(unsafe) var notificationItemProxyRoomIDEventIDUnderlyingReceivedInvocations: [(roomID: String, eventID: String)] = [] var notificationItemProxyRoomIDEventIDReceivedInvocations: [(roomID: String, eventID: String)] { get { notificationItemProxyRoomIDEventIDReceivedInvocationsLock.withLock { notificationItemProxyRoomIDEventIDUnderlyingReceivedInvocations } } set { notificationItemProxyRoomIDEventIDReceivedInvocationsLock.withLock { notificationItemProxyRoomIDEventIDUnderlyingReceivedInvocations = newValue } } } private let notificationItemProxyRoomIDEventIDReturnValueLock = NSLock() - private var notificationItemProxyRoomIDEventIDUnderlyingReturnValue: NotificationItemProxyProtocol? + private nonisolated(unsafe) var notificationItemProxyRoomIDEventIDUnderlyingReturnValue: NotificationItemProxyProtocol? var notificationItemProxyRoomIDEventIDReturnValue: NotificationItemProxyProtocol? { get { notificationItemProxyRoomIDEventIDReturnValueLock.withLock { notificationItemProxyRoomIDEventIDUnderlyingReturnValue } } set { notificationItemProxyRoomIDEventIDReturnValueLock.withLock { notificationItemProxyRoomIDEventIDUnderlyingReturnValue = newValue } } } - var notificationItemProxyRoomIDEventIDClosure: ((String, String) async -> NotificationItemProxyProtocol?)? + nonisolated(unsafe) var notificationItemProxyRoomIDEventIDClosure: ((String, String) async -> NotificationItemProxyProtocol?)? - func notificationItemProxy(roomID: String, eventID: String) async -> NotificationItemProxyProtocol? { + @concurrent func notificationItemProxy(roomID: String, eventID: String) async -> NotificationItemProxyProtocol? { notificationItemProxyRoomIDEventIDCallsCountLock.withLock { notificationItemProxyRoomIDEventIDUnderlyingCallsCount += 1 } notificationItemProxyRoomIDEventIDReceivedArguments = (roomID: roomID, eventID: eventID) notificationItemProxyRoomIDEventIDReceivedInvocationsLock.withLock { notificationItemProxyRoomIDEventIDUnderlyingReceivedInvocations.append((roomID: roomID, eventID: eventID)) } @@ -8281,7 +8281,7 @@ class NSEUserSessionMock: NSEUserSessionProtocol, @unchecked Sendable { //MARK: - roomForIdentifier private let roomForIdentifierCallsCountLock = NSLock() - private var roomForIdentifierUnderlyingCallsCount = 0 + private nonisolated(unsafe) var roomForIdentifierUnderlyingCallsCount = 0 var roomForIdentifierCallsCount: Int { get { roomForIdentifierCallsCountLock.withLock { roomForIdentifierUnderlyingCallsCount } } set { roomForIdentifierCallsCountLock.withLock { roomForIdentifierUnderlyingCallsCount = newValue } } @@ -8290,25 +8290,25 @@ class NSEUserSessionMock: NSEUserSessionProtocol, @unchecked Sendable { return roomForIdentifierCallsCount > 0 } private let roomForIdentifierReceivedRoomIDLock = NSLock() - private var roomForIdentifierUnderlyingReceivedRoomID: String? + private nonisolated(unsafe) var roomForIdentifierUnderlyingReceivedRoomID: String? var roomForIdentifierReceivedRoomID: String? { get { roomForIdentifierReceivedRoomIDLock.withLock { roomForIdentifierUnderlyingReceivedRoomID } } set { roomForIdentifierReceivedRoomIDLock.withLock { roomForIdentifierUnderlyingReceivedRoomID = newValue } } } private let roomForIdentifierReceivedInvocationsLock = NSLock() - private var roomForIdentifierUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var roomForIdentifierUnderlyingReceivedInvocations: [String] = [] var roomForIdentifierReceivedInvocations: [String] { get { roomForIdentifierReceivedInvocationsLock.withLock { roomForIdentifierUnderlyingReceivedInvocations } } set { roomForIdentifierReceivedInvocationsLock.withLock { roomForIdentifierUnderlyingReceivedInvocations = newValue } } } private let roomForIdentifierReturnValueLock = NSLock() - private var roomForIdentifierUnderlyingReturnValue: Room? + private nonisolated(unsafe) var roomForIdentifierUnderlyingReturnValue: Room? var roomForIdentifierReturnValue: Room? { get { roomForIdentifierReturnValueLock.withLock { roomForIdentifierUnderlyingReturnValue } } set { roomForIdentifierReturnValueLock.withLock { roomForIdentifierUnderlyingReturnValue = newValue } } } - var roomForIdentifierClosure: ((String) -> Room?)? + nonisolated(unsafe) var roomForIdentifierClosure: ((String) -> Room?)? func roomForIdentifier(_ roomID: String) -> Room? { roomForIdentifierCallsCountLock.withLock { roomForIdentifierUnderlyingCallsCount += 1 } @@ -8321,84 +8321,84 @@ class NSEUserSessionMock: NSEUserSessionProtocol, @unchecked Sendable { } } } -class NetworkMonitorMock: NetworkMonitorProtocol, @unchecked Sendable { +nonisolated class NetworkMonitorMock: NetworkMonitorProtocol, @unchecked Sendable { var reachabilityPublisher: CurrentValuePublisher { get { return underlyingReachabilityPublisher } set(value) { underlyingReachabilityPublisher = value } } - var underlyingReachabilityPublisher: CurrentValuePublisher! + nonisolated(unsafe) var underlyingReachabilityPublisher: CurrentValuePublisher! } -class NotificationItemProxyMock: NotificationItemProxyProtocol, @unchecked Sendable { - var event: NotificationEvent? +nonisolated class NotificationItemProxyMock: NotificationItemProxyProtocol, @unchecked Sendable { + nonisolated(unsafe) var event: NotificationEvent? var senderID: String { get { return underlyingSenderID } set(value) { underlyingSenderID = value } } - var underlyingSenderID: String! + nonisolated(unsafe) var underlyingSenderID: String! var roomID: String { get { return underlyingRoomID } set(value) { underlyingRoomID = value } } - var underlyingRoomID: String! + nonisolated(unsafe) var underlyingRoomID: String! var receiverID: String { get { return underlyingReceiverID } set(value) { underlyingReceiverID = value } } - var underlyingReceiverID: String! - var senderDisplayName: String? - var senderAvatarMediaSource: MediaSourceProxy? + nonisolated(unsafe) var underlyingReceiverID: String! + nonisolated(unsafe) var senderDisplayName: String? + nonisolated(unsafe) var senderAvatarMediaSource: MediaSourceProxy? var roomDisplayName: String { get { return underlyingRoomDisplayName } set(value) { underlyingRoomDisplayName = value } } - var underlyingRoomDisplayName: String! - var roomAvatarMediaSource: MediaSourceProxy? + nonisolated(unsafe) var underlyingRoomDisplayName: String! + nonisolated(unsafe) var roomAvatarMediaSource: MediaSourceProxy? var roomJoinedMembers: Int { get { return underlyingRoomJoinedMembers } set(value) { underlyingRoomJoinedMembers = value } } - var underlyingRoomJoinedMembers: Int! + nonisolated(unsafe) var underlyingRoomJoinedMembers: Int! var isRoomSpace: Bool { get { return underlyingIsRoomSpace } set(value) { underlyingIsRoomSpace = value } } - var underlyingIsRoomSpace: Bool! + nonisolated(unsafe) var underlyingIsRoomSpace: Bool! var isRoomDirect: Bool { get { return underlyingIsRoomDirect } set(value) { underlyingIsRoomDirect = value } } - var underlyingIsRoomDirect: Bool! + nonisolated(unsafe) var underlyingIsRoomDirect: Bool! var isRoomPrivate: Bool { get { return underlyingIsRoomPrivate } set(value) { underlyingIsRoomPrivate = value } } - var underlyingIsRoomPrivate: Bool! + nonisolated(unsafe) var underlyingIsRoomPrivate: Bool! var isDM: Bool { get { return underlyingIsDM } set(value) { underlyingIsDM = value } } - var underlyingIsDM: Bool! + nonisolated(unsafe) var underlyingIsDM: Bool! var isNoisy: Bool { get { return underlyingIsNoisy } set(value) { underlyingIsNoisy = value } } - var underlyingIsNoisy: Bool! + nonisolated(unsafe) var underlyingIsNoisy: Bool! var hasMention: Bool { get { return underlyingHasMention } set(value) { underlyingHasMention = value } } - var underlyingHasMention: Bool! - var threadRootEventID: String? + nonisolated(unsafe) var underlyingHasMention: Bool! + nonisolated(unsafe) var threadRootEventID: String? } -class NotificationManagerMock: NotificationManagerProtocol, @unchecked Sendable { - weak var delegate: NotificationManagerDelegate? +nonisolated class NotificationManagerMock: NotificationManagerProtocol, @unchecked Sendable { + weak nonisolated(unsafe) var delegate: NotificationManagerDelegate? //MARK: - start private let startCallsCountLock = NSLock() - private var startUnderlyingCallsCount = 0 + private nonisolated(unsafe) var startUnderlyingCallsCount = 0 var startCallsCount: Int { get { startCallsCountLock.withLock { startUnderlyingCallsCount } } set { startCallsCountLock.withLock { startUnderlyingCallsCount = newValue } } @@ -8406,7 +8406,7 @@ class NotificationManagerMock: NotificationManagerProtocol, @unchecked Sendable var startCalled: Bool { return startCallsCount > 0 } - var startClosure: (() -> Void)? + nonisolated(unsafe) var startClosure: (() -> Void)? func start() { startCallsCountLock.withLock { startUnderlyingCallsCount += 1 } @@ -8415,7 +8415,7 @@ class NotificationManagerMock: NotificationManagerProtocol, @unchecked Sendable //MARK: - register private let registerWithCallsCountLock = NSLock() - private var registerWithUnderlyingCallsCount = 0 + private nonisolated(unsafe) var registerWithUnderlyingCallsCount = 0 var registerWithCallsCount: Int { get { registerWithCallsCountLock.withLock { registerWithUnderlyingCallsCount } } set { registerWithCallsCountLock.withLock { registerWithUnderlyingCallsCount = newValue } } @@ -8424,27 +8424,27 @@ class NotificationManagerMock: NotificationManagerProtocol, @unchecked Sendable return registerWithCallsCount > 0 } private let registerWithReceivedDeviceTokenLock = NSLock() - private var registerWithUnderlyingReceivedDeviceToken: Data? + private nonisolated(unsafe) var registerWithUnderlyingReceivedDeviceToken: Data? var registerWithReceivedDeviceToken: Data? { get { registerWithReceivedDeviceTokenLock.withLock { registerWithUnderlyingReceivedDeviceToken } } set { registerWithReceivedDeviceTokenLock.withLock { registerWithUnderlyingReceivedDeviceToken = newValue } } } private let registerWithReceivedInvocationsLock = NSLock() - private var registerWithUnderlyingReceivedInvocations: [Data] = [] + private nonisolated(unsafe) var registerWithUnderlyingReceivedInvocations: [Data] = [] var registerWithReceivedInvocations: [Data] { get { registerWithReceivedInvocationsLock.withLock { registerWithUnderlyingReceivedInvocations } } set { registerWithReceivedInvocationsLock.withLock { registerWithUnderlyingReceivedInvocations = newValue } } } private let registerWithReturnValueLock = NSLock() - private var registerWithUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var registerWithUnderlyingReturnValue: Bool! var registerWithReturnValue: Bool! { get { registerWithReturnValueLock.withLock { registerWithUnderlyingReturnValue } } set { registerWithReturnValueLock.withLock { registerWithUnderlyingReturnValue = newValue } } } - var registerWithClosure: ((Data) async -> Bool)? + nonisolated(unsafe) var registerWithClosure: ((Data) async -> Bool)? - func register(with deviceToken: Data) async -> Bool { + @concurrent func register(with deviceToken: Data) async -> Bool { registerWithCallsCountLock.withLock { registerWithUnderlyingCallsCount += 1 } registerWithReceivedDeviceToken = deviceToken registerWithReceivedInvocationsLock.withLock { registerWithUnderlyingReceivedInvocations.append(deviceToken) } @@ -8457,7 +8457,7 @@ class NotificationManagerMock: NotificationManagerProtocol, @unchecked Sendable //MARK: - registrationFailed private let registrationFailedWithCallsCountLock = NSLock() - private var registrationFailedWithUnderlyingCallsCount = 0 + private nonisolated(unsafe) var registrationFailedWithUnderlyingCallsCount = 0 var registrationFailedWithCallsCount: Int { get { registrationFailedWithCallsCountLock.withLock { registrationFailedWithUnderlyingCallsCount } } set { registrationFailedWithCallsCountLock.withLock { registrationFailedWithUnderlyingCallsCount = newValue } } @@ -8466,18 +8466,18 @@ class NotificationManagerMock: NotificationManagerProtocol, @unchecked Sendable return registrationFailedWithCallsCount > 0 } private let registrationFailedWithReceivedErrorLock = NSLock() - private var registrationFailedWithUnderlyingReceivedError: Error? + private nonisolated(unsafe) var registrationFailedWithUnderlyingReceivedError: Error? var registrationFailedWithReceivedError: Error? { get { registrationFailedWithReceivedErrorLock.withLock { registrationFailedWithUnderlyingReceivedError } } set { registrationFailedWithReceivedErrorLock.withLock { registrationFailedWithUnderlyingReceivedError = newValue } } } private let registrationFailedWithReceivedInvocationsLock = NSLock() - private var registrationFailedWithUnderlyingReceivedInvocations: [Error] = [] + private nonisolated(unsafe) var registrationFailedWithUnderlyingReceivedInvocations: [Error] = [] var registrationFailedWithReceivedInvocations: [Error] { get { registrationFailedWithReceivedInvocationsLock.withLock { registrationFailedWithUnderlyingReceivedInvocations } } set { registrationFailedWithReceivedInvocationsLock.withLock { registrationFailedWithUnderlyingReceivedInvocations = newValue } } } - var registrationFailedWithClosure: ((Error) -> Void)? + nonisolated(unsafe) var registrationFailedWithClosure: ((Error) -> Void)? func registrationFailed(with error: Error) { registrationFailedWithCallsCountLock.withLock { registrationFailedWithUnderlyingCallsCount += 1 } @@ -8488,7 +8488,7 @@ class NotificationManagerMock: NotificationManagerProtocol, @unchecked Sendable //MARK: - showLocalNotification private let showLocalNotificationWithSubtitleCallsCountLock = NSLock() - private var showLocalNotificationWithSubtitleUnderlyingCallsCount = 0 + private nonisolated(unsafe) var showLocalNotificationWithSubtitleUnderlyingCallsCount = 0 var showLocalNotificationWithSubtitleCallsCount: Int { get { showLocalNotificationWithSubtitleCallsCountLock.withLock { showLocalNotificationWithSubtitleUnderlyingCallsCount } } set { showLocalNotificationWithSubtitleCallsCountLock.withLock { showLocalNotificationWithSubtitleUnderlyingCallsCount = newValue } } @@ -8497,20 +8497,20 @@ class NotificationManagerMock: NotificationManagerProtocol, @unchecked Sendable return showLocalNotificationWithSubtitleCallsCount > 0 } private let showLocalNotificationWithSubtitleReceivedArgumentsLock = NSLock() - private var showLocalNotificationWithSubtitleUnderlyingReceivedArguments: (title: String, subtitle: String?)? + private nonisolated(unsafe) var showLocalNotificationWithSubtitleUnderlyingReceivedArguments: (title: String, subtitle: String?)? var showLocalNotificationWithSubtitleReceivedArguments: (title: String, subtitle: String?)? { get { showLocalNotificationWithSubtitleReceivedArgumentsLock.withLock { showLocalNotificationWithSubtitleUnderlyingReceivedArguments } } set { showLocalNotificationWithSubtitleReceivedArgumentsLock.withLock { showLocalNotificationWithSubtitleUnderlyingReceivedArguments = newValue } } } private let showLocalNotificationWithSubtitleReceivedInvocationsLock = NSLock() - private var showLocalNotificationWithSubtitleUnderlyingReceivedInvocations: [(title: String, subtitle: String?)] = [] + private nonisolated(unsafe) var showLocalNotificationWithSubtitleUnderlyingReceivedInvocations: [(title: String, subtitle: String?)] = [] var showLocalNotificationWithSubtitleReceivedInvocations: [(title: String, subtitle: String?)] { get { showLocalNotificationWithSubtitleReceivedInvocationsLock.withLock { showLocalNotificationWithSubtitleUnderlyingReceivedInvocations } } set { showLocalNotificationWithSubtitleReceivedInvocationsLock.withLock { showLocalNotificationWithSubtitleUnderlyingReceivedInvocations = newValue } } } - var showLocalNotificationWithSubtitleClosure: ((String, String?) async -> Void)? + nonisolated(unsafe) var showLocalNotificationWithSubtitleClosure: ((String, String?) async -> Void)? - func showLocalNotification(with title: String, subtitle: String?) async { + @concurrent func showLocalNotification(with title: String, subtitle: String?) async { showLocalNotificationWithSubtitleCallsCountLock.withLock { showLocalNotificationWithSubtitleUnderlyingCallsCount += 1 } showLocalNotificationWithSubtitleReceivedArguments = (title: title, subtitle: subtitle) showLocalNotificationWithSubtitleReceivedInvocationsLock.withLock { showLocalNotificationWithSubtitleUnderlyingReceivedInvocations.append((title: title, subtitle: subtitle)) } @@ -8519,7 +8519,7 @@ class NotificationManagerMock: NotificationManagerProtocol, @unchecked Sendable //MARK: - setUserSession private let setUserSessionCallsCountLock = NSLock() - private var setUserSessionUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setUserSessionUnderlyingCallsCount = 0 var setUserSessionCallsCount: Int { get { setUserSessionCallsCountLock.withLock { setUserSessionUnderlyingCallsCount } } set { setUserSessionCallsCountLock.withLock { setUserSessionUnderlyingCallsCount = newValue } } @@ -8528,18 +8528,18 @@ class NotificationManagerMock: NotificationManagerProtocol, @unchecked Sendable return setUserSessionCallsCount > 0 } private let setUserSessionReceivedUserSessionLock = NSLock() - private var setUserSessionUnderlyingReceivedUserSession: UserSessionProtocol? + private nonisolated(unsafe) var setUserSessionUnderlyingReceivedUserSession: UserSessionProtocol? var setUserSessionReceivedUserSession: UserSessionProtocol? { get { setUserSessionReceivedUserSessionLock.withLock { setUserSessionUnderlyingReceivedUserSession } } set { setUserSessionReceivedUserSessionLock.withLock { setUserSessionUnderlyingReceivedUserSession = newValue } } } private let setUserSessionReceivedInvocationsLock = NSLock() - private var setUserSessionUnderlyingReceivedInvocations: [UserSessionProtocol?] = [] + private nonisolated(unsafe) var setUserSessionUnderlyingReceivedInvocations: [UserSessionProtocol?] = [] var setUserSessionReceivedInvocations: [UserSessionProtocol?] { get { setUserSessionReceivedInvocationsLock.withLock { setUserSessionUnderlyingReceivedInvocations } } set { setUserSessionReceivedInvocationsLock.withLock { setUserSessionUnderlyingReceivedInvocations = newValue } } } - var setUserSessionClosure: ((UserSessionProtocol?) -> Void)? + nonisolated(unsafe) var setUserSessionClosure: ((UserSessionProtocol?) -> Void)? func setUserSession(_ userSession: UserSessionProtocol?) { setUserSessionCallsCountLock.withLock { setUserSessionUnderlyingCallsCount += 1 } @@ -8550,7 +8550,7 @@ class NotificationManagerMock: NotificationManagerProtocol, @unchecked Sendable //MARK: - requestAuthorization private let requestAuthorizationCallsCountLock = NSLock() - private var requestAuthorizationUnderlyingCallsCount = 0 + private nonisolated(unsafe) var requestAuthorizationUnderlyingCallsCount = 0 var requestAuthorizationCallsCount: Int { get { requestAuthorizationCallsCountLock.withLock { requestAuthorizationUnderlyingCallsCount } } set { requestAuthorizationCallsCountLock.withLock { requestAuthorizationUnderlyingCallsCount = newValue } } @@ -8558,7 +8558,7 @@ class NotificationManagerMock: NotificationManagerProtocol, @unchecked Sendable var requestAuthorizationCalled: Bool { return requestAuthorizationCallsCount > 0 } - var requestAuthorizationClosure: (() -> Void)? + nonisolated(unsafe) var requestAuthorizationClosure: (() -> Void)? func requestAuthorization() { requestAuthorizationCallsCountLock.withLock { requestAuthorizationUnderlyingCallsCount += 1 } @@ -8567,7 +8567,7 @@ class NotificationManagerMock: NotificationManagerProtocol, @unchecked Sendable //MARK: - removeDeliveredMessageNotifications private let removeDeliveredMessageNotificationsForCallsCountLock = NSLock() - private var removeDeliveredMessageNotificationsForUnderlyingCallsCount = 0 + private nonisolated(unsafe) var removeDeliveredMessageNotificationsForUnderlyingCallsCount = 0 var removeDeliveredMessageNotificationsForCallsCount: Int { get { removeDeliveredMessageNotificationsForCallsCountLock.withLock { removeDeliveredMessageNotificationsForUnderlyingCallsCount } } set { removeDeliveredMessageNotificationsForCallsCountLock.withLock { removeDeliveredMessageNotificationsForUnderlyingCallsCount = newValue } } @@ -8576,20 +8576,20 @@ class NotificationManagerMock: NotificationManagerProtocol, @unchecked Sendable return removeDeliveredMessageNotificationsForCallsCount > 0 } private let removeDeliveredMessageNotificationsForReceivedRoomIDLock = NSLock() - private var removeDeliveredMessageNotificationsForUnderlyingReceivedRoomID: String? + private nonisolated(unsafe) var removeDeliveredMessageNotificationsForUnderlyingReceivedRoomID: String? var removeDeliveredMessageNotificationsForReceivedRoomID: String? { get { removeDeliveredMessageNotificationsForReceivedRoomIDLock.withLock { removeDeliveredMessageNotificationsForUnderlyingReceivedRoomID } } set { removeDeliveredMessageNotificationsForReceivedRoomIDLock.withLock { removeDeliveredMessageNotificationsForUnderlyingReceivedRoomID = newValue } } } private let removeDeliveredMessageNotificationsForReceivedInvocationsLock = NSLock() - private var removeDeliveredMessageNotificationsForUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var removeDeliveredMessageNotificationsForUnderlyingReceivedInvocations: [String] = [] var removeDeliveredMessageNotificationsForReceivedInvocations: [String] { get { removeDeliveredMessageNotificationsForReceivedInvocationsLock.withLock { removeDeliveredMessageNotificationsForUnderlyingReceivedInvocations } } set { removeDeliveredMessageNotificationsForReceivedInvocationsLock.withLock { removeDeliveredMessageNotificationsForUnderlyingReceivedInvocations = newValue } } } - var removeDeliveredMessageNotificationsForClosure: ((String) async -> Void)? + nonisolated(unsafe) var removeDeliveredMessageNotificationsForClosure: ((String) async -> Void)? - func removeDeliveredMessageNotifications(for roomID: String) async { + @concurrent func removeDeliveredMessageNotifications(for roomID: String) async { removeDeliveredMessageNotificationsForCallsCountLock.withLock { removeDeliveredMessageNotificationsForUnderlyingCallsCount += 1 } removeDeliveredMessageNotificationsForReceivedRoomID = roomID removeDeliveredMessageNotificationsForReceivedInvocationsLock.withLock { removeDeliveredMessageNotificationsForUnderlyingReceivedInvocations.append(roomID) } @@ -8598,7 +8598,7 @@ class NotificationManagerMock: NotificationManagerProtocol, @unchecked Sendable //MARK: - removeDeliveredNotificationsForFullyReadRooms private let removeDeliveredNotificationsForFullyReadRoomsCallsCountLock = NSLock() - private var removeDeliveredNotificationsForFullyReadRoomsUnderlyingCallsCount = 0 + private nonisolated(unsafe) var removeDeliveredNotificationsForFullyReadRoomsUnderlyingCallsCount = 0 var removeDeliveredNotificationsForFullyReadRoomsCallsCount: Int { get { removeDeliveredNotificationsForFullyReadRoomsCallsCountLock.withLock { removeDeliveredNotificationsForFullyReadRoomsUnderlyingCallsCount } } set { removeDeliveredNotificationsForFullyReadRoomsCallsCountLock.withLock { removeDeliveredNotificationsForFullyReadRoomsUnderlyingCallsCount = newValue } } @@ -8607,38 +8607,38 @@ class NotificationManagerMock: NotificationManagerProtocol, @unchecked Sendable return removeDeliveredNotificationsForFullyReadRoomsCallsCount > 0 } private let removeDeliveredNotificationsForFullyReadRoomsReceivedRoomsLock = NSLock() - private var removeDeliveredNotificationsForFullyReadRoomsUnderlyingReceivedRooms: [RoomSummary]? + private nonisolated(unsafe) var removeDeliveredNotificationsForFullyReadRoomsUnderlyingReceivedRooms: [RoomSummary]? var removeDeliveredNotificationsForFullyReadRoomsReceivedRooms: [RoomSummary]? { get { removeDeliveredNotificationsForFullyReadRoomsReceivedRoomsLock.withLock { removeDeliveredNotificationsForFullyReadRoomsUnderlyingReceivedRooms } } set { removeDeliveredNotificationsForFullyReadRoomsReceivedRoomsLock.withLock { removeDeliveredNotificationsForFullyReadRoomsUnderlyingReceivedRooms = newValue } } } private let removeDeliveredNotificationsForFullyReadRoomsReceivedInvocationsLock = NSLock() - private var removeDeliveredNotificationsForFullyReadRoomsUnderlyingReceivedInvocations: [[RoomSummary]] = [] + private nonisolated(unsafe) var removeDeliveredNotificationsForFullyReadRoomsUnderlyingReceivedInvocations: [[RoomSummary]] = [] var removeDeliveredNotificationsForFullyReadRoomsReceivedInvocations: [[RoomSummary]] { get { removeDeliveredNotificationsForFullyReadRoomsReceivedInvocationsLock.withLock { removeDeliveredNotificationsForFullyReadRoomsUnderlyingReceivedInvocations } } set { removeDeliveredNotificationsForFullyReadRoomsReceivedInvocationsLock.withLock { removeDeliveredNotificationsForFullyReadRoomsUnderlyingReceivedInvocations = newValue } } } - var removeDeliveredNotificationsForFullyReadRoomsClosure: (([RoomSummary]) async -> Void)? + nonisolated(unsafe) var removeDeliveredNotificationsForFullyReadRoomsClosure: (([RoomSummary]) async -> Void)? - func removeDeliveredNotificationsForFullyReadRooms(_ rooms: [RoomSummary]) async { + @concurrent func removeDeliveredNotificationsForFullyReadRooms(_ rooms: [RoomSummary]) async { removeDeliveredNotificationsForFullyReadRoomsCallsCountLock.withLock { removeDeliveredNotificationsForFullyReadRoomsUnderlyingCallsCount += 1 } removeDeliveredNotificationsForFullyReadRoomsReceivedRooms = rooms removeDeliveredNotificationsForFullyReadRoomsReceivedInvocationsLock.withLock { removeDeliveredNotificationsForFullyReadRoomsUnderlyingReceivedInvocations.append(rooms) } await removeDeliveredNotificationsForFullyReadRoomsClosure?(rooms) } } -class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @unchecked Sendable { +nonisolated class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @unchecked Sendable { var callbacks: PassthroughSubject { get { return underlyingCallbacks } set(value) { underlyingCallbacks = value } } - var underlyingCallbacks: PassthroughSubject! + nonisolated(unsafe) var underlyingCallbacks: PassthroughSubject! //MARK: - getNotificationSettings - var getNotificationSettingsRoomIdIsEncryptedIsOneToOneThrowableError: Error? + nonisolated(unsafe) var getNotificationSettingsRoomIdIsEncryptedIsOneToOneThrowableError: Error? private let getNotificationSettingsRoomIdIsEncryptedIsOneToOneCallsCountLock = NSLock() - private var getNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingCallsCount = 0 + private nonisolated(unsafe) var getNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingCallsCount = 0 var getNotificationSettingsRoomIdIsEncryptedIsOneToOneCallsCount: Int { get { getNotificationSettingsRoomIdIsEncryptedIsOneToOneCallsCountLock.withLock { getNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingCallsCount } } set { getNotificationSettingsRoomIdIsEncryptedIsOneToOneCallsCountLock.withLock { getNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingCallsCount = newValue } } @@ -8647,27 +8647,27 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck return getNotificationSettingsRoomIdIsEncryptedIsOneToOneCallsCount > 0 } private let getNotificationSettingsRoomIdIsEncryptedIsOneToOneReceivedArgumentsLock = NSLock() - private var getNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingReceivedArguments: (roomId: String, isEncrypted: Bool, isOneToOne: Bool)? + private nonisolated(unsafe) var getNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingReceivedArguments: (roomId: String, isEncrypted: Bool, isOneToOne: Bool)? var getNotificationSettingsRoomIdIsEncryptedIsOneToOneReceivedArguments: (roomId: String, isEncrypted: Bool, isOneToOne: Bool)? { get { getNotificationSettingsRoomIdIsEncryptedIsOneToOneReceivedArgumentsLock.withLock { getNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingReceivedArguments } } set { getNotificationSettingsRoomIdIsEncryptedIsOneToOneReceivedArgumentsLock.withLock { getNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingReceivedArguments = newValue } } } private let getNotificationSettingsRoomIdIsEncryptedIsOneToOneReceivedInvocationsLock = NSLock() - private var getNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingReceivedInvocations: [(roomId: String, isEncrypted: Bool, isOneToOne: Bool)] = [] + private nonisolated(unsafe) var getNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingReceivedInvocations: [(roomId: String, isEncrypted: Bool, isOneToOne: Bool)] = [] var getNotificationSettingsRoomIdIsEncryptedIsOneToOneReceivedInvocations: [(roomId: String, isEncrypted: Bool, isOneToOne: Bool)] { get { getNotificationSettingsRoomIdIsEncryptedIsOneToOneReceivedInvocationsLock.withLock { getNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingReceivedInvocations } } set { getNotificationSettingsRoomIdIsEncryptedIsOneToOneReceivedInvocationsLock.withLock { getNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingReceivedInvocations = newValue } } } private let getNotificationSettingsRoomIdIsEncryptedIsOneToOneReturnValueLock = NSLock() - private var getNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingReturnValue: RoomNotificationSettingsProxyProtocol! + private nonisolated(unsafe) var getNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingReturnValue: RoomNotificationSettingsProxyProtocol! var getNotificationSettingsRoomIdIsEncryptedIsOneToOneReturnValue: RoomNotificationSettingsProxyProtocol! { get { getNotificationSettingsRoomIdIsEncryptedIsOneToOneReturnValueLock.withLock { getNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingReturnValue } } set { getNotificationSettingsRoomIdIsEncryptedIsOneToOneReturnValueLock.withLock { getNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingReturnValue = newValue } } } - var getNotificationSettingsRoomIdIsEncryptedIsOneToOneClosure: ((String, Bool, Bool) async throws -> RoomNotificationSettingsProxyProtocol)? + nonisolated(unsafe) var getNotificationSettingsRoomIdIsEncryptedIsOneToOneClosure: ((String, Bool, Bool) async throws -> RoomNotificationSettingsProxyProtocol)? - func getNotificationSettings(roomId: String, isEncrypted: Bool, isOneToOne: Bool) async throws -> RoomNotificationSettingsProxyProtocol { + @concurrent func getNotificationSettings(roomId: String, isEncrypted: Bool, isOneToOne: Bool) async throws -> RoomNotificationSettingsProxyProtocol { if let error = getNotificationSettingsRoomIdIsEncryptedIsOneToOneThrowableError { throw error } @@ -8682,9 +8682,9 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck } //MARK: - setNotificationMode - var setNotificationModeRoomIdModeThrowableError: Error? + nonisolated(unsafe) var setNotificationModeRoomIdModeThrowableError: Error? private let setNotificationModeRoomIdModeCallsCountLock = NSLock() - private var setNotificationModeRoomIdModeUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setNotificationModeRoomIdModeUnderlyingCallsCount = 0 var setNotificationModeRoomIdModeCallsCount: Int { get { setNotificationModeRoomIdModeCallsCountLock.withLock { setNotificationModeRoomIdModeUnderlyingCallsCount } } set { setNotificationModeRoomIdModeCallsCountLock.withLock { setNotificationModeRoomIdModeUnderlyingCallsCount = newValue } } @@ -8693,20 +8693,20 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck return setNotificationModeRoomIdModeCallsCount > 0 } private let setNotificationModeRoomIdModeReceivedArgumentsLock = NSLock() - private var setNotificationModeRoomIdModeUnderlyingReceivedArguments: (roomId: String, mode: RoomNotificationModeProxy)? + private nonisolated(unsafe) var setNotificationModeRoomIdModeUnderlyingReceivedArguments: (roomId: String, mode: RoomNotificationModeProxy)? var setNotificationModeRoomIdModeReceivedArguments: (roomId: String, mode: RoomNotificationModeProxy)? { get { setNotificationModeRoomIdModeReceivedArgumentsLock.withLock { setNotificationModeRoomIdModeUnderlyingReceivedArguments } } set { setNotificationModeRoomIdModeReceivedArgumentsLock.withLock { setNotificationModeRoomIdModeUnderlyingReceivedArguments = newValue } } } private let setNotificationModeRoomIdModeReceivedInvocationsLock = NSLock() - private var setNotificationModeRoomIdModeUnderlyingReceivedInvocations: [(roomId: String, mode: RoomNotificationModeProxy)] = [] + private nonisolated(unsafe) var setNotificationModeRoomIdModeUnderlyingReceivedInvocations: [(roomId: String, mode: RoomNotificationModeProxy)] = [] var setNotificationModeRoomIdModeReceivedInvocations: [(roomId: String, mode: RoomNotificationModeProxy)] { get { setNotificationModeRoomIdModeReceivedInvocationsLock.withLock { setNotificationModeRoomIdModeUnderlyingReceivedInvocations } } set { setNotificationModeRoomIdModeReceivedInvocationsLock.withLock { setNotificationModeRoomIdModeUnderlyingReceivedInvocations = newValue } } } - var setNotificationModeRoomIdModeClosure: ((String, RoomNotificationModeProxy) async throws -> Void)? + nonisolated(unsafe) var setNotificationModeRoomIdModeClosure: ((String, RoomNotificationModeProxy) async throws -> Void)? - func setNotificationMode(roomId: String, mode: RoomNotificationModeProxy) async throws { + @concurrent func setNotificationMode(roomId: String, mode: RoomNotificationModeProxy) async throws { if let error = setNotificationModeRoomIdModeThrowableError { throw error } @@ -8717,9 +8717,9 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck } //MARK: - getUserDefinedRoomNotificationMode - var getUserDefinedRoomNotificationModeRoomIdThrowableError: Error? + nonisolated(unsafe) var getUserDefinedRoomNotificationModeRoomIdThrowableError: Error? private let getUserDefinedRoomNotificationModeRoomIdCallsCountLock = NSLock() - private var getUserDefinedRoomNotificationModeRoomIdUnderlyingCallsCount = 0 + private nonisolated(unsafe) var getUserDefinedRoomNotificationModeRoomIdUnderlyingCallsCount = 0 var getUserDefinedRoomNotificationModeRoomIdCallsCount: Int { get { getUserDefinedRoomNotificationModeRoomIdCallsCountLock.withLock { getUserDefinedRoomNotificationModeRoomIdUnderlyingCallsCount } } set { getUserDefinedRoomNotificationModeRoomIdCallsCountLock.withLock { getUserDefinedRoomNotificationModeRoomIdUnderlyingCallsCount = newValue } } @@ -8728,27 +8728,27 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck return getUserDefinedRoomNotificationModeRoomIdCallsCount > 0 } private let getUserDefinedRoomNotificationModeRoomIdReceivedRoomIdLock = NSLock() - private var getUserDefinedRoomNotificationModeRoomIdUnderlyingReceivedRoomId: String? + private nonisolated(unsafe) var getUserDefinedRoomNotificationModeRoomIdUnderlyingReceivedRoomId: String? var getUserDefinedRoomNotificationModeRoomIdReceivedRoomId: String? { get { getUserDefinedRoomNotificationModeRoomIdReceivedRoomIdLock.withLock { getUserDefinedRoomNotificationModeRoomIdUnderlyingReceivedRoomId } } set { getUserDefinedRoomNotificationModeRoomIdReceivedRoomIdLock.withLock { getUserDefinedRoomNotificationModeRoomIdUnderlyingReceivedRoomId = newValue } } } private let getUserDefinedRoomNotificationModeRoomIdReceivedInvocationsLock = NSLock() - private var getUserDefinedRoomNotificationModeRoomIdUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var getUserDefinedRoomNotificationModeRoomIdUnderlyingReceivedInvocations: [String] = [] var getUserDefinedRoomNotificationModeRoomIdReceivedInvocations: [String] { get { getUserDefinedRoomNotificationModeRoomIdReceivedInvocationsLock.withLock { getUserDefinedRoomNotificationModeRoomIdUnderlyingReceivedInvocations } } set { getUserDefinedRoomNotificationModeRoomIdReceivedInvocationsLock.withLock { getUserDefinedRoomNotificationModeRoomIdUnderlyingReceivedInvocations = newValue } } } private let getUserDefinedRoomNotificationModeRoomIdReturnValueLock = NSLock() - private var getUserDefinedRoomNotificationModeRoomIdUnderlyingReturnValue: RoomNotificationModeProxy? + private nonisolated(unsafe) var getUserDefinedRoomNotificationModeRoomIdUnderlyingReturnValue: RoomNotificationModeProxy? var getUserDefinedRoomNotificationModeRoomIdReturnValue: RoomNotificationModeProxy? { get { getUserDefinedRoomNotificationModeRoomIdReturnValueLock.withLock { getUserDefinedRoomNotificationModeRoomIdUnderlyingReturnValue } } set { getUserDefinedRoomNotificationModeRoomIdReturnValueLock.withLock { getUserDefinedRoomNotificationModeRoomIdUnderlyingReturnValue = newValue } } } - var getUserDefinedRoomNotificationModeRoomIdClosure: ((String) async throws -> RoomNotificationModeProxy?)? + nonisolated(unsafe) var getUserDefinedRoomNotificationModeRoomIdClosure: ((String) async throws -> RoomNotificationModeProxy?)? - func getUserDefinedRoomNotificationMode(roomId: String) async throws -> RoomNotificationModeProxy? { + @concurrent func getUserDefinedRoomNotificationMode(roomId: String) async throws -> RoomNotificationModeProxy? { if let error = getUserDefinedRoomNotificationModeRoomIdThrowableError { throw error } @@ -8764,7 +8764,7 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck //MARK: - getDefaultRoomNotificationMode private let getDefaultRoomNotificationModeIsEncryptedIsOneToOneCallsCountLock = NSLock() - private var getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingCallsCount = 0 + private nonisolated(unsafe) var getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingCallsCount = 0 var getDefaultRoomNotificationModeIsEncryptedIsOneToOneCallsCount: Int { get { getDefaultRoomNotificationModeIsEncryptedIsOneToOneCallsCountLock.withLock { getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingCallsCount } } set { getDefaultRoomNotificationModeIsEncryptedIsOneToOneCallsCountLock.withLock { getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingCallsCount = newValue } } @@ -8773,27 +8773,27 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck return getDefaultRoomNotificationModeIsEncryptedIsOneToOneCallsCount > 0 } private let getDefaultRoomNotificationModeIsEncryptedIsOneToOneReceivedArgumentsLock = NSLock() - private var getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingReceivedArguments: (isEncrypted: Bool, isOneToOne: Bool)? + private nonisolated(unsafe) var getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingReceivedArguments: (isEncrypted: Bool, isOneToOne: Bool)? var getDefaultRoomNotificationModeIsEncryptedIsOneToOneReceivedArguments: (isEncrypted: Bool, isOneToOne: Bool)? { get { getDefaultRoomNotificationModeIsEncryptedIsOneToOneReceivedArgumentsLock.withLock { getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingReceivedArguments } } set { getDefaultRoomNotificationModeIsEncryptedIsOneToOneReceivedArgumentsLock.withLock { getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingReceivedArguments = newValue } } } private let getDefaultRoomNotificationModeIsEncryptedIsOneToOneReceivedInvocationsLock = NSLock() - private var getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingReceivedInvocations: [(isEncrypted: Bool, isOneToOne: Bool)] = [] + private nonisolated(unsafe) var getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingReceivedInvocations: [(isEncrypted: Bool, isOneToOne: Bool)] = [] var getDefaultRoomNotificationModeIsEncryptedIsOneToOneReceivedInvocations: [(isEncrypted: Bool, isOneToOne: Bool)] { get { getDefaultRoomNotificationModeIsEncryptedIsOneToOneReceivedInvocationsLock.withLock { getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingReceivedInvocations } } set { getDefaultRoomNotificationModeIsEncryptedIsOneToOneReceivedInvocationsLock.withLock { getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingReceivedInvocations = newValue } } } private let getDefaultRoomNotificationModeIsEncryptedIsOneToOneReturnValueLock = NSLock() - private var getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingReturnValue: RoomNotificationModeProxy! + private nonisolated(unsafe) var getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingReturnValue: RoomNotificationModeProxy! var getDefaultRoomNotificationModeIsEncryptedIsOneToOneReturnValue: RoomNotificationModeProxy! { get { getDefaultRoomNotificationModeIsEncryptedIsOneToOneReturnValueLock.withLock { getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingReturnValue } } set { getDefaultRoomNotificationModeIsEncryptedIsOneToOneReturnValueLock.withLock { getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingReturnValue = newValue } } } - var getDefaultRoomNotificationModeIsEncryptedIsOneToOneClosure: ((Bool, Bool) async -> RoomNotificationModeProxy)? + nonisolated(unsafe) var getDefaultRoomNotificationModeIsEncryptedIsOneToOneClosure: ((Bool, Bool) async -> RoomNotificationModeProxy)? - func getDefaultRoomNotificationMode(isEncrypted: Bool, isOneToOne: Bool) async -> RoomNotificationModeProxy { + @concurrent func getDefaultRoomNotificationMode(isEncrypted: Bool, isOneToOne: Bool) async -> RoomNotificationModeProxy { getDefaultRoomNotificationModeIsEncryptedIsOneToOneCallsCountLock.withLock { getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingCallsCount += 1 } getDefaultRoomNotificationModeIsEncryptedIsOneToOneReceivedArguments = (isEncrypted: isEncrypted, isOneToOne: isOneToOne) getDefaultRoomNotificationModeIsEncryptedIsOneToOneReceivedInvocationsLock.withLock { getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingReceivedInvocations.append((isEncrypted: isEncrypted, isOneToOne: isOneToOne)) } @@ -8805,9 +8805,9 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck } //MARK: - setDefaultRoomNotificationMode - var setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeThrowableError: Error? + nonisolated(unsafe) var setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeThrowableError: Error? private let setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeCallsCountLock = NSLock() - private var setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeUnderlyingCallsCount = 0 var setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeCallsCount: Int { get { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeCallsCountLock.withLock { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeUnderlyingCallsCount } } set { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeCallsCountLock.withLock { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeUnderlyingCallsCount = newValue } } @@ -8816,20 +8816,20 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck return setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeCallsCount > 0 } private let setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeReceivedArgumentsLock = NSLock() - private var setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeUnderlyingReceivedArguments: (isEncrypted: Bool, isOneToOne: Bool, mode: RoomNotificationModeProxy)? + private nonisolated(unsafe) var setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeUnderlyingReceivedArguments: (isEncrypted: Bool, isOneToOne: Bool, mode: RoomNotificationModeProxy)? var setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeReceivedArguments: (isEncrypted: Bool, isOneToOne: Bool, mode: RoomNotificationModeProxy)? { get { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeReceivedArgumentsLock.withLock { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeUnderlyingReceivedArguments } } set { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeReceivedArgumentsLock.withLock { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeUnderlyingReceivedArguments = newValue } } } private let setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeReceivedInvocationsLock = NSLock() - private var setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeUnderlyingReceivedInvocations: [(isEncrypted: Bool, isOneToOne: Bool, mode: RoomNotificationModeProxy)] = [] + private nonisolated(unsafe) var setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeUnderlyingReceivedInvocations: [(isEncrypted: Bool, isOneToOne: Bool, mode: RoomNotificationModeProxy)] = [] var setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeReceivedInvocations: [(isEncrypted: Bool, isOneToOne: Bool, mode: RoomNotificationModeProxy)] { get { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeReceivedInvocationsLock.withLock { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeUnderlyingReceivedInvocations } } set { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeReceivedInvocationsLock.withLock { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeUnderlyingReceivedInvocations = newValue } } } - var setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeClosure: ((Bool, Bool, RoomNotificationModeProxy) async throws -> Void)? + nonisolated(unsafe) var setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeClosure: ((Bool, Bool, RoomNotificationModeProxy) async throws -> Void)? - func setDefaultRoomNotificationMode(isEncrypted: Bool, isOneToOne: Bool, mode: RoomNotificationModeProxy) async throws { + @concurrent func setDefaultRoomNotificationMode(isEncrypted: Bool, isOneToOne: Bool, mode: RoomNotificationModeProxy) async throws { if let error = setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeThrowableError { throw error } @@ -8840,9 +8840,9 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck } //MARK: - restoreDefaultNotificationMode - var restoreDefaultNotificationModeRoomIdThrowableError: Error? + nonisolated(unsafe) var restoreDefaultNotificationModeRoomIdThrowableError: Error? private let restoreDefaultNotificationModeRoomIdCallsCountLock = NSLock() - private var restoreDefaultNotificationModeRoomIdUnderlyingCallsCount = 0 + private nonisolated(unsafe) var restoreDefaultNotificationModeRoomIdUnderlyingCallsCount = 0 var restoreDefaultNotificationModeRoomIdCallsCount: Int { get { restoreDefaultNotificationModeRoomIdCallsCountLock.withLock { restoreDefaultNotificationModeRoomIdUnderlyingCallsCount } } set { restoreDefaultNotificationModeRoomIdCallsCountLock.withLock { restoreDefaultNotificationModeRoomIdUnderlyingCallsCount = newValue } } @@ -8851,20 +8851,20 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck return restoreDefaultNotificationModeRoomIdCallsCount > 0 } private let restoreDefaultNotificationModeRoomIdReceivedRoomIdLock = NSLock() - private var restoreDefaultNotificationModeRoomIdUnderlyingReceivedRoomId: String? + private nonisolated(unsafe) var restoreDefaultNotificationModeRoomIdUnderlyingReceivedRoomId: String? var restoreDefaultNotificationModeRoomIdReceivedRoomId: String? { get { restoreDefaultNotificationModeRoomIdReceivedRoomIdLock.withLock { restoreDefaultNotificationModeRoomIdUnderlyingReceivedRoomId } } set { restoreDefaultNotificationModeRoomIdReceivedRoomIdLock.withLock { restoreDefaultNotificationModeRoomIdUnderlyingReceivedRoomId = newValue } } } private let restoreDefaultNotificationModeRoomIdReceivedInvocationsLock = NSLock() - private var restoreDefaultNotificationModeRoomIdUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var restoreDefaultNotificationModeRoomIdUnderlyingReceivedInvocations: [String] = [] var restoreDefaultNotificationModeRoomIdReceivedInvocations: [String] { get { restoreDefaultNotificationModeRoomIdReceivedInvocationsLock.withLock { restoreDefaultNotificationModeRoomIdUnderlyingReceivedInvocations } } set { restoreDefaultNotificationModeRoomIdReceivedInvocationsLock.withLock { restoreDefaultNotificationModeRoomIdUnderlyingReceivedInvocations = newValue } } } - var restoreDefaultNotificationModeRoomIdClosure: ((String) async throws -> Void)? + nonisolated(unsafe) var restoreDefaultNotificationModeRoomIdClosure: ((String) async throws -> Void)? - func restoreDefaultNotificationMode(roomId: String) async throws { + @concurrent func restoreDefaultNotificationMode(roomId: String) async throws { if let error = restoreDefaultNotificationModeRoomIdThrowableError { throw error } @@ -8875,9 +8875,9 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck } //MARK: - unmuteRoom - var unmuteRoomRoomIdIsEncryptedIsOneToOneThrowableError: Error? + nonisolated(unsafe) var unmuteRoomRoomIdIsEncryptedIsOneToOneThrowableError: Error? private let unmuteRoomRoomIdIsEncryptedIsOneToOneCallsCountLock = NSLock() - private var unmuteRoomRoomIdIsEncryptedIsOneToOneUnderlyingCallsCount = 0 + private nonisolated(unsafe) var unmuteRoomRoomIdIsEncryptedIsOneToOneUnderlyingCallsCount = 0 var unmuteRoomRoomIdIsEncryptedIsOneToOneCallsCount: Int { get { unmuteRoomRoomIdIsEncryptedIsOneToOneCallsCountLock.withLock { unmuteRoomRoomIdIsEncryptedIsOneToOneUnderlyingCallsCount } } set { unmuteRoomRoomIdIsEncryptedIsOneToOneCallsCountLock.withLock { unmuteRoomRoomIdIsEncryptedIsOneToOneUnderlyingCallsCount = newValue } } @@ -8886,20 +8886,20 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck return unmuteRoomRoomIdIsEncryptedIsOneToOneCallsCount > 0 } private let unmuteRoomRoomIdIsEncryptedIsOneToOneReceivedArgumentsLock = NSLock() - private var unmuteRoomRoomIdIsEncryptedIsOneToOneUnderlyingReceivedArguments: (roomId: String, isEncrypted: Bool, isOneToOne: Bool)? + private nonisolated(unsafe) var unmuteRoomRoomIdIsEncryptedIsOneToOneUnderlyingReceivedArguments: (roomId: String, isEncrypted: Bool, isOneToOne: Bool)? var unmuteRoomRoomIdIsEncryptedIsOneToOneReceivedArguments: (roomId: String, isEncrypted: Bool, isOneToOne: Bool)? { get { unmuteRoomRoomIdIsEncryptedIsOneToOneReceivedArgumentsLock.withLock { unmuteRoomRoomIdIsEncryptedIsOneToOneUnderlyingReceivedArguments } } set { unmuteRoomRoomIdIsEncryptedIsOneToOneReceivedArgumentsLock.withLock { unmuteRoomRoomIdIsEncryptedIsOneToOneUnderlyingReceivedArguments = newValue } } } private let unmuteRoomRoomIdIsEncryptedIsOneToOneReceivedInvocationsLock = NSLock() - private var unmuteRoomRoomIdIsEncryptedIsOneToOneUnderlyingReceivedInvocations: [(roomId: String, isEncrypted: Bool, isOneToOne: Bool)] = [] + private nonisolated(unsafe) var unmuteRoomRoomIdIsEncryptedIsOneToOneUnderlyingReceivedInvocations: [(roomId: String, isEncrypted: Bool, isOneToOne: Bool)] = [] var unmuteRoomRoomIdIsEncryptedIsOneToOneReceivedInvocations: [(roomId: String, isEncrypted: Bool, isOneToOne: Bool)] { get { unmuteRoomRoomIdIsEncryptedIsOneToOneReceivedInvocationsLock.withLock { unmuteRoomRoomIdIsEncryptedIsOneToOneUnderlyingReceivedInvocations } } set { unmuteRoomRoomIdIsEncryptedIsOneToOneReceivedInvocationsLock.withLock { unmuteRoomRoomIdIsEncryptedIsOneToOneUnderlyingReceivedInvocations = newValue } } } - var unmuteRoomRoomIdIsEncryptedIsOneToOneClosure: ((String, Bool, Bool) async throws -> Void)? + nonisolated(unsafe) var unmuteRoomRoomIdIsEncryptedIsOneToOneClosure: ((String, Bool, Bool) async throws -> Void)? - func unmuteRoom(roomId: String, isEncrypted: Bool, isOneToOne: Bool) async throws { + @concurrent func unmuteRoom(roomId: String, isEncrypted: Bool, isOneToOne: Bool) async throws { if let error = unmuteRoomRoomIdIsEncryptedIsOneToOneThrowableError { throw error } @@ -8910,9 +8910,9 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck } //MARK: - isRoomMentionEnabled - var isRoomMentionEnabledThrowableError: Error? + nonisolated(unsafe) var isRoomMentionEnabledThrowableError: Error? private let isRoomMentionEnabledCallsCountLock = NSLock() - private var isRoomMentionEnabledUnderlyingCallsCount = 0 + private nonisolated(unsafe) var isRoomMentionEnabledUnderlyingCallsCount = 0 var isRoomMentionEnabledCallsCount: Int { get { isRoomMentionEnabledCallsCountLock.withLock { isRoomMentionEnabledUnderlyingCallsCount } } set { isRoomMentionEnabledCallsCountLock.withLock { isRoomMentionEnabledUnderlyingCallsCount = newValue } } @@ -8922,14 +8922,14 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck } private let isRoomMentionEnabledReturnValueLock = NSLock() - private var isRoomMentionEnabledUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var isRoomMentionEnabledUnderlyingReturnValue: Bool! var isRoomMentionEnabledReturnValue: Bool! { get { isRoomMentionEnabledReturnValueLock.withLock { isRoomMentionEnabledUnderlyingReturnValue } } set { isRoomMentionEnabledReturnValueLock.withLock { isRoomMentionEnabledUnderlyingReturnValue = newValue } } } - var isRoomMentionEnabledClosure: (() async throws -> Bool)? + nonisolated(unsafe) var isRoomMentionEnabledClosure: (() async throws -> Bool)? - func isRoomMentionEnabled() async throws -> Bool { + @concurrent func isRoomMentionEnabled() async throws -> Bool { if let error = isRoomMentionEnabledThrowableError { throw error } @@ -8942,9 +8942,9 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck } //MARK: - setRoomMentionEnabled - var setRoomMentionEnabledEnabledThrowableError: Error? + nonisolated(unsafe) var setRoomMentionEnabledEnabledThrowableError: Error? private let setRoomMentionEnabledEnabledCallsCountLock = NSLock() - private var setRoomMentionEnabledEnabledUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setRoomMentionEnabledEnabledUnderlyingCallsCount = 0 var setRoomMentionEnabledEnabledCallsCount: Int { get { setRoomMentionEnabledEnabledCallsCountLock.withLock { setRoomMentionEnabledEnabledUnderlyingCallsCount } } set { setRoomMentionEnabledEnabledCallsCountLock.withLock { setRoomMentionEnabledEnabledUnderlyingCallsCount = newValue } } @@ -8953,20 +8953,20 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck return setRoomMentionEnabledEnabledCallsCount > 0 } private let setRoomMentionEnabledEnabledReceivedEnabledLock = NSLock() - private var setRoomMentionEnabledEnabledUnderlyingReceivedEnabled: Bool? + private nonisolated(unsafe) var setRoomMentionEnabledEnabledUnderlyingReceivedEnabled: Bool? var setRoomMentionEnabledEnabledReceivedEnabled: Bool? { get { setRoomMentionEnabledEnabledReceivedEnabledLock.withLock { setRoomMentionEnabledEnabledUnderlyingReceivedEnabled } } set { setRoomMentionEnabledEnabledReceivedEnabledLock.withLock { setRoomMentionEnabledEnabledUnderlyingReceivedEnabled = newValue } } } private let setRoomMentionEnabledEnabledReceivedInvocationsLock = NSLock() - private var setRoomMentionEnabledEnabledUnderlyingReceivedInvocations: [Bool] = [] + private nonisolated(unsafe) var setRoomMentionEnabledEnabledUnderlyingReceivedInvocations: [Bool] = [] var setRoomMentionEnabledEnabledReceivedInvocations: [Bool] { get { setRoomMentionEnabledEnabledReceivedInvocationsLock.withLock { setRoomMentionEnabledEnabledUnderlyingReceivedInvocations } } set { setRoomMentionEnabledEnabledReceivedInvocationsLock.withLock { setRoomMentionEnabledEnabledUnderlyingReceivedInvocations = newValue } } } - var setRoomMentionEnabledEnabledClosure: ((Bool) async throws -> Void)? + nonisolated(unsafe) var setRoomMentionEnabledEnabledClosure: ((Bool) async throws -> Void)? - func setRoomMentionEnabled(enabled: Bool) async throws { + @concurrent func setRoomMentionEnabled(enabled: Bool) async throws { if let error = setRoomMentionEnabledEnabledThrowableError { throw error } @@ -8977,9 +8977,9 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck } //MARK: - isCallEnabled - var isCallEnabledThrowableError: Error? + nonisolated(unsafe) var isCallEnabledThrowableError: Error? private let isCallEnabledCallsCountLock = NSLock() - private var isCallEnabledUnderlyingCallsCount = 0 + private nonisolated(unsafe) var isCallEnabledUnderlyingCallsCount = 0 var isCallEnabledCallsCount: Int { get { isCallEnabledCallsCountLock.withLock { isCallEnabledUnderlyingCallsCount } } set { isCallEnabledCallsCountLock.withLock { isCallEnabledUnderlyingCallsCount = newValue } } @@ -8989,14 +8989,14 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck } private let isCallEnabledReturnValueLock = NSLock() - private var isCallEnabledUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var isCallEnabledUnderlyingReturnValue: Bool! var isCallEnabledReturnValue: Bool! { get { isCallEnabledReturnValueLock.withLock { isCallEnabledUnderlyingReturnValue } } set { isCallEnabledReturnValueLock.withLock { isCallEnabledUnderlyingReturnValue = newValue } } } - var isCallEnabledClosure: (() async throws -> Bool)? + nonisolated(unsafe) var isCallEnabledClosure: (() async throws -> Bool)? - func isCallEnabled() async throws -> Bool { + @concurrent func isCallEnabled() async throws -> Bool { if let error = isCallEnabledThrowableError { throw error } @@ -9009,9 +9009,9 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck } //MARK: - setCallEnabled - var setCallEnabledEnabledThrowableError: Error? + nonisolated(unsafe) var setCallEnabledEnabledThrowableError: Error? private let setCallEnabledEnabledCallsCountLock = NSLock() - private var setCallEnabledEnabledUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setCallEnabledEnabledUnderlyingCallsCount = 0 var setCallEnabledEnabledCallsCount: Int { get { setCallEnabledEnabledCallsCountLock.withLock { setCallEnabledEnabledUnderlyingCallsCount } } set { setCallEnabledEnabledCallsCountLock.withLock { setCallEnabledEnabledUnderlyingCallsCount = newValue } } @@ -9020,20 +9020,20 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck return setCallEnabledEnabledCallsCount > 0 } private let setCallEnabledEnabledReceivedEnabledLock = NSLock() - private var setCallEnabledEnabledUnderlyingReceivedEnabled: Bool? + private nonisolated(unsafe) var setCallEnabledEnabledUnderlyingReceivedEnabled: Bool? var setCallEnabledEnabledReceivedEnabled: Bool? { get { setCallEnabledEnabledReceivedEnabledLock.withLock { setCallEnabledEnabledUnderlyingReceivedEnabled } } set { setCallEnabledEnabledReceivedEnabledLock.withLock { setCallEnabledEnabledUnderlyingReceivedEnabled = newValue } } } private let setCallEnabledEnabledReceivedInvocationsLock = NSLock() - private var setCallEnabledEnabledUnderlyingReceivedInvocations: [Bool] = [] + private nonisolated(unsafe) var setCallEnabledEnabledUnderlyingReceivedInvocations: [Bool] = [] var setCallEnabledEnabledReceivedInvocations: [Bool] { get { setCallEnabledEnabledReceivedInvocationsLock.withLock { setCallEnabledEnabledUnderlyingReceivedInvocations } } set { setCallEnabledEnabledReceivedInvocationsLock.withLock { setCallEnabledEnabledUnderlyingReceivedInvocations = newValue } } } - var setCallEnabledEnabledClosure: ((Bool) async throws -> Void)? + nonisolated(unsafe) var setCallEnabledEnabledClosure: ((Bool) async throws -> Void)? - func setCallEnabled(enabled: Bool) async throws { + @concurrent func setCallEnabled(enabled: Bool) async throws { if let error = setCallEnabledEnabledThrowableError { throw error } @@ -9044,9 +9044,9 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck } //MARK: - isInviteForMeEnabled - var isInviteForMeEnabledThrowableError: Error? + nonisolated(unsafe) var isInviteForMeEnabledThrowableError: Error? private let isInviteForMeEnabledCallsCountLock = NSLock() - private var isInviteForMeEnabledUnderlyingCallsCount = 0 + private nonisolated(unsafe) var isInviteForMeEnabledUnderlyingCallsCount = 0 var isInviteForMeEnabledCallsCount: Int { get { isInviteForMeEnabledCallsCountLock.withLock { isInviteForMeEnabledUnderlyingCallsCount } } set { isInviteForMeEnabledCallsCountLock.withLock { isInviteForMeEnabledUnderlyingCallsCount = newValue } } @@ -9056,14 +9056,14 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck } private let isInviteForMeEnabledReturnValueLock = NSLock() - private var isInviteForMeEnabledUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var isInviteForMeEnabledUnderlyingReturnValue: Bool! var isInviteForMeEnabledReturnValue: Bool! { get { isInviteForMeEnabledReturnValueLock.withLock { isInviteForMeEnabledUnderlyingReturnValue } } set { isInviteForMeEnabledReturnValueLock.withLock { isInviteForMeEnabledUnderlyingReturnValue = newValue } } } - var isInviteForMeEnabledClosure: (() async throws -> Bool)? + nonisolated(unsafe) var isInviteForMeEnabledClosure: (() async throws -> Bool)? - func isInviteForMeEnabled() async throws -> Bool { + @concurrent func isInviteForMeEnabled() async throws -> Bool { if let error = isInviteForMeEnabledThrowableError { throw error } @@ -9076,9 +9076,9 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck } //MARK: - setInviteForMeEnabled - var setInviteForMeEnabledEnabledThrowableError: Error? + nonisolated(unsafe) var setInviteForMeEnabledEnabledThrowableError: Error? private let setInviteForMeEnabledEnabledCallsCountLock = NSLock() - private var setInviteForMeEnabledEnabledUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setInviteForMeEnabledEnabledUnderlyingCallsCount = 0 var setInviteForMeEnabledEnabledCallsCount: Int { get { setInviteForMeEnabledEnabledCallsCountLock.withLock { setInviteForMeEnabledEnabledUnderlyingCallsCount } } set { setInviteForMeEnabledEnabledCallsCountLock.withLock { setInviteForMeEnabledEnabledUnderlyingCallsCount = newValue } } @@ -9087,20 +9087,20 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck return setInviteForMeEnabledEnabledCallsCount > 0 } private let setInviteForMeEnabledEnabledReceivedEnabledLock = NSLock() - private var setInviteForMeEnabledEnabledUnderlyingReceivedEnabled: Bool? + private nonisolated(unsafe) var setInviteForMeEnabledEnabledUnderlyingReceivedEnabled: Bool? var setInviteForMeEnabledEnabledReceivedEnabled: Bool? { get { setInviteForMeEnabledEnabledReceivedEnabledLock.withLock { setInviteForMeEnabledEnabledUnderlyingReceivedEnabled } } set { setInviteForMeEnabledEnabledReceivedEnabledLock.withLock { setInviteForMeEnabledEnabledUnderlyingReceivedEnabled = newValue } } } private let setInviteForMeEnabledEnabledReceivedInvocationsLock = NSLock() - private var setInviteForMeEnabledEnabledUnderlyingReceivedInvocations: [Bool] = [] + private nonisolated(unsafe) var setInviteForMeEnabledEnabledUnderlyingReceivedInvocations: [Bool] = [] var setInviteForMeEnabledEnabledReceivedInvocations: [Bool] { get { setInviteForMeEnabledEnabledReceivedInvocationsLock.withLock { setInviteForMeEnabledEnabledUnderlyingReceivedInvocations } } set { setInviteForMeEnabledEnabledReceivedInvocationsLock.withLock { setInviteForMeEnabledEnabledUnderlyingReceivedInvocations = newValue } } } - var setInviteForMeEnabledEnabledClosure: ((Bool) async throws -> Void)? + nonisolated(unsafe) var setInviteForMeEnabledEnabledClosure: ((Bool) async throws -> Void)? - func setInviteForMeEnabled(enabled: Bool) async throws { + @concurrent func setInviteForMeEnabled(enabled: Bool) async throws { if let error = setInviteForMeEnabledEnabledThrowableError { throw error } @@ -9111,9 +9111,9 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck } //MARK: - getRoomsWithUserDefinedRules - var getRoomsWithUserDefinedRulesThrowableError: Error? + nonisolated(unsafe) var getRoomsWithUserDefinedRulesThrowableError: Error? private let getRoomsWithUserDefinedRulesCallsCountLock = NSLock() - private var getRoomsWithUserDefinedRulesUnderlyingCallsCount = 0 + private nonisolated(unsafe) var getRoomsWithUserDefinedRulesUnderlyingCallsCount = 0 var getRoomsWithUserDefinedRulesCallsCount: Int { get { getRoomsWithUserDefinedRulesCallsCountLock.withLock { getRoomsWithUserDefinedRulesUnderlyingCallsCount } } set { getRoomsWithUserDefinedRulesCallsCountLock.withLock { getRoomsWithUserDefinedRulesUnderlyingCallsCount = newValue } } @@ -9123,14 +9123,14 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck } private let getRoomsWithUserDefinedRulesReturnValueLock = NSLock() - private var getRoomsWithUserDefinedRulesUnderlyingReturnValue: [String]! + private nonisolated(unsafe) var getRoomsWithUserDefinedRulesUnderlyingReturnValue: [String]! var getRoomsWithUserDefinedRulesReturnValue: [String]! { get { getRoomsWithUserDefinedRulesReturnValueLock.withLock { getRoomsWithUserDefinedRulesUnderlyingReturnValue } } set { getRoomsWithUserDefinedRulesReturnValueLock.withLock { getRoomsWithUserDefinedRulesUnderlyingReturnValue = newValue } } } - var getRoomsWithUserDefinedRulesClosure: (() async throws -> [String])? + nonisolated(unsafe) var getRoomsWithUserDefinedRulesClosure: (() async throws -> [String])? - func getRoomsWithUserDefinedRules() async throws -> [String] { + @concurrent func getRoomsWithUserDefinedRules() async throws -> [String] { if let error = getRoomsWithUserDefinedRulesThrowableError { throw error } @@ -9144,7 +9144,7 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck //MARK: - canPushEncryptedEventsToDevice private let canPushEncryptedEventsToDeviceCallsCountLock = NSLock() - private var canPushEncryptedEventsToDeviceUnderlyingCallsCount = 0 + private nonisolated(unsafe) var canPushEncryptedEventsToDeviceUnderlyingCallsCount = 0 var canPushEncryptedEventsToDeviceCallsCount: Int { get { canPushEncryptedEventsToDeviceCallsCountLock.withLock { canPushEncryptedEventsToDeviceUnderlyingCallsCount } } set { canPushEncryptedEventsToDeviceCallsCountLock.withLock { canPushEncryptedEventsToDeviceUnderlyingCallsCount = newValue } } @@ -9154,14 +9154,14 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck } private let canPushEncryptedEventsToDeviceReturnValueLock = NSLock() - private var canPushEncryptedEventsToDeviceUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var canPushEncryptedEventsToDeviceUnderlyingReturnValue: Bool! var canPushEncryptedEventsToDeviceReturnValue: Bool! { get { canPushEncryptedEventsToDeviceReturnValueLock.withLock { canPushEncryptedEventsToDeviceUnderlyingReturnValue } } set { canPushEncryptedEventsToDeviceReturnValueLock.withLock { canPushEncryptedEventsToDeviceUnderlyingReturnValue = newValue } } } - var canPushEncryptedEventsToDeviceClosure: (() async -> Bool)? + nonisolated(unsafe) var canPushEncryptedEventsToDeviceClosure: (() async -> Bool)? - func canPushEncryptedEventsToDevice() async -> Bool { + @concurrent func canPushEncryptedEventsToDevice() async -> Bool { canPushEncryptedEventsToDeviceCallsCountLock.withLock { canPushEncryptedEventsToDeviceUnderlyingCallsCount += 1 } if let canPushEncryptedEventsToDeviceClosure = canPushEncryptedEventsToDeviceClosure { return await canPushEncryptedEventsToDeviceClosure() @@ -9170,13 +9170,13 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol, @uncheck } } } -class NotificationToneManagerMock: NotificationToneManagerProtocol, @unchecked Sendable { +nonisolated class NotificationToneManagerMock: NotificationToneManagerProtocol, @unchecked Sendable { //MARK: - setSelectedTone - var setSelectedToneThrowableError: Error? + nonisolated(unsafe) var setSelectedToneThrowableError: Error? private let setSelectedToneCallsCountLock = NSLock() - private var setSelectedToneUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setSelectedToneUnderlyingCallsCount = 0 var setSelectedToneCallsCount: Int { get { setSelectedToneCallsCountLock.withLock { setSelectedToneUnderlyingCallsCount } } set { setSelectedToneCallsCountLock.withLock { setSelectedToneUnderlyingCallsCount = newValue } } @@ -9185,25 +9185,25 @@ class NotificationToneManagerMock: NotificationToneManagerProtocol, @unchecked S return setSelectedToneCallsCount > 0 } private let setSelectedToneReceivedAlertToneLock = NSLock() - private var setSelectedToneUnderlyingReceivedAlertTone: NotificationTone? + private nonisolated(unsafe) var setSelectedToneUnderlyingReceivedAlertTone: NotificationTone? var setSelectedToneReceivedAlertTone: NotificationTone? { get { setSelectedToneReceivedAlertToneLock.withLock { setSelectedToneUnderlyingReceivedAlertTone } } set { setSelectedToneReceivedAlertToneLock.withLock { setSelectedToneUnderlyingReceivedAlertTone = newValue } } } private let setSelectedToneReceivedInvocationsLock = NSLock() - private var setSelectedToneUnderlyingReceivedInvocations: [NotificationTone] = [] + private nonisolated(unsafe) var setSelectedToneUnderlyingReceivedInvocations: [NotificationTone] = [] var setSelectedToneReceivedInvocations: [NotificationTone] { get { setSelectedToneReceivedInvocationsLock.withLock { setSelectedToneUnderlyingReceivedInvocations } } set { setSelectedToneReceivedInvocationsLock.withLock { setSelectedToneUnderlyingReceivedInvocations = newValue } } } private let setSelectedToneReturnValueLock = NSLock() - private var setSelectedToneUnderlyingReturnValue: URL! + private nonisolated(unsafe) var setSelectedToneUnderlyingReturnValue: URL! var setSelectedToneReturnValue: URL! { get { setSelectedToneReturnValueLock.withLock { setSelectedToneUnderlyingReturnValue } } set { setSelectedToneReturnValueLock.withLock { setSelectedToneUnderlyingReturnValue = newValue } } } - var setSelectedToneClosure: ((NotificationTone) throws -> URL)? + nonisolated(unsafe) var setSelectedToneClosure: ((NotificationTone) throws -> URL)? @discardableResult func setSelectedTone(_ alertTone: NotificationTone) throws -> URL { @@ -9222,7 +9222,7 @@ class NotificationToneManagerMock: NotificationToneManagerProtocol, @unchecked S //MARK: - customTones private let customTonesCallsCountLock = NSLock() - private var customTonesUnderlyingCallsCount = 0 + private nonisolated(unsafe) var customTonesUnderlyingCallsCount = 0 var customTonesCallsCount: Int { get { customTonesCallsCountLock.withLock { customTonesUnderlyingCallsCount } } set { customTonesCallsCountLock.withLock { customTonesUnderlyingCallsCount = newValue } } @@ -9232,12 +9232,12 @@ class NotificationToneManagerMock: NotificationToneManagerProtocol, @unchecked S } private let customTonesReturnValueLock = NSLock() - private var customTonesUnderlyingReturnValue: [NotificationTone]! + private nonisolated(unsafe) var customTonesUnderlyingReturnValue: [NotificationTone]! var customTonesReturnValue: [NotificationTone]! { get { customTonesReturnValueLock.withLock { customTonesUnderlyingReturnValue } } set { customTonesReturnValueLock.withLock { customTonesUnderlyingReturnValue = newValue } } } - var customTonesClosure: (() -> [NotificationTone])? + nonisolated(unsafe) var customTonesClosure: (() -> [NotificationTone])? func customTones() -> [NotificationTone] { customTonesCallsCountLock.withLock { customTonesUnderlyingCallsCount += 1 } @@ -9249,9 +9249,9 @@ class NotificationToneManagerMock: NotificationToneManagerProtocol, @unchecked S } //MARK: - deleteCustomTone - var deleteCustomToneThrowableError: Error? + nonisolated(unsafe) var deleteCustomToneThrowableError: Error? private let deleteCustomToneCallsCountLock = NSLock() - private var deleteCustomToneUnderlyingCallsCount = 0 + private nonisolated(unsafe) var deleteCustomToneUnderlyingCallsCount = 0 var deleteCustomToneCallsCount: Int { get { deleteCustomToneCallsCountLock.withLock { deleteCustomToneUnderlyingCallsCount } } set { deleteCustomToneCallsCountLock.withLock { deleteCustomToneUnderlyingCallsCount = newValue } } @@ -9260,18 +9260,18 @@ class NotificationToneManagerMock: NotificationToneManagerProtocol, @unchecked S return deleteCustomToneCallsCount > 0 } private let deleteCustomToneReceivedAlertToneLock = NSLock() - private var deleteCustomToneUnderlyingReceivedAlertTone: NotificationTone? + private nonisolated(unsafe) var deleteCustomToneUnderlyingReceivedAlertTone: NotificationTone? var deleteCustomToneReceivedAlertTone: NotificationTone? { get { deleteCustomToneReceivedAlertToneLock.withLock { deleteCustomToneUnderlyingReceivedAlertTone } } set { deleteCustomToneReceivedAlertToneLock.withLock { deleteCustomToneUnderlyingReceivedAlertTone = newValue } } } private let deleteCustomToneReceivedInvocationsLock = NSLock() - private var deleteCustomToneUnderlyingReceivedInvocations: [NotificationTone] = [] + private nonisolated(unsafe) var deleteCustomToneUnderlyingReceivedInvocations: [NotificationTone] = [] var deleteCustomToneReceivedInvocations: [NotificationTone] { get { deleteCustomToneReceivedInvocationsLock.withLock { deleteCustomToneUnderlyingReceivedInvocations } } set { deleteCustomToneReceivedInvocationsLock.withLock { deleteCustomToneUnderlyingReceivedInvocations = newValue } } } - var deleteCustomToneClosure: ((NotificationTone) throws -> Void)? + nonisolated(unsafe) var deleteCustomToneClosure: ((NotificationTone) throws -> Void)? func deleteCustomTone(_ alertTone: NotificationTone) throws { if let error = deleteCustomToneThrowableError { @@ -9284,9 +9284,9 @@ class NotificationToneManagerMock: NotificationToneManagerProtocol, @unchecked S } //MARK: - addNewToneToLibrary - var addNewToneToLibraryFromThrowableError: Error? + nonisolated(unsafe) var addNewToneToLibraryFromThrowableError: Error? private let addNewToneToLibraryFromCallsCountLock = NSLock() - private var addNewToneToLibraryFromUnderlyingCallsCount = 0 + private nonisolated(unsafe) var addNewToneToLibraryFromUnderlyingCallsCount = 0 var addNewToneToLibraryFromCallsCount: Int { get { addNewToneToLibraryFromCallsCountLock.withLock { addNewToneToLibraryFromUnderlyingCallsCount } } set { addNewToneToLibraryFromCallsCountLock.withLock { addNewToneToLibraryFromUnderlyingCallsCount = newValue } } @@ -9295,25 +9295,25 @@ class NotificationToneManagerMock: NotificationToneManagerProtocol, @unchecked S return addNewToneToLibraryFromCallsCount > 0 } private let addNewToneToLibraryFromReceivedSourceURLLock = NSLock() - private var addNewToneToLibraryFromUnderlyingReceivedSourceURL: URL? + private nonisolated(unsafe) var addNewToneToLibraryFromUnderlyingReceivedSourceURL: URL? var addNewToneToLibraryFromReceivedSourceURL: URL? { get { addNewToneToLibraryFromReceivedSourceURLLock.withLock { addNewToneToLibraryFromUnderlyingReceivedSourceURL } } set { addNewToneToLibraryFromReceivedSourceURLLock.withLock { addNewToneToLibraryFromUnderlyingReceivedSourceURL = newValue } } } private let addNewToneToLibraryFromReceivedInvocationsLock = NSLock() - private var addNewToneToLibraryFromUnderlyingReceivedInvocations: [URL] = [] + private nonisolated(unsafe) var addNewToneToLibraryFromUnderlyingReceivedInvocations: [URL] = [] var addNewToneToLibraryFromReceivedInvocations: [URL] { get { addNewToneToLibraryFromReceivedInvocationsLock.withLock { addNewToneToLibraryFromUnderlyingReceivedInvocations } } set { addNewToneToLibraryFromReceivedInvocationsLock.withLock { addNewToneToLibraryFromUnderlyingReceivedInvocations = newValue } } } private let addNewToneToLibraryFromReturnValueLock = NSLock() - private var addNewToneToLibraryFromUnderlyingReturnValue: URL! + private nonisolated(unsafe) var addNewToneToLibraryFromUnderlyingReturnValue: URL! var addNewToneToLibraryFromReturnValue: URL! { get { addNewToneToLibraryFromReturnValueLock.withLock { addNewToneToLibraryFromUnderlyingReturnValue } } set { addNewToneToLibraryFromReturnValueLock.withLock { addNewToneToLibraryFromUnderlyingReturnValue = newValue } } } - var addNewToneToLibraryFromClosure: ((URL) throws -> URL)? + nonisolated(unsafe) var addNewToneToLibraryFromClosure: ((URL) throws -> URL)? @NotificationToneManager.ConversionActor @discardableResult @@ -9331,12 +9331,12 @@ class NotificationToneManagerMock: NotificationToneManagerProtocol, @unchecked S } } } -class OrientationManagerMock: OrientationManagerProtocol, @unchecked Sendable { +nonisolated class OrientationManagerMock: OrientationManagerProtocol, @unchecked Sendable { //MARK: - setOrientation private let setOrientationCallsCountLock = NSLock() - private var setOrientationUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setOrientationUnderlyingCallsCount = 0 var setOrientationCallsCount: Int { get { setOrientationCallsCountLock.withLock { setOrientationUnderlyingCallsCount } } set { setOrientationCallsCountLock.withLock { setOrientationUnderlyingCallsCount = newValue } } @@ -9345,18 +9345,18 @@ class OrientationManagerMock: OrientationManagerProtocol, @unchecked Sendable { return setOrientationCallsCount > 0 } private let setOrientationReceivedOrientationLock = NSLock() - private var setOrientationUnderlyingReceivedOrientation: UIInterfaceOrientationMask? + private nonisolated(unsafe) var setOrientationUnderlyingReceivedOrientation: UIInterfaceOrientationMask? var setOrientationReceivedOrientation: UIInterfaceOrientationMask? { get { setOrientationReceivedOrientationLock.withLock { setOrientationUnderlyingReceivedOrientation } } set { setOrientationReceivedOrientationLock.withLock { setOrientationUnderlyingReceivedOrientation = newValue } } } private let setOrientationReceivedInvocationsLock = NSLock() - private var setOrientationUnderlyingReceivedInvocations: [UIInterfaceOrientationMask] = [] + private nonisolated(unsafe) var setOrientationUnderlyingReceivedInvocations: [UIInterfaceOrientationMask] = [] var setOrientationReceivedInvocations: [UIInterfaceOrientationMask] { get { setOrientationReceivedInvocationsLock.withLock { setOrientationUnderlyingReceivedInvocations } } set { setOrientationReceivedInvocationsLock.withLock { setOrientationUnderlyingReceivedInvocations = newValue } } } - var setOrientationClosure: ((UIInterfaceOrientationMask) -> Void)? + nonisolated(unsafe) var setOrientationClosure: ((UIInterfaceOrientationMask) -> Void)? func setOrientation(_ orientation: UIInterfaceOrientationMask) { setOrientationCallsCountLock.withLock { setOrientationUnderlyingCallsCount += 1 } @@ -9367,7 +9367,7 @@ class OrientationManagerMock: OrientationManagerProtocol, @unchecked Sendable { //MARK: - lockOrientation private let lockOrientationCallsCountLock = NSLock() - private var lockOrientationUnderlyingCallsCount = 0 + private nonisolated(unsafe) var lockOrientationUnderlyingCallsCount = 0 var lockOrientationCallsCount: Int { get { lockOrientationCallsCountLock.withLock { lockOrientationUnderlyingCallsCount } } set { lockOrientationCallsCountLock.withLock { lockOrientationUnderlyingCallsCount = newValue } } @@ -9376,18 +9376,18 @@ class OrientationManagerMock: OrientationManagerProtocol, @unchecked Sendable { return lockOrientationCallsCount > 0 } private let lockOrientationReceivedOrientationLock = NSLock() - private var lockOrientationUnderlyingReceivedOrientation: UIInterfaceOrientationMask? + private nonisolated(unsafe) var lockOrientationUnderlyingReceivedOrientation: UIInterfaceOrientationMask? var lockOrientationReceivedOrientation: UIInterfaceOrientationMask? { get { lockOrientationReceivedOrientationLock.withLock { lockOrientationUnderlyingReceivedOrientation } } set { lockOrientationReceivedOrientationLock.withLock { lockOrientationUnderlyingReceivedOrientation = newValue } } } private let lockOrientationReceivedInvocationsLock = NSLock() - private var lockOrientationUnderlyingReceivedInvocations: [UIInterfaceOrientationMask] = [] + private nonisolated(unsafe) var lockOrientationUnderlyingReceivedInvocations: [UIInterfaceOrientationMask] = [] var lockOrientationReceivedInvocations: [UIInterfaceOrientationMask] { get { lockOrientationReceivedInvocationsLock.withLock { lockOrientationUnderlyingReceivedInvocations } } set { lockOrientationReceivedInvocationsLock.withLock { lockOrientationUnderlyingReceivedInvocations = newValue } } } - var lockOrientationClosure: ((UIInterfaceOrientationMask) -> Void)? + nonisolated(unsafe) var lockOrientationClosure: ((UIInterfaceOrientationMask) -> Void)? func lockOrientation(_ orientation: UIInterfaceOrientationMask) { lockOrientationCallsCountLock.withLock { lockOrientationUnderlyingCallsCount += 1 } @@ -9396,12 +9396,12 @@ class OrientationManagerMock: OrientationManagerProtocol, @unchecked Sendable { lockOrientationClosure?(orientation) } } -class PHGPostHogMock: PHGPostHogProtocol, @unchecked Sendable { +nonisolated class PHGPostHogMock: PHGPostHogProtocol, @unchecked Sendable { //MARK: - optIn private let optInCallsCountLock = NSLock() - private var optInUnderlyingCallsCount = 0 + private nonisolated(unsafe) var optInUnderlyingCallsCount = 0 var optInCallsCount: Int { get { optInCallsCountLock.withLock { optInUnderlyingCallsCount } } set { optInCallsCountLock.withLock { optInUnderlyingCallsCount = newValue } } @@ -9409,7 +9409,7 @@ class PHGPostHogMock: PHGPostHogProtocol, @unchecked Sendable { var optInCalled: Bool { return optInCallsCount > 0 } - var optInClosure: (() -> Void)? + nonisolated(unsafe) var optInClosure: (() -> Void)? func optIn() { optInCallsCountLock.withLock { optInUnderlyingCallsCount += 1 } @@ -9418,7 +9418,7 @@ class PHGPostHogMock: PHGPostHogProtocol, @unchecked Sendable { //MARK: - optOut private let optOutCallsCountLock = NSLock() - private var optOutUnderlyingCallsCount = 0 + private nonisolated(unsafe) var optOutUnderlyingCallsCount = 0 var optOutCallsCount: Int { get { optOutCallsCountLock.withLock { optOutUnderlyingCallsCount } } set { optOutCallsCountLock.withLock { optOutUnderlyingCallsCount = newValue } } @@ -9426,7 +9426,7 @@ class PHGPostHogMock: PHGPostHogProtocol, @unchecked Sendable { var optOutCalled: Bool { return optOutCallsCount > 0 } - var optOutClosure: (() -> Void)? + nonisolated(unsafe) var optOutClosure: (() -> Void)? func optOut() { optOutCallsCountLock.withLock { optOutUnderlyingCallsCount += 1 } @@ -9435,7 +9435,7 @@ class PHGPostHogMock: PHGPostHogProtocol, @unchecked Sendable { //MARK: - reset private let resetCallsCountLock = NSLock() - private var resetUnderlyingCallsCount = 0 + private nonisolated(unsafe) var resetUnderlyingCallsCount = 0 var resetCallsCount: Int { get { resetCallsCountLock.withLock { resetUnderlyingCallsCount } } set { resetCallsCountLock.withLock { resetUnderlyingCallsCount = newValue } } @@ -9443,7 +9443,7 @@ class PHGPostHogMock: PHGPostHogProtocol, @unchecked Sendable { var resetCalled: Bool { return resetCallsCount > 0 } - var resetClosure: (() -> Void)? + nonisolated(unsafe) var resetClosure: (() -> Void)? func reset() { resetCallsCountLock.withLock { resetUnderlyingCallsCount += 1 } @@ -9452,7 +9452,7 @@ class PHGPostHogMock: PHGPostHogProtocol, @unchecked Sendable { //MARK: - capture private let capturePropertiesUserPropertiesCallsCountLock = NSLock() - private var capturePropertiesUserPropertiesUnderlyingCallsCount = 0 + private nonisolated(unsafe) var capturePropertiesUserPropertiesUnderlyingCallsCount = 0 var capturePropertiesUserPropertiesCallsCount: Int { get { capturePropertiesUserPropertiesCallsCountLock.withLock { capturePropertiesUserPropertiesUnderlyingCallsCount } } set { capturePropertiesUserPropertiesCallsCountLock.withLock { capturePropertiesUserPropertiesUnderlyingCallsCount = newValue } } @@ -9461,18 +9461,18 @@ class PHGPostHogMock: PHGPostHogProtocol, @unchecked Sendable { return capturePropertiesUserPropertiesCallsCount > 0 } private let capturePropertiesUserPropertiesReceivedArgumentsLock = NSLock() - private var capturePropertiesUserPropertiesUnderlyingReceivedArguments: (event: String, properties: [String: Any]?, userProperties: [String: Any]?)? + private nonisolated(unsafe) var capturePropertiesUserPropertiesUnderlyingReceivedArguments: (event: String, properties: [String: Any]?, userProperties: [String: Any]?)? var capturePropertiesUserPropertiesReceivedArguments: (event: String, properties: [String: Any]?, userProperties: [String: Any]?)? { get { capturePropertiesUserPropertiesReceivedArgumentsLock.withLock { capturePropertiesUserPropertiesUnderlyingReceivedArguments } } set { capturePropertiesUserPropertiesReceivedArgumentsLock.withLock { capturePropertiesUserPropertiesUnderlyingReceivedArguments = newValue } } } private let capturePropertiesUserPropertiesReceivedInvocationsLock = NSLock() - private var capturePropertiesUserPropertiesUnderlyingReceivedInvocations: [(event: String, properties: [String: Any]?, userProperties: [String: Any]?)] = [] + private nonisolated(unsafe) var capturePropertiesUserPropertiesUnderlyingReceivedInvocations: [(event: String, properties: [String: Any]?, userProperties: [String: Any]?)] = [] var capturePropertiesUserPropertiesReceivedInvocations: [(event: String, properties: [String: Any]?, userProperties: [String: Any]?)] { get { capturePropertiesUserPropertiesReceivedInvocationsLock.withLock { capturePropertiesUserPropertiesUnderlyingReceivedInvocations } } set { capturePropertiesUserPropertiesReceivedInvocationsLock.withLock { capturePropertiesUserPropertiesUnderlyingReceivedInvocations = newValue } } } - var capturePropertiesUserPropertiesClosure: ((String, [String: Any]?, [String: Any]?) -> Void)? + nonisolated(unsafe) var capturePropertiesUserPropertiesClosure: ((String, [String: Any]?, [String: Any]?) -> Void)? func capture(_ event: String, properties: [String: Any]?, userProperties: [String: Any]?) { capturePropertiesUserPropertiesCallsCountLock.withLock { capturePropertiesUserPropertiesUnderlyingCallsCount += 1 } @@ -9483,7 +9483,7 @@ class PHGPostHogMock: PHGPostHogProtocol, @unchecked Sendable { //MARK: - screen private let screenPropertiesCallsCountLock = NSLock() - private var screenPropertiesUnderlyingCallsCount = 0 + private nonisolated(unsafe) var screenPropertiesUnderlyingCallsCount = 0 var screenPropertiesCallsCount: Int { get { screenPropertiesCallsCountLock.withLock { screenPropertiesUnderlyingCallsCount } } set { screenPropertiesCallsCountLock.withLock { screenPropertiesUnderlyingCallsCount = newValue } } @@ -9492,18 +9492,18 @@ class PHGPostHogMock: PHGPostHogProtocol, @unchecked Sendable { return screenPropertiesCallsCount > 0 } private let screenPropertiesReceivedArgumentsLock = NSLock() - private var screenPropertiesUnderlyingReceivedArguments: (screenTitle: String, properties: [String: Any]?)? + private nonisolated(unsafe) var screenPropertiesUnderlyingReceivedArguments: (screenTitle: String, properties: [String: Any]?)? var screenPropertiesReceivedArguments: (screenTitle: String, properties: [String: Any]?)? { get { screenPropertiesReceivedArgumentsLock.withLock { screenPropertiesUnderlyingReceivedArguments } } set { screenPropertiesReceivedArgumentsLock.withLock { screenPropertiesUnderlyingReceivedArguments = newValue } } } private let screenPropertiesReceivedInvocationsLock = NSLock() - private var screenPropertiesUnderlyingReceivedInvocations: [(screenTitle: String, properties: [String: Any]?)] = [] + private nonisolated(unsafe) var screenPropertiesUnderlyingReceivedInvocations: [(screenTitle: String, properties: [String: Any]?)] = [] var screenPropertiesReceivedInvocations: [(screenTitle: String, properties: [String: Any]?)] { get { screenPropertiesReceivedInvocationsLock.withLock { screenPropertiesUnderlyingReceivedInvocations } } set { screenPropertiesReceivedInvocationsLock.withLock { screenPropertiesUnderlyingReceivedInvocations = newValue } } } - var screenPropertiesClosure: ((String, [String: Any]?) -> Void)? + nonisolated(unsafe) var screenPropertiesClosure: ((String, [String: Any]?) -> Void)? func screen(_ screenTitle: String, properties: [String: Any]?) { screenPropertiesCallsCountLock.withLock { screenPropertiesUnderlyingCallsCount += 1 } @@ -9512,12 +9512,12 @@ class PHGPostHogMock: PHGPostHogProtocol, @unchecked Sendable { screenPropertiesClosure?(screenTitle, properties) } } -class PhotoLibraryManagerMock: PhotoLibraryManagerProtocol, @unchecked Sendable { +nonisolated class PhotoLibraryManagerMock: PhotoLibraryManagerProtocol, @unchecked Sendable { //MARK: - addResource private let addResourceAtCallsCountLock = NSLock() - private var addResourceAtUnderlyingCallsCount = 0 + private nonisolated(unsafe) var addResourceAtUnderlyingCallsCount = 0 var addResourceAtCallsCount: Int { get { addResourceAtCallsCountLock.withLock { addResourceAtUnderlyingCallsCount } } set { addResourceAtCallsCountLock.withLock { addResourceAtUnderlyingCallsCount = newValue } } @@ -9526,27 +9526,27 @@ class PhotoLibraryManagerMock: PhotoLibraryManagerProtocol, @unchecked Sendable return addResourceAtCallsCount > 0 } private let addResourceAtReceivedArgumentsLock = NSLock() - private var addResourceAtUnderlyingReceivedArguments: (type: PHAssetResourceType, url: URL)? + private nonisolated(unsafe) var addResourceAtUnderlyingReceivedArguments: (type: PHAssetResourceType, url: URL)? var addResourceAtReceivedArguments: (type: PHAssetResourceType, url: URL)? { get { addResourceAtReceivedArgumentsLock.withLock { addResourceAtUnderlyingReceivedArguments } } set { addResourceAtReceivedArgumentsLock.withLock { addResourceAtUnderlyingReceivedArguments = newValue } } } private let addResourceAtReceivedInvocationsLock = NSLock() - private var addResourceAtUnderlyingReceivedInvocations: [(type: PHAssetResourceType, url: URL)] = [] + private nonisolated(unsafe) var addResourceAtUnderlyingReceivedInvocations: [(type: PHAssetResourceType, url: URL)] = [] var addResourceAtReceivedInvocations: [(type: PHAssetResourceType, url: URL)] { get { addResourceAtReceivedInvocationsLock.withLock { addResourceAtUnderlyingReceivedInvocations } } set { addResourceAtReceivedInvocationsLock.withLock { addResourceAtUnderlyingReceivedInvocations = newValue } } } private let addResourceAtReturnValueLock = NSLock() - private var addResourceAtUnderlyingReturnValue: Result! + private nonisolated(unsafe) var addResourceAtUnderlyingReturnValue: Result! var addResourceAtReturnValue: Result! { get { addResourceAtReturnValueLock.withLock { addResourceAtUnderlyingReturnValue } } set { addResourceAtReturnValueLock.withLock { addResourceAtUnderlyingReturnValue = newValue } } } - var addResourceAtClosure: ((PHAssetResourceType, URL) async -> Result)? + nonisolated(unsafe) var addResourceAtClosure: ((PHAssetResourceType, URL) async -> Result)? - func addResource(_ type: PHAssetResourceType, at url: URL) async -> Result { + @concurrent func addResource(_ type: PHAssetResourceType, at url: URL) async -> Result { addResourceAtCallsCountLock.withLock { addResourceAtUnderlyingCallsCount += 1 } addResourceAtReceivedArguments = (type: type, url: url) addResourceAtReceivedInvocationsLock.withLock { addResourceAtUnderlyingReceivedInvocations.append((type: type, url: url)) } @@ -9557,12 +9557,12 @@ class PhotoLibraryManagerMock: PhotoLibraryManagerProtocol, @unchecked Sendable } } } -class PollInteractionHandlerMock: PollInteractionHandlerProtocol, @unchecked Sendable { +nonisolated class PollInteractionHandlerMock: PollInteractionHandlerProtocol, @unchecked Sendable { //MARK: - sendPollResponse private let sendPollResponsePollStartIDOptionIDCallsCountLock = NSLock() - private var sendPollResponsePollStartIDOptionIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var sendPollResponsePollStartIDOptionIDUnderlyingCallsCount = 0 var sendPollResponsePollStartIDOptionIDCallsCount: Int { get { sendPollResponsePollStartIDOptionIDCallsCountLock.withLock { sendPollResponsePollStartIDOptionIDUnderlyingCallsCount } } set { sendPollResponsePollStartIDOptionIDCallsCountLock.withLock { sendPollResponsePollStartIDOptionIDUnderlyingCallsCount = newValue } } @@ -9571,27 +9571,27 @@ class PollInteractionHandlerMock: PollInteractionHandlerProtocol, @unchecked Sen return sendPollResponsePollStartIDOptionIDCallsCount > 0 } private let sendPollResponsePollStartIDOptionIDReceivedArgumentsLock = NSLock() - private var sendPollResponsePollStartIDOptionIDUnderlyingReceivedArguments: (pollStartID: String, optionID: String)? + private nonisolated(unsafe) var sendPollResponsePollStartIDOptionIDUnderlyingReceivedArguments: (pollStartID: String, optionID: String)? var sendPollResponsePollStartIDOptionIDReceivedArguments: (pollStartID: String, optionID: String)? { get { sendPollResponsePollStartIDOptionIDReceivedArgumentsLock.withLock { sendPollResponsePollStartIDOptionIDUnderlyingReceivedArguments } } set { sendPollResponsePollStartIDOptionIDReceivedArgumentsLock.withLock { sendPollResponsePollStartIDOptionIDUnderlyingReceivedArguments = newValue } } } private let sendPollResponsePollStartIDOptionIDReceivedInvocationsLock = NSLock() - private var sendPollResponsePollStartIDOptionIDUnderlyingReceivedInvocations: [(pollStartID: String, optionID: String)] = [] + private nonisolated(unsafe) var sendPollResponsePollStartIDOptionIDUnderlyingReceivedInvocations: [(pollStartID: String, optionID: String)] = [] var sendPollResponsePollStartIDOptionIDReceivedInvocations: [(pollStartID: String, optionID: String)] { get { sendPollResponsePollStartIDOptionIDReceivedInvocationsLock.withLock { sendPollResponsePollStartIDOptionIDUnderlyingReceivedInvocations } } set { sendPollResponsePollStartIDOptionIDReceivedInvocationsLock.withLock { sendPollResponsePollStartIDOptionIDUnderlyingReceivedInvocations = newValue } } } private let sendPollResponsePollStartIDOptionIDReturnValueLock = NSLock() - private var sendPollResponsePollStartIDOptionIDUnderlyingReturnValue: Result! + private nonisolated(unsafe) var sendPollResponsePollStartIDOptionIDUnderlyingReturnValue: Result! var sendPollResponsePollStartIDOptionIDReturnValue: Result! { get { sendPollResponsePollStartIDOptionIDReturnValueLock.withLock { sendPollResponsePollStartIDOptionIDUnderlyingReturnValue } } set { sendPollResponsePollStartIDOptionIDReturnValueLock.withLock { sendPollResponsePollStartIDOptionIDUnderlyingReturnValue = newValue } } } - var sendPollResponsePollStartIDOptionIDClosure: ((String, String) async -> Result)? + nonisolated(unsafe) var sendPollResponsePollStartIDOptionIDClosure: ((String, String) async -> Result)? - func sendPollResponse(pollStartID: String, optionID: String) async -> Result { + @concurrent func sendPollResponse(pollStartID: String, optionID: String) async -> Result { sendPollResponsePollStartIDOptionIDCallsCountLock.withLock { sendPollResponsePollStartIDOptionIDUnderlyingCallsCount += 1 } sendPollResponsePollStartIDOptionIDReceivedArguments = (pollStartID: pollStartID, optionID: optionID) sendPollResponsePollStartIDOptionIDReceivedInvocationsLock.withLock { sendPollResponsePollStartIDOptionIDUnderlyingReceivedInvocations.append((pollStartID: pollStartID, optionID: optionID)) } @@ -9604,7 +9604,7 @@ class PollInteractionHandlerMock: PollInteractionHandlerProtocol, @unchecked Sen //MARK: - endPoll private let endPollPollStartIDCallsCountLock = NSLock() - private var endPollPollStartIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var endPollPollStartIDUnderlyingCallsCount = 0 var endPollPollStartIDCallsCount: Int { get { endPollPollStartIDCallsCountLock.withLock { endPollPollStartIDUnderlyingCallsCount } } set { endPollPollStartIDCallsCountLock.withLock { endPollPollStartIDUnderlyingCallsCount = newValue } } @@ -9613,27 +9613,27 @@ class PollInteractionHandlerMock: PollInteractionHandlerProtocol, @unchecked Sen return endPollPollStartIDCallsCount > 0 } private let endPollPollStartIDReceivedPollStartIDLock = NSLock() - private var endPollPollStartIDUnderlyingReceivedPollStartID: String? + private nonisolated(unsafe) var endPollPollStartIDUnderlyingReceivedPollStartID: String? var endPollPollStartIDReceivedPollStartID: String? { get { endPollPollStartIDReceivedPollStartIDLock.withLock { endPollPollStartIDUnderlyingReceivedPollStartID } } set { endPollPollStartIDReceivedPollStartIDLock.withLock { endPollPollStartIDUnderlyingReceivedPollStartID = newValue } } } private let endPollPollStartIDReceivedInvocationsLock = NSLock() - private var endPollPollStartIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var endPollPollStartIDUnderlyingReceivedInvocations: [String] = [] var endPollPollStartIDReceivedInvocations: [String] { get { endPollPollStartIDReceivedInvocationsLock.withLock { endPollPollStartIDUnderlyingReceivedInvocations } } set { endPollPollStartIDReceivedInvocationsLock.withLock { endPollPollStartIDUnderlyingReceivedInvocations = newValue } } } private let endPollPollStartIDReturnValueLock = NSLock() - private var endPollPollStartIDUnderlyingReturnValue: Result! + private nonisolated(unsafe) var endPollPollStartIDUnderlyingReturnValue: Result! var endPollPollStartIDReturnValue: Result! { get { endPollPollStartIDReturnValueLock.withLock { endPollPollStartIDUnderlyingReturnValue } } set { endPollPollStartIDReturnValueLock.withLock { endPollPollStartIDUnderlyingReturnValue = newValue } } } - var endPollPollStartIDClosure: ((String) async -> Result)? + nonisolated(unsafe) var endPollPollStartIDClosure: ((String) async -> Result)? - func endPoll(pollStartID: String) async -> Result { + @concurrent func endPoll(pollStartID: String) async -> Result { endPollPollStartIDCallsCountLock.withLock { endPollPollStartIDUnderlyingCallsCount += 1 } endPollPollStartIDReceivedPollStartID = pollStartID endPollPollStartIDReceivedInvocationsLock.withLock { endPollPollStartIDUnderlyingReceivedInvocations.append(pollStartID) } @@ -9644,12 +9644,12 @@ class PollInteractionHandlerMock: PollInteractionHandlerProtocol, @unchecked Sen } } } -class QRCodeLoginServiceMock: QRCodeLoginServiceProtocol, @unchecked Sendable { +nonisolated class QRCodeLoginServiceMock: QRCodeLoginServiceProtocol, @unchecked Sendable { //MARK: - loginWithQRCode private let loginWithQRCodeDataCallsCountLock = NSLock() - private var loginWithQRCodeDataUnderlyingCallsCount = 0 + private nonisolated(unsafe) var loginWithQRCodeDataUnderlyingCallsCount = 0 var loginWithQRCodeDataCallsCount: Int { get { loginWithQRCodeDataCallsCountLock.withLock { loginWithQRCodeDataUnderlyingCallsCount } } set { loginWithQRCodeDataCallsCountLock.withLock { loginWithQRCodeDataUnderlyingCallsCount = newValue } } @@ -9658,25 +9658,25 @@ class QRCodeLoginServiceMock: QRCodeLoginServiceProtocol, @unchecked Sendable { return loginWithQRCodeDataCallsCount > 0 } private let loginWithQRCodeDataReceivedDataLock = NSLock() - private var loginWithQRCodeDataUnderlyingReceivedData: Data? + private nonisolated(unsafe) var loginWithQRCodeDataUnderlyingReceivedData: Data? var loginWithQRCodeDataReceivedData: Data? { get { loginWithQRCodeDataReceivedDataLock.withLock { loginWithQRCodeDataUnderlyingReceivedData } } set { loginWithQRCodeDataReceivedDataLock.withLock { loginWithQRCodeDataUnderlyingReceivedData = newValue } } } private let loginWithQRCodeDataReceivedInvocationsLock = NSLock() - private var loginWithQRCodeDataUnderlyingReceivedInvocations: [Data] = [] + private nonisolated(unsafe) var loginWithQRCodeDataUnderlyingReceivedInvocations: [Data] = [] var loginWithQRCodeDataReceivedInvocations: [Data] { get { loginWithQRCodeDataReceivedInvocationsLock.withLock { loginWithQRCodeDataUnderlyingReceivedInvocations } } set { loginWithQRCodeDataReceivedInvocationsLock.withLock { loginWithQRCodeDataUnderlyingReceivedInvocations = newValue } } } private let loginWithQRCodeDataReturnValueLock = NSLock() - private var loginWithQRCodeDataUnderlyingReturnValue: QRLoginProgressPublisher! + private nonisolated(unsafe) var loginWithQRCodeDataUnderlyingReturnValue: QRLoginProgressPublisher! var loginWithQRCodeDataReturnValue: QRLoginProgressPublisher! { get { loginWithQRCodeDataReturnValueLock.withLock { loginWithQRCodeDataUnderlyingReturnValue } } set { loginWithQRCodeDataReturnValueLock.withLock { loginWithQRCodeDataUnderlyingReturnValue = newValue } } } - var loginWithQRCodeDataClosure: ((Data) -> QRLoginProgressPublisher)? + nonisolated(unsafe) var loginWithQRCodeDataClosure: ((Data) -> QRLoginProgressPublisher)? func loginWithQRCode(data: Data) -> QRLoginProgressPublisher { loginWithQRCodeDataCallsCountLock.withLock { loginWithQRCodeDataUnderlyingCallsCount += 1 } @@ -9689,17 +9689,17 @@ class QRCodeLoginServiceMock: QRCodeLoginServiceProtocol, @unchecked Sendable { } } } -class RoomDirectorySearchProxyMock: RoomDirectorySearchProxyProtocol, @unchecked Sendable { +nonisolated class RoomDirectorySearchProxyMock: RoomDirectorySearchProxyProtocol, @unchecked Sendable { var resultsPublisher: CurrentValuePublisher<[RoomDirectorySearchResult], Never> { get { return underlyingResultsPublisher } set(value) { underlyingResultsPublisher = value } } - var underlyingResultsPublisher: CurrentValuePublisher<[RoomDirectorySearchResult], Never>! + nonisolated(unsafe) var underlyingResultsPublisher: CurrentValuePublisher<[RoomDirectorySearchResult], Never>! //MARK: - search private let searchQueryCallsCountLock = NSLock() - private var searchQueryUnderlyingCallsCount = 0 + private nonisolated(unsafe) var searchQueryUnderlyingCallsCount = 0 var searchQueryCallsCount: Int { get { searchQueryCallsCountLock.withLock { searchQueryUnderlyingCallsCount } } set { searchQueryCallsCountLock.withLock { searchQueryUnderlyingCallsCount = newValue } } @@ -9708,27 +9708,27 @@ class RoomDirectorySearchProxyMock: RoomDirectorySearchProxyProtocol, @unchecked return searchQueryCallsCount > 0 } private let searchQueryReceivedQueryLock = NSLock() - private var searchQueryUnderlyingReceivedQuery: String? + private nonisolated(unsafe) var searchQueryUnderlyingReceivedQuery: String? var searchQueryReceivedQuery: String? { get { searchQueryReceivedQueryLock.withLock { searchQueryUnderlyingReceivedQuery } } set { searchQueryReceivedQueryLock.withLock { searchQueryUnderlyingReceivedQuery = newValue } } } private let searchQueryReceivedInvocationsLock = NSLock() - private var searchQueryUnderlyingReceivedInvocations: [String?] = [] + private nonisolated(unsafe) var searchQueryUnderlyingReceivedInvocations: [String?] = [] var searchQueryReceivedInvocations: [String?] { get { searchQueryReceivedInvocationsLock.withLock { searchQueryUnderlyingReceivedInvocations } } set { searchQueryReceivedInvocationsLock.withLock { searchQueryUnderlyingReceivedInvocations = newValue } } } private let searchQueryReturnValueLock = NSLock() - private var searchQueryUnderlyingReturnValue: Result! + private nonisolated(unsafe) var searchQueryUnderlyingReturnValue: Result! var searchQueryReturnValue: Result! { get { searchQueryReturnValueLock.withLock { searchQueryUnderlyingReturnValue } } set { searchQueryReturnValueLock.withLock { searchQueryUnderlyingReturnValue = newValue } } } - var searchQueryClosure: ((String?) async -> Result)? + nonisolated(unsafe) var searchQueryClosure: ((String?) async -> Result)? - func search(query: String?) async -> Result { + @concurrent func search(query: String?) async -> Result { searchQueryCallsCountLock.withLock { searchQueryUnderlyingCallsCount += 1 } searchQueryReceivedQuery = query searchQueryReceivedInvocationsLock.withLock { searchQueryUnderlyingReceivedInvocations.append(query) } @@ -9741,7 +9741,7 @@ class RoomDirectorySearchProxyMock: RoomDirectorySearchProxyProtocol, @unchecked //MARK: - nextPage private let nextPageCallsCountLock = NSLock() - private var nextPageUnderlyingCallsCount = 0 + private nonisolated(unsafe) var nextPageUnderlyingCallsCount = 0 var nextPageCallsCount: Int { get { nextPageCallsCountLock.withLock { nextPageUnderlyingCallsCount } } set { nextPageCallsCountLock.withLock { nextPageUnderlyingCallsCount = newValue } } @@ -9751,14 +9751,14 @@ class RoomDirectorySearchProxyMock: RoomDirectorySearchProxyProtocol, @unchecked } private let nextPageReturnValueLock = NSLock() - private var nextPageUnderlyingReturnValue: Result! + private nonisolated(unsafe) var nextPageUnderlyingReturnValue: Result! var nextPageReturnValue: Result! { get { nextPageReturnValueLock.withLock { nextPageUnderlyingReturnValue } } set { nextPageReturnValueLock.withLock { nextPageUnderlyingReturnValue = newValue } } } - var nextPageClosure: (() async -> Result)? + nonisolated(unsafe) var nextPageClosure: (() async -> Result)? - func nextPage() async -> Result { + @concurrent func nextPage() async -> Result { nextPageCallsCountLock.withLock { nextPageUnderlyingCallsCount += 1 } if let nextPageClosure = nextPageClosure { return await nextPageClosure() @@ -9767,194 +9767,194 @@ class RoomDirectorySearchProxyMock: RoomDirectorySearchProxyProtocol, @unchecked } } } -class RoomInfoProxyMock: RoomInfoProxyProtocol, @unchecked Sendable { +nonisolated class RoomInfoProxyMock: RoomInfoProxyProtocol, @unchecked Sendable { var id: String { get { return underlyingId } set(value) { underlyingId = value } } - var underlyingId: String! - var creators: [String] = [] - var displayName: String? - var rawName: String? - var topic: String? - var avatarURL: URL? + nonisolated(unsafe) var underlyingId: String! + nonisolated(unsafe) var creators: [String] = [] + nonisolated(unsafe) var displayName: String? + nonisolated(unsafe) var rawName: String? + nonisolated(unsafe) var topic: String? + nonisolated(unsafe) var avatarURL: URL? var isEncrypted: Bool { get { return underlyingIsEncrypted } set(value) { underlyingIsEncrypted = value } } - var underlyingIsEncrypted: Bool! + nonisolated(unsafe) var underlyingIsEncrypted: Bool! var isDirect: Bool { get { return underlyingIsDirect } set(value) { underlyingIsDirect = value } } - var underlyingIsDirect: Bool! + nonisolated(unsafe) var underlyingIsDirect: Bool! var isDM: Bool { get { return underlyingIsDM } set(value) { underlyingIsDM = value } } - var underlyingIsDM: Bool! + nonisolated(unsafe) var underlyingIsDM: Bool! var isSpace: Bool { get { return underlyingIsSpace } set(value) { underlyingIsSpace = value } } - var underlyingIsSpace: Bool! + nonisolated(unsafe) var underlyingIsSpace: Bool! var isFavourite: Bool { get { return underlyingIsFavourite } set(value) { underlyingIsFavourite = value } } - var underlyingIsFavourite: Bool! - var canonicalAlias: String? - var alternativeAliases: [String] = [] + nonisolated(unsafe) var underlyingIsFavourite: Bool! + nonisolated(unsafe) var canonicalAlias: String? + nonisolated(unsafe) var alternativeAliases: [String] = [] var membership: Membership { get { return underlyingMembership } set(value) { underlyingMembership = value } } - var underlyingMembership: Membership! - var inviter: RoomMemberProxyProtocol? + nonisolated(unsafe) var underlyingMembership: Membership! + nonisolated(unsafe) var inviter: RoomMemberProxyProtocol? var activeMembersCount: Int { get { return underlyingActiveMembersCount } set(value) { underlyingActiveMembersCount = value } } - var underlyingActiveMembersCount: Int! + nonisolated(unsafe) var underlyingActiveMembersCount: Int! var invitedMembersCount: Int { get { return underlyingInvitedMembersCount } set(value) { underlyingInvitedMembersCount = value } } - var underlyingInvitedMembersCount: Int! + nonisolated(unsafe) var underlyingInvitedMembersCount: Int! var joinedMembersCount: Int { get { return underlyingJoinedMembersCount } set(value) { underlyingJoinedMembersCount = value } } - var underlyingJoinedMembersCount: Int! + nonisolated(unsafe) var underlyingJoinedMembersCount: Int! var highlightCount: Int { get { return underlyingHighlightCount } set(value) { underlyingHighlightCount = value } } - var underlyingHighlightCount: Int! + nonisolated(unsafe) var underlyingHighlightCount: Int! var notificationCount: Int { get { return underlyingNotificationCount } set(value) { underlyingNotificationCount = value } } - var underlyingNotificationCount: Int! - var cachedUserDefinedNotificationMode: RoomNotificationMode? + nonisolated(unsafe) var underlyingNotificationCount: Int! + nonisolated(unsafe) var cachedUserDefinedNotificationMode: RoomNotificationMode? var hasRoomCall: Bool { get { return underlyingHasRoomCall } set(value) { underlyingHasRoomCall = value } } - var underlyingHasRoomCall: Bool! - var activeRoomCallIntent: CallIntent? - var activeRoomCallParticipants: [String] = [] + nonisolated(unsafe) var underlyingHasRoomCall: Bool! + nonisolated(unsafe) var activeRoomCallIntent: CallIntent? + nonisolated(unsafe) var activeRoomCallParticipants: [String] = [] var isMarkedUnread: Bool { get { return underlyingIsMarkedUnread } set(value) { underlyingIsMarkedUnread = value } } - var underlyingIsMarkedUnread: Bool! + nonisolated(unsafe) var underlyingIsMarkedUnread: Bool! var unreadMessagesCount: UInt { get { return underlyingUnreadMessagesCount } set(value) { underlyingUnreadMessagesCount = value } } - var underlyingUnreadMessagesCount: UInt! + nonisolated(unsafe) var underlyingUnreadMessagesCount: UInt! var unreadNotificationsCount: UInt { get { return underlyingUnreadNotificationsCount } set(value) { underlyingUnreadNotificationsCount = value } } - var underlyingUnreadNotificationsCount: UInt! + nonisolated(unsafe) var underlyingUnreadNotificationsCount: UInt! var unreadMentionsCount: UInt { get { return underlyingUnreadMentionsCount } set(value) { underlyingUnreadMentionsCount = value } } - var underlyingUnreadMentionsCount: UInt! - var fullyReadEventID: String? + nonisolated(unsafe) var underlyingUnreadMentionsCount: UInt! + nonisolated(unsafe) var fullyReadEventID: String? var pinnedEventIDs: Set { get { return underlyingPinnedEventIDs } set(value) { underlyingPinnedEventIDs = value } } - var underlyingPinnedEventIDs: Set! - var joinRule: JoinRule? + nonisolated(unsafe) var underlyingPinnedEventIDs: Set! + nonisolated(unsafe) var joinRule: JoinRule? var historyVisibility: RoomHistoryVisibility { get { return underlyingHistoryVisibility } set(value) { underlyingHistoryVisibility = value } } - var underlyingHistoryVisibility: RoomHistoryVisibility! - var powerLevels: RoomPowerLevelsProxyProtocol? - var successor: SuccessorRoom? - var heroes: [RoomHero] = [] + nonisolated(unsafe) var underlyingHistoryVisibility: RoomHistoryVisibility! + nonisolated(unsafe) var powerLevels: RoomPowerLevelsProxyProtocol? + nonisolated(unsafe) var successor: SuccessorRoom? + nonisolated(unsafe) var heroes: [RoomHero] = [] } -class RoomLiveLocationServiceMock: RoomLiveLocationServiceProtocol, @unchecked Sendable { +nonisolated class RoomLiveLocationServiceMock: RoomLiveLocationServiceProtocol, @unchecked Sendable { var liveLocationsPublisher: CurrentValuePublisher<[LiveLocationShare], Never> { get { return underlyingLiveLocationsPublisher } set(value) { underlyingLiveLocationsPublisher = value } } - var underlyingLiveLocationsPublisher: CurrentValuePublisher<[LiveLocationShare], Never>! + nonisolated(unsafe) var underlyingLiveLocationsPublisher: CurrentValuePublisher<[LiveLocationShare], Never>! } -class RoomMemberProxyMock: RoomMemberProxyProtocol, @unchecked Sendable { +nonisolated class RoomMemberProxyMock: RoomMemberProxyProtocol, @unchecked Sendable { var userID: String { get { return underlyingUserID } set(value) { underlyingUserID = value } } - var underlyingUserID: String! - var displayName: String? - var disambiguatedDisplayName: String? - var avatarURL: URL? + nonisolated(unsafe) var underlyingUserID: String! + nonisolated(unsafe) var displayName: String? + nonisolated(unsafe) var disambiguatedDisplayName: String? + nonisolated(unsafe) var avatarURL: URL? var membership: MembershipState { get { return underlyingMembership } set(value) { underlyingMembership = value } } - var underlyingMembership: MembershipState! - var membershipChangeReason: String? + nonisolated(unsafe) var underlyingMembership: MembershipState! + nonisolated(unsafe) var membershipChangeReason: String? var isIgnored: Bool { get { return underlyingIsIgnored } set(value) { underlyingIsIgnored = value } } - var underlyingIsIgnored: Bool! + nonisolated(unsafe) var underlyingIsIgnored: Bool! var powerLevel: RoomPowerLevel { get { return underlyingPowerLevel } set(value) { underlyingPowerLevel = value } } - var underlyingPowerLevel: RoomPowerLevel! + nonisolated(unsafe) var underlyingPowerLevel: RoomPowerLevel! var isServiceMember: Bool { get { return underlyingIsServiceMember } set(value) { underlyingIsServiceMember = value } } - var underlyingIsServiceMember: Bool! + nonisolated(unsafe) var underlyingIsServiceMember: Bool! } -class RoomMembershipDetailsProxyMock: RoomMembershipDetailsProxyProtocol, @unchecked Sendable { +nonisolated class RoomMembershipDetailsProxyMock: RoomMembershipDetailsProxyProtocol, @unchecked Sendable { var ownRoomMember: RoomMemberProxyProtocol { get { return underlyingOwnRoomMember } set(value) { underlyingOwnRoomMember = value } } - var underlyingOwnRoomMember: RoomMemberProxyProtocol! - var senderRoomMember: RoomMemberProxyProtocol? + nonisolated(unsafe) var underlyingOwnRoomMember: RoomMemberProxyProtocol! + nonisolated(unsafe) var senderRoomMember: RoomMemberProxyProtocol? } -class RoomNotificationSettingsProxyMock: RoomNotificationSettingsProxyProtocol, @unchecked Sendable { +nonisolated class RoomNotificationSettingsProxyMock: RoomNotificationSettingsProxyProtocol, @unchecked Sendable { var mode: RoomNotificationModeProxy { get { return underlyingMode } set(value) { underlyingMode = value } } - var underlyingMode: RoomNotificationModeProxy! + nonisolated(unsafe) var underlyingMode: RoomNotificationModeProxy! var isDefault: Bool { get { return underlyingIsDefault } set(value) { underlyingIsDefault = value } } - var underlyingIsDefault: Bool! + nonisolated(unsafe) var underlyingIsDefault: Bool! } -class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendable { +nonisolated class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendable { var values: RoomPowerLevelsValues { get { return underlyingValues } set(value) { underlyingValues = value } } - var underlyingValues: RoomPowerLevelsValues! - var userPowerLevels: [String: Int64] = [:] + nonisolated(unsafe) var underlyingValues: RoomPowerLevelsValues! + nonisolated(unsafe) var userPowerLevels: [String: Int64] = [:] //MARK: - canOwnUser private let canOwnUserSendMessageCallsCountLock = NSLock() - private var canOwnUserSendMessageUnderlyingCallsCount = 0 + private nonisolated(unsafe) var canOwnUserSendMessageUnderlyingCallsCount = 0 var canOwnUserSendMessageCallsCount: Int { get { canOwnUserSendMessageCallsCountLock.withLock { canOwnUserSendMessageUnderlyingCallsCount } } set { canOwnUserSendMessageCallsCountLock.withLock { canOwnUserSendMessageUnderlyingCallsCount = newValue } } @@ -9963,25 +9963,25 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl return canOwnUserSendMessageCallsCount > 0 } private let canOwnUserSendMessageReceivedMessageTypeLock = NSLock() - private var canOwnUserSendMessageUnderlyingReceivedMessageType: MessageLikeEventType? + private nonisolated(unsafe) var canOwnUserSendMessageUnderlyingReceivedMessageType: MessageLikeEventType? var canOwnUserSendMessageReceivedMessageType: MessageLikeEventType? { get { canOwnUserSendMessageReceivedMessageTypeLock.withLock { canOwnUserSendMessageUnderlyingReceivedMessageType } } set { canOwnUserSendMessageReceivedMessageTypeLock.withLock { canOwnUserSendMessageUnderlyingReceivedMessageType = newValue } } } private let canOwnUserSendMessageReceivedInvocationsLock = NSLock() - private var canOwnUserSendMessageUnderlyingReceivedInvocations: [MessageLikeEventType] = [] + private nonisolated(unsafe) var canOwnUserSendMessageUnderlyingReceivedInvocations: [MessageLikeEventType] = [] var canOwnUserSendMessageReceivedInvocations: [MessageLikeEventType] { get { canOwnUserSendMessageReceivedInvocationsLock.withLock { canOwnUserSendMessageUnderlyingReceivedInvocations } } set { canOwnUserSendMessageReceivedInvocationsLock.withLock { canOwnUserSendMessageUnderlyingReceivedInvocations = newValue } } } private let canOwnUserSendMessageReturnValueLock = NSLock() - private var canOwnUserSendMessageUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var canOwnUserSendMessageUnderlyingReturnValue: Bool! var canOwnUserSendMessageReturnValue: Bool! { get { canOwnUserSendMessageReturnValueLock.withLock { canOwnUserSendMessageUnderlyingReturnValue } } set { canOwnUserSendMessageReturnValueLock.withLock { canOwnUserSendMessageUnderlyingReturnValue = newValue } } } - var canOwnUserSendMessageClosure: ((MessageLikeEventType) -> Bool)? + nonisolated(unsafe) var canOwnUserSendMessageClosure: ((MessageLikeEventType) -> Bool)? func canOwnUser(sendMessage messageType: MessageLikeEventType) -> Bool { canOwnUserSendMessageCallsCountLock.withLock { canOwnUserSendMessageUnderlyingCallsCount += 1 } @@ -9996,7 +9996,7 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl //MARK: - canOwnUser private let canOwnUserSendStateEventCallsCountLock = NSLock() - private var canOwnUserSendStateEventUnderlyingCallsCount = 0 + private nonisolated(unsafe) var canOwnUserSendStateEventUnderlyingCallsCount = 0 var canOwnUserSendStateEventCallsCount: Int { get { canOwnUserSendStateEventCallsCountLock.withLock { canOwnUserSendStateEventUnderlyingCallsCount } } set { canOwnUserSendStateEventCallsCountLock.withLock { canOwnUserSendStateEventUnderlyingCallsCount = newValue } } @@ -10005,25 +10005,25 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl return canOwnUserSendStateEventCallsCount > 0 } private let canOwnUserSendStateEventReceivedEventLock = NSLock() - private var canOwnUserSendStateEventUnderlyingReceivedEvent: StateEventType? + private nonisolated(unsafe) var canOwnUserSendStateEventUnderlyingReceivedEvent: StateEventType? var canOwnUserSendStateEventReceivedEvent: StateEventType? { get { canOwnUserSendStateEventReceivedEventLock.withLock { canOwnUserSendStateEventUnderlyingReceivedEvent } } set { canOwnUserSendStateEventReceivedEventLock.withLock { canOwnUserSendStateEventUnderlyingReceivedEvent = newValue } } } private let canOwnUserSendStateEventReceivedInvocationsLock = NSLock() - private var canOwnUserSendStateEventUnderlyingReceivedInvocations: [StateEventType] = [] + private nonisolated(unsafe) var canOwnUserSendStateEventUnderlyingReceivedInvocations: [StateEventType] = [] var canOwnUserSendStateEventReceivedInvocations: [StateEventType] { get { canOwnUserSendStateEventReceivedInvocationsLock.withLock { canOwnUserSendStateEventUnderlyingReceivedInvocations } } set { canOwnUserSendStateEventReceivedInvocationsLock.withLock { canOwnUserSendStateEventUnderlyingReceivedInvocations = newValue } } } private let canOwnUserSendStateEventReturnValueLock = NSLock() - private var canOwnUserSendStateEventUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var canOwnUserSendStateEventUnderlyingReturnValue: Bool! var canOwnUserSendStateEventReturnValue: Bool! { get { canOwnUserSendStateEventReturnValueLock.withLock { canOwnUserSendStateEventUnderlyingReturnValue } } set { canOwnUserSendStateEventReturnValueLock.withLock { canOwnUserSendStateEventUnderlyingReturnValue = newValue } } } - var canOwnUserSendStateEventClosure: ((StateEventType) -> Bool)? + nonisolated(unsafe) var canOwnUserSendStateEventClosure: ((StateEventType) -> Bool)? func canOwnUser(sendStateEvent event: StateEventType) -> Bool { canOwnUserSendStateEventCallsCountLock.withLock { canOwnUserSendStateEventUnderlyingCallsCount += 1 } @@ -10038,7 +10038,7 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl //MARK: - canOwnUserInvite private let canOwnUserInviteCallsCountLock = NSLock() - private var canOwnUserInviteUnderlyingCallsCount = 0 + private nonisolated(unsafe) var canOwnUserInviteUnderlyingCallsCount = 0 var canOwnUserInviteCallsCount: Int { get { canOwnUserInviteCallsCountLock.withLock { canOwnUserInviteUnderlyingCallsCount } } set { canOwnUserInviteCallsCountLock.withLock { canOwnUserInviteUnderlyingCallsCount = newValue } } @@ -10048,12 +10048,12 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl } private let canOwnUserInviteReturnValueLock = NSLock() - private var canOwnUserInviteUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var canOwnUserInviteUnderlyingReturnValue: Bool! var canOwnUserInviteReturnValue: Bool! { get { canOwnUserInviteReturnValueLock.withLock { canOwnUserInviteUnderlyingReturnValue } } set { canOwnUserInviteReturnValueLock.withLock { canOwnUserInviteUnderlyingReturnValue = newValue } } } - var canOwnUserInviteClosure: (() -> Bool)? + nonisolated(unsafe) var canOwnUserInviteClosure: (() -> Bool)? func canOwnUserInvite() -> Bool { canOwnUserInviteCallsCountLock.withLock { canOwnUserInviteUnderlyingCallsCount += 1 } @@ -10066,7 +10066,7 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl //MARK: - canOwnUserRedactOther private let canOwnUserRedactOtherCallsCountLock = NSLock() - private var canOwnUserRedactOtherUnderlyingCallsCount = 0 + private nonisolated(unsafe) var canOwnUserRedactOtherUnderlyingCallsCount = 0 var canOwnUserRedactOtherCallsCount: Int { get { canOwnUserRedactOtherCallsCountLock.withLock { canOwnUserRedactOtherUnderlyingCallsCount } } set { canOwnUserRedactOtherCallsCountLock.withLock { canOwnUserRedactOtherUnderlyingCallsCount = newValue } } @@ -10076,12 +10076,12 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl } private let canOwnUserRedactOtherReturnValueLock = NSLock() - private var canOwnUserRedactOtherUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var canOwnUserRedactOtherUnderlyingReturnValue: Bool! var canOwnUserRedactOtherReturnValue: Bool! { get { canOwnUserRedactOtherReturnValueLock.withLock { canOwnUserRedactOtherUnderlyingReturnValue } } set { canOwnUserRedactOtherReturnValueLock.withLock { canOwnUserRedactOtherUnderlyingReturnValue = newValue } } } - var canOwnUserRedactOtherClosure: (() -> Bool)? + nonisolated(unsafe) var canOwnUserRedactOtherClosure: (() -> Bool)? func canOwnUserRedactOther() -> Bool { canOwnUserRedactOtherCallsCountLock.withLock { canOwnUserRedactOtherUnderlyingCallsCount += 1 } @@ -10094,7 +10094,7 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl //MARK: - canOwnUserRedactOwn private let canOwnUserRedactOwnCallsCountLock = NSLock() - private var canOwnUserRedactOwnUnderlyingCallsCount = 0 + private nonisolated(unsafe) var canOwnUserRedactOwnUnderlyingCallsCount = 0 var canOwnUserRedactOwnCallsCount: Int { get { canOwnUserRedactOwnCallsCountLock.withLock { canOwnUserRedactOwnUnderlyingCallsCount } } set { canOwnUserRedactOwnCallsCountLock.withLock { canOwnUserRedactOwnUnderlyingCallsCount = newValue } } @@ -10104,12 +10104,12 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl } private let canOwnUserRedactOwnReturnValueLock = NSLock() - private var canOwnUserRedactOwnUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var canOwnUserRedactOwnUnderlyingReturnValue: Bool! var canOwnUserRedactOwnReturnValue: Bool! { get { canOwnUserRedactOwnReturnValueLock.withLock { canOwnUserRedactOwnUnderlyingReturnValue } } set { canOwnUserRedactOwnReturnValueLock.withLock { canOwnUserRedactOwnUnderlyingReturnValue = newValue } } } - var canOwnUserRedactOwnClosure: (() -> Bool)? + nonisolated(unsafe) var canOwnUserRedactOwnClosure: (() -> Bool)? func canOwnUserRedactOwn() -> Bool { canOwnUserRedactOwnCallsCountLock.withLock { canOwnUserRedactOwnUnderlyingCallsCount += 1 } @@ -10122,7 +10122,7 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl //MARK: - canOwnUserKick private let canOwnUserKickCallsCountLock = NSLock() - private var canOwnUserKickUnderlyingCallsCount = 0 + private nonisolated(unsafe) var canOwnUserKickUnderlyingCallsCount = 0 var canOwnUserKickCallsCount: Int { get { canOwnUserKickCallsCountLock.withLock { canOwnUserKickUnderlyingCallsCount } } set { canOwnUserKickCallsCountLock.withLock { canOwnUserKickUnderlyingCallsCount = newValue } } @@ -10132,12 +10132,12 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl } private let canOwnUserKickReturnValueLock = NSLock() - private var canOwnUserKickUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var canOwnUserKickUnderlyingReturnValue: Bool! var canOwnUserKickReturnValue: Bool! { get { canOwnUserKickReturnValueLock.withLock { canOwnUserKickUnderlyingReturnValue } } set { canOwnUserKickReturnValueLock.withLock { canOwnUserKickUnderlyingReturnValue = newValue } } } - var canOwnUserKickClosure: (() -> Bool)? + nonisolated(unsafe) var canOwnUserKickClosure: (() -> Bool)? func canOwnUserKick() -> Bool { canOwnUserKickCallsCountLock.withLock { canOwnUserKickUnderlyingCallsCount += 1 } @@ -10150,7 +10150,7 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl //MARK: - canOwnUserBan private let canOwnUserBanCallsCountLock = NSLock() - private var canOwnUserBanUnderlyingCallsCount = 0 + private nonisolated(unsafe) var canOwnUserBanUnderlyingCallsCount = 0 var canOwnUserBanCallsCount: Int { get { canOwnUserBanCallsCountLock.withLock { canOwnUserBanUnderlyingCallsCount } } set { canOwnUserBanCallsCountLock.withLock { canOwnUserBanUnderlyingCallsCount = newValue } } @@ -10160,12 +10160,12 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl } private let canOwnUserBanReturnValueLock = NSLock() - private var canOwnUserBanUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var canOwnUserBanUnderlyingReturnValue: Bool! var canOwnUserBanReturnValue: Bool! { get { canOwnUserBanReturnValueLock.withLock { canOwnUserBanUnderlyingReturnValue } } set { canOwnUserBanReturnValueLock.withLock { canOwnUserBanUnderlyingReturnValue = newValue } } } - var canOwnUserBanClosure: (() -> Bool)? + nonisolated(unsafe) var canOwnUserBanClosure: (() -> Bool)? func canOwnUserBan() -> Bool { canOwnUserBanCallsCountLock.withLock { canOwnUserBanUnderlyingCallsCount += 1 } @@ -10178,7 +10178,7 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl //MARK: - canOwnUserTriggerRoomNotification private let canOwnUserTriggerRoomNotificationCallsCountLock = NSLock() - private var canOwnUserTriggerRoomNotificationUnderlyingCallsCount = 0 + private nonisolated(unsafe) var canOwnUserTriggerRoomNotificationUnderlyingCallsCount = 0 var canOwnUserTriggerRoomNotificationCallsCount: Int { get { canOwnUserTriggerRoomNotificationCallsCountLock.withLock { canOwnUserTriggerRoomNotificationUnderlyingCallsCount } } set { canOwnUserTriggerRoomNotificationCallsCountLock.withLock { canOwnUserTriggerRoomNotificationUnderlyingCallsCount = newValue } } @@ -10188,12 +10188,12 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl } private let canOwnUserTriggerRoomNotificationReturnValueLock = NSLock() - private var canOwnUserTriggerRoomNotificationUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var canOwnUserTriggerRoomNotificationUnderlyingReturnValue: Bool! var canOwnUserTriggerRoomNotificationReturnValue: Bool! { get { canOwnUserTriggerRoomNotificationReturnValueLock.withLock { canOwnUserTriggerRoomNotificationUnderlyingReturnValue } } set { canOwnUserTriggerRoomNotificationReturnValueLock.withLock { canOwnUserTriggerRoomNotificationUnderlyingReturnValue = newValue } } } - var canOwnUserTriggerRoomNotificationClosure: (() -> Bool)? + nonisolated(unsafe) var canOwnUserTriggerRoomNotificationClosure: (() -> Bool)? func canOwnUserTriggerRoomNotification() -> Bool { canOwnUserTriggerRoomNotificationCallsCountLock.withLock { canOwnUserTriggerRoomNotificationUnderlyingCallsCount += 1 } @@ -10206,7 +10206,7 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl //MARK: - canOwnUserPinOrUnpin private let canOwnUserPinOrUnpinCallsCountLock = NSLock() - private var canOwnUserPinOrUnpinUnderlyingCallsCount = 0 + private nonisolated(unsafe) var canOwnUserPinOrUnpinUnderlyingCallsCount = 0 var canOwnUserPinOrUnpinCallsCount: Int { get { canOwnUserPinOrUnpinCallsCountLock.withLock { canOwnUserPinOrUnpinUnderlyingCallsCount } } set { canOwnUserPinOrUnpinCallsCountLock.withLock { canOwnUserPinOrUnpinUnderlyingCallsCount = newValue } } @@ -10216,12 +10216,12 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl } private let canOwnUserPinOrUnpinReturnValueLock = NSLock() - private var canOwnUserPinOrUnpinUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var canOwnUserPinOrUnpinUnderlyingReturnValue: Bool! var canOwnUserPinOrUnpinReturnValue: Bool! { get { canOwnUserPinOrUnpinReturnValueLock.withLock { canOwnUserPinOrUnpinUnderlyingReturnValue } } set { canOwnUserPinOrUnpinReturnValueLock.withLock { canOwnUserPinOrUnpinUnderlyingReturnValue = newValue } } } - var canOwnUserPinOrUnpinClosure: (() -> Bool)? + nonisolated(unsafe) var canOwnUserPinOrUnpinClosure: (() -> Bool)? func canOwnUserPinOrUnpin() -> Bool { canOwnUserPinOrUnpinCallsCountLock.withLock { canOwnUserPinOrUnpinUnderlyingCallsCount += 1 } @@ -10234,7 +10234,7 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl //MARK: - canOwnUserJoinCall private let canOwnUserJoinCallCallsCountLock = NSLock() - private var canOwnUserJoinCallUnderlyingCallsCount = 0 + private nonisolated(unsafe) var canOwnUserJoinCallUnderlyingCallsCount = 0 var canOwnUserJoinCallCallsCount: Int { get { canOwnUserJoinCallCallsCountLock.withLock { canOwnUserJoinCallUnderlyingCallsCount } } set { canOwnUserJoinCallCallsCountLock.withLock { canOwnUserJoinCallUnderlyingCallsCount = newValue } } @@ -10244,12 +10244,12 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl } private let canOwnUserJoinCallReturnValueLock = NSLock() - private var canOwnUserJoinCallUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var canOwnUserJoinCallUnderlyingReturnValue: Bool! var canOwnUserJoinCallReturnValue: Bool! { get { canOwnUserJoinCallReturnValueLock.withLock { canOwnUserJoinCallUnderlyingReturnValue } } set { canOwnUserJoinCallReturnValueLock.withLock { canOwnUserJoinCallUnderlyingReturnValue = newValue } } } - var canOwnUserJoinCallClosure: (() -> Bool)? + nonisolated(unsafe) var canOwnUserJoinCallClosure: (() -> Bool)? func canOwnUserJoinCall() -> Bool { canOwnUserJoinCallCallsCountLock.withLock { canOwnUserJoinCallUnderlyingCallsCount += 1 } @@ -10262,7 +10262,7 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl //MARK: - canOwnUserEditRolesAndPermissions private let canOwnUserEditRolesAndPermissionsCallsCountLock = NSLock() - private var canOwnUserEditRolesAndPermissionsUnderlyingCallsCount = 0 + private nonisolated(unsafe) var canOwnUserEditRolesAndPermissionsUnderlyingCallsCount = 0 var canOwnUserEditRolesAndPermissionsCallsCount: Int { get { canOwnUserEditRolesAndPermissionsCallsCountLock.withLock { canOwnUserEditRolesAndPermissionsUnderlyingCallsCount } } set { canOwnUserEditRolesAndPermissionsCallsCountLock.withLock { canOwnUserEditRolesAndPermissionsUnderlyingCallsCount = newValue } } @@ -10272,12 +10272,12 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl } private let canOwnUserEditRolesAndPermissionsReturnValueLock = NSLock() - private var canOwnUserEditRolesAndPermissionsUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var canOwnUserEditRolesAndPermissionsUnderlyingReturnValue: Bool! var canOwnUserEditRolesAndPermissionsReturnValue: Bool! { get { canOwnUserEditRolesAndPermissionsReturnValueLock.withLock { canOwnUserEditRolesAndPermissionsUnderlyingReturnValue } } set { canOwnUserEditRolesAndPermissionsReturnValueLock.withLock { canOwnUserEditRolesAndPermissionsUnderlyingReturnValue = newValue } } } - var canOwnUserEditRolesAndPermissionsClosure: (() -> Bool)? + nonisolated(unsafe) var canOwnUserEditRolesAndPermissionsClosure: (() -> Bool)? func canOwnUserEditRolesAndPermissions() -> Bool { canOwnUserEditRolesAndPermissionsCallsCountLock.withLock { canOwnUserEditRolesAndPermissionsUnderlyingCallsCount += 1 } @@ -10290,7 +10290,7 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl //MARK: - canUser private let canUserUserIDSendMessageCallsCountLock = NSLock() - private var canUserUserIDSendMessageUnderlyingCallsCount = 0 + private nonisolated(unsafe) var canUserUserIDSendMessageUnderlyingCallsCount = 0 var canUserUserIDSendMessageCallsCount: Int { get { canUserUserIDSendMessageCallsCountLock.withLock { canUserUserIDSendMessageUnderlyingCallsCount } } set { canUserUserIDSendMessageCallsCountLock.withLock { canUserUserIDSendMessageUnderlyingCallsCount = newValue } } @@ -10299,25 +10299,25 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl return canUserUserIDSendMessageCallsCount > 0 } private let canUserUserIDSendMessageReceivedArgumentsLock = NSLock() - private var canUserUserIDSendMessageUnderlyingReceivedArguments: (userID: String, messageType: MessageLikeEventType)? + private nonisolated(unsafe) var canUserUserIDSendMessageUnderlyingReceivedArguments: (userID: String, messageType: MessageLikeEventType)? var canUserUserIDSendMessageReceivedArguments: (userID: String, messageType: MessageLikeEventType)? { get { canUserUserIDSendMessageReceivedArgumentsLock.withLock { canUserUserIDSendMessageUnderlyingReceivedArguments } } set { canUserUserIDSendMessageReceivedArgumentsLock.withLock { canUserUserIDSendMessageUnderlyingReceivedArguments = newValue } } } private let canUserUserIDSendMessageReceivedInvocationsLock = NSLock() - private var canUserUserIDSendMessageUnderlyingReceivedInvocations: [(userID: String, messageType: MessageLikeEventType)] = [] + private nonisolated(unsafe) var canUserUserIDSendMessageUnderlyingReceivedInvocations: [(userID: String, messageType: MessageLikeEventType)] = [] var canUserUserIDSendMessageReceivedInvocations: [(userID: String, messageType: MessageLikeEventType)] { get { canUserUserIDSendMessageReceivedInvocationsLock.withLock { canUserUserIDSendMessageUnderlyingReceivedInvocations } } set { canUserUserIDSendMessageReceivedInvocationsLock.withLock { canUserUserIDSendMessageUnderlyingReceivedInvocations = newValue } } } private let canUserUserIDSendMessageReturnValueLock = NSLock() - private var canUserUserIDSendMessageUnderlyingReturnValue: Result! + private nonisolated(unsafe) var canUserUserIDSendMessageUnderlyingReturnValue: Result! var canUserUserIDSendMessageReturnValue: Result! { get { canUserUserIDSendMessageReturnValueLock.withLock { canUserUserIDSendMessageUnderlyingReturnValue } } set { canUserUserIDSendMessageReturnValueLock.withLock { canUserUserIDSendMessageUnderlyingReturnValue = newValue } } } - var canUserUserIDSendMessageClosure: ((String, MessageLikeEventType) -> Result)? + nonisolated(unsafe) var canUserUserIDSendMessageClosure: ((String, MessageLikeEventType) -> Result)? func canUser(userID: String, sendMessage messageType: MessageLikeEventType) -> Result { canUserUserIDSendMessageCallsCountLock.withLock { canUserUserIDSendMessageUnderlyingCallsCount += 1 } @@ -10332,7 +10332,7 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl //MARK: - canUser private let canUserUserIDSendStateEventCallsCountLock = NSLock() - private var canUserUserIDSendStateEventUnderlyingCallsCount = 0 + private nonisolated(unsafe) var canUserUserIDSendStateEventUnderlyingCallsCount = 0 var canUserUserIDSendStateEventCallsCount: Int { get { canUserUserIDSendStateEventCallsCountLock.withLock { canUserUserIDSendStateEventUnderlyingCallsCount } } set { canUserUserIDSendStateEventCallsCountLock.withLock { canUserUserIDSendStateEventUnderlyingCallsCount = newValue } } @@ -10341,25 +10341,25 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl return canUserUserIDSendStateEventCallsCount > 0 } private let canUserUserIDSendStateEventReceivedArgumentsLock = NSLock() - private var canUserUserIDSendStateEventUnderlyingReceivedArguments: (userID: String, event: StateEventType)? + private nonisolated(unsafe) var canUserUserIDSendStateEventUnderlyingReceivedArguments: (userID: String, event: StateEventType)? var canUserUserIDSendStateEventReceivedArguments: (userID: String, event: StateEventType)? { get { canUserUserIDSendStateEventReceivedArgumentsLock.withLock { canUserUserIDSendStateEventUnderlyingReceivedArguments } } set { canUserUserIDSendStateEventReceivedArgumentsLock.withLock { canUserUserIDSendStateEventUnderlyingReceivedArguments = newValue } } } private let canUserUserIDSendStateEventReceivedInvocationsLock = NSLock() - private var canUserUserIDSendStateEventUnderlyingReceivedInvocations: [(userID: String, event: StateEventType)] = [] + private nonisolated(unsafe) var canUserUserIDSendStateEventUnderlyingReceivedInvocations: [(userID: String, event: StateEventType)] = [] var canUserUserIDSendStateEventReceivedInvocations: [(userID: String, event: StateEventType)] { get { canUserUserIDSendStateEventReceivedInvocationsLock.withLock { canUserUserIDSendStateEventUnderlyingReceivedInvocations } } set { canUserUserIDSendStateEventReceivedInvocationsLock.withLock { canUserUserIDSendStateEventUnderlyingReceivedInvocations = newValue } } } private let canUserUserIDSendStateEventReturnValueLock = NSLock() - private var canUserUserIDSendStateEventUnderlyingReturnValue: Result! + private nonisolated(unsafe) var canUserUserIDSendStateEventUnderlyingReturnValue: Result! var canUserUserIDSendStateEventReturnValue: Result! { get { canUserUserIDSendStateEventReturnValueLock.withLock { canUserUserIDSendStateEventUnderlyingReturnValue } } set { canUserUserIDSendStateEventReturnValueLock.withLock { canUserUserIDSendStateEventUnderlyingReturnValue = newValue } } } - var canUserUserIDSendStateEventClosure: ((String, StateEventType) -> Result)? + nonisolated(unsafe) var canUserUserIDSendStateEventClosure: ((String, StateEventType) -> Result)? func canUser(userID: String, sendStateEvent event: StateEventType) -> Result { canUserUserIDSendStateEventCallsCountLock.withLock { canUserUserIDSendStateEventUnderlyingCallsCount += 1 } @@ -10374,7 +10374,7 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl //MARK: - canUserInvite private let canUserInviteUserIDCallsCountLock = NSLock() - private var canUserInviteUserIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var canUserInviteUserIDUnderlyingCallsCount = 0 var canUserInviteUserIDCallsCount: Int { get { canUserInviteUserIDCallsCountLock.withLock { canUserInviteUserIDUnderlyingCallsCount } } set { canUserInviteUserIDCallsCountLock.withLock { canUserInviteUserIDUnderlyingCallsCount = newValue } } @@ -10383,25 +10383,25 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl return canUserInviteUserIDCallsCount > 0 } private let canUserInviteUserIDReceivedUserIDLock = NSLock() - private var canUserInviteUserIDUnderlyingReceivedUserID: String? + private nonisolated(unsafe) var canUserInviteUserIDUnderlyingReceivedUserID: String? var canUserInviteUserIDReceivedUserID: String? { get { canUserInviteUserIDReceivedUserIDLock.withLock { canUserInviteUserIDUnderlyingReceivedUserID } } set { canUserInviteUserIDReceivedUserIDLock.withLock { canUserInviteUserIDUnderlyingReceivedUserID = newValue } } } private let canUserInviteUserIDReceivedInvocationsLock = NSLock() - private var canUserInviteUserIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var canUserInviteUserIDUnderlyingReceivedInvocations: [String] = [] var canUserInviteUserIDReceivedInvocations: [String] { get { canUserInviteUserIDReceivedInvocationsLock.withLock { canUserInviteUserIDUnderlyingReceivedInvocations } } set { canUserInviteUserIDReceivedInvocationsLock.withLock { canUserInviteUserIDUnderlyingReceivedInvocations = newValue } } } private let canUserInviteUserIDReturnValueLock = NSLock() - private var canUserInviteUserIDUnderlyingReturnValue: Result! + private nonisolated(unsafe) var canUserInviteUserIDUnderlyingReturnValue: Result! var canUserInviteUserIDReturnValue: Result! { get { canUserInviteUserIDReturnValueLock.withLock { canUserInviteUserIDUnderlyingReturnValue } } set { canUserInviteUserIDReturnValueLock.withLock { canUserInviteUserIDUnderlyingReturnValue = newValue } } } - var canUserInviteUserIDClosure: ((String) -> Result)? + nonisolated(unsafe) var canUserInviteUserIDClosure: ((String) -> Result)? func canUserInvite(userID: String) -> Result { canUserInviteUserIDCallsCountLock.withLock { canUserInviteUserIDUnderlyingCallsCount += 1 } @@ -10416,7 +10416,7 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl //MARK: - canUserRedactOther private let canUserRedactOtherUserIDCallsCountLock = NSLock() - private var canUserRedactOtherUserIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var canUserRedactOtherUserIDUnderlyingCallsCount = 0 var canUserRedactOtherUserIDCallsCount: Int { get { canUserRedactOtherUserIDCallsCountLock.withLock { canUserRedactOtherUserIDUnderlyingCallsCount } } set { canUserRedactOtherUserIDCallsCountLock.withLock { canUserRedactOtherUserIDUnderlyingCallsCount = newValue } } @@ -10425,25 +10425,25 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl return canUserRedactOtherUserIDCallsCount > 0 } private let canUserRedactOtherUserIDReceivedUserIDLock = NSLock() - private var canUserRedactOtherUserIDUnderlyingReceivedUserID: String? + private nonisolated(unsafe) var canUserRedactOtherUserIDUnderlyingReceivedUserID: String? var canUserRedactOtherUserIDReceivedUserID: String? { get { canUserRedactOtherUserIDReceivedUserIDLock.withLock { canUserRedactOtherUserIDUnderlyingReceivedUserID } } set { canUserRedactOtherUserIDReceivedUserIDLock.withLock { canUserRedactOtherUserIDUnderlyingReceivedUserID = newValue } } } private let canUserRedactOtherUserIDReceivedInvocationsLock = NSLock() - private var canUserRedactOtherUserIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var canUserRedactOtherUserIDUnderlyingReceivedInvocations: [String] = [] var canUserRedactOtherUserIDReceivedInvocations: [String] { get { canUserRedactOtherUserIDReceivedInvocationsLock.withLock { canUserRedactOtherUserIDUnderlyingReceivedInvocations } } set { canUserRedactOtherUserIDReceivedInvocationsLock.withLock { canUserRedactOtherUserIDUnderlyingReceivedInvocations = newValue } } } private let canUserRedactOtherUserIDReturnValueLock = NSLock() - private var canUserRedactOtherUserIDUnderlyingReturnValue: Result! + private nonisolated(unsafe) var canUserRedactOtherUserIDUnderlyingReturnValue: Result! var canUserRedactOtherUserIDReturnValue: Result! { get { canUserRedactOtherUserIDReturnValueLock.withLock { canUserRedactOtherUserIDUnderlyingReturnValue } } set { canUserRedactOtherUserIDReturnValueLock.withLock { canUserRedactOtherUserIDUnderlyingReturnValue = newValue } } } - var canUserRedactOtherUserIDClosure: ((String) -> Result)? + nonisolated(unsafe) var canUserRedactOtherUserIDClosure: ((String) -> Result)? func canUserRedactOther(userID: String) -> Result { canUserRedactOtherUserIDCallsCountLock.withLock { canUserRedactOtherUserIDUnderlyingCallsCount += 1 } @@ -10458,7 +10458,7 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl //MARK: - canUserRedactOwn private let canUserRedactOwnUserIDCallsCountLock = NSLock() - private var canUserRedactOwnUserIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var canUserRedactOwnUserIDUnderlyingCallsCount = 0 var canUserRedactOwnUserIDCallsCount: Int { get { canUserRedactOwnUserIDCallsCountLock.withLock { canUserRedactOwnUserIDUnderlyingCallsCount } } set { canUserRedactOwnUserIDCallsCountLock.withLock { canUserRedactOwnUserIDUnderlyingCallsCount = newValue } } @@ -10467,25 +10467,25 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl return canUserRedactOwnUserIDCallsCount > 0 } private let canUserRedactOwnUserIDReceivedUserIDLock = NSLock() - private var canUserRedactOwnUserIDUnderlyingReceivedUserID: String? + private nonisolated(unsafe) var canUserRedactOwnUserIDUnderlyingReceivedUserID: String? var canUserRedactOwnUserIDReceivedUserID: String? { get { canUserRedactOwnUserIDReceivedUserIDLock.withLock { canUserRedactOwnUserIDUnderlyingReceivedUserID } } set { canUserRedactOwnUserIDReceivedUserIDLock.withLock { canUserRedactOwnUserIDUnderlyingReceivedUserID = newValue } } } private let canUserRedactOwnUserIDReceivedInvocationsLock = NSLock() - private var canUserRedactOwnUserIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var canUserRedactOwnUserIDUnderlyingReceivedInvocations: [String] = [] var canUserRedactOwnUserIDReceivedInvocations: [String] { get { canUserRedactOwnUserIDReceivedInvocationsLock.withLock { canUserRedactOwnUserIDUnderlyingReceivedInvocations } } set { canUserRedactOwnUserIDReceivedInvocationsLock.withLock { canUserRedactOwnUserIDUnderlyingReceivedInvocations = newValue } } } private let canUserRedactOwnUserIDReturnValueLock = NSLock() - private var canUserRedactOwnUserIDUnderlyingReturnValue: Result! + private nonisolated(unsafe) var canUserRedactOwnUserIDUnderlyingReturnValue: Result! var canUserRedactOwnUserIDReturnValue: Result! { get { canUserRedactOwnUserIDReturnValueLock.withLock { canUserRedactOwnUserIDUnderlyingReturnValue } } set { canUserRedactOwnUserIDReturnValueLock.withLock { canUserRedactOwnUserIDUnderlyingReturnValue = newValue } } } - var canUserRedactOwnUserIDClosure: ((String) -> Result)? + nonisolated(unsafe) var canUserRedactOwnUserIDClosure: ((String) -> Result)? func canUserRedactOwn(userID: String) -> Result { canUserRedactOwnUserIDCallsCountLock.withLock { canUserRedactOwnUserIDUnderlyingCallsCount += 1 } @@ -10500,7 +10500,7 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl //MARK: - canUserKick private let canUserKickUserIDCallsCountLock = NSLock() - private var canUserKickUserIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var canUserKickUserIDUnderlyingCallsCount = 0 var canUserKickUserIDCallsCount: Int { get { canUserKickUserIDCallsCountLock.withLock { canUserKickUserIDUnderlyingCallsCount } } set { canUserKickUserIDCallsCountLock.withLock { canUserKickUserIDUnderlyingCallsCount = newValue } } @@ -10509,25 +10509,25 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl return canUserKickUserIDCallsCount > 0 } private let canUserKickUserIDReceivedUserIDLock = NSLock() - private var canUserKickUserIDUnderlyingReceivedUserID: String? + private nonisolated(unsafe) var canUserKickUserIDUnderlyingReceivedUserID: String? var canUserKickUserIDReceivedUserID: String? { get { canUserKickUserIDReceivedUserIDLock.withLock { canUserKickUserIDUnderlyingReceivedUserID } } set { canUserKickUserIDReceivedUserIDLock.withLock { canUserKickUserIDUnderlyingReceivedUserID = newValue } } } private let canUserKickUserIDReceivedInvocationsLock = NSLock() - private var canUserKickUserIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var canUserKickUserIDUnderlyingReceivedInvocations: [String] = [] var canUserKickUserIDReceivedInvocations: [String] { get { canUserKickUserIDReceivedInvocationsLock.withLock { canUserKickUserIDUnderlyingReceivedInvocations } } set { canUserKickUserIDReceivedInvocationsLock.withLock { canUserKickUserIDUnderlyingReceivedInvocations = newValue } } } private let canUserKickUserIDReturnValueLock = NSLock() - private var canUserKickUserIDUnderlyingReturnValue: Result! + private nonisolated(unsafe) var canUserKickUserIDUnderlyingReturnValue: Result! var canUserKickUserIDReturnValue: Result! { get { canUserKickUserIDReturnValueLock.withLock { canUserKickUserIDUnderlyingReturnValue } } set { canUserKickUserIDReturnValueLock.withLock { canUserKickUserIDUnderlyingReturnValue = newValue } } } - var canUserKickUserIDClosure: ((String) -> Result)? + nonisolated(unsafe) var canUserKickUserIDClosure: ((String) -> Result)? func canUserKick(userID: String) -> Result { canUserKickUserIDCallsCountLock.withLock { canUserKickUserIDUnderlyingCallsCount += 1 } @@ -10542,7 +10542,7 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl //MARK: - canUserBan private let canUserBanUserIDCallsCountLock = NSLock() - private var canUserBanUserIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var canUserBanUserIDUnderlyingCallsCount = 0 var canUserBanUserIDCallsCount: Int { get { canUserBanUserIDCallsCountLock.withLock { canUserBanUserIDUnderlyingCallsCount } } set { canUserBanUserIDCallsCountLock.withLock { canUserBanUserIDUnderlyingCallsCount = newValue } } @@ -10551,25 +10551,25 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl return canUserBanUserIDCallsCount > 0 } private let canUserBanUserIDReceivedUserIDLock = NSLock() - private var canUserBanUserIDUnderlyingReceivedUserID: String? + private nonisolated(unsafe) var canUserBanUserIDUnderlyingReceivedUserID: String? var canUserBanUserIDReceivedUserID: String? { get { canUserBanUserIDReceivedUserIDLock.withLock { canUserBanUserIDUnderlyingReceivedUserID } } set { canUserBanUserIDReceivedUserIDLock.withLock { canUserBanUserIDUnderlyingReceivedUserID = newValue } } } private let canUserBanUserIDReceivedInvocationsLock = NSLock() - private var canUserBanUserIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var canUserBanUserIDUnderlyingReceivedInvocations: [String] = [] var canUserBanUserIDReceivedInvocations: [String] { get { canUserBanUserIDReceivedInvocationsLock.withLock { canUserBanUserIDUnderlyingReceivedInvocations } } set { canUserBanUserIDReceivedInvocationsLock.withLock { canUserBanUserIDUnderlyingReceivedInvocations = newValue } } } private let canUserBanUserIDReturnValueLock = NSLock() - private var canUserBanUserIDUnderlyingReturnValue: Result! + private nonisolated(unsafe) var canUserBanUserIDUnderlyingReturnValue: Result! var canUserBanUserIDReturnValue: Result! { get { canUserBanUserIDReturnValueLock.withLock { canUserBanUserIDUnderlyingReturnValue } } set { canUserBanUserIDReturnValueLock.withLock { canUserBanUserIDUnderlyingReturnValue = newValue } } } - var canUserBanUserIDClosure: ((String) -> Result)? + nonisolated(unsafe) var canUserBanUserIDClosure: ((String) -> Result)? func canUserBan(userID: String) -> Result { canUserBanUserIDCallsCountLock.withLock { canUserBanUserIDUnderlyingCallsCount += 1 } @@ -10584,7 +10584,7 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl //MARK: - canUserTriggerRoomNotification private let canUserTriggerRoomNotificationUserIDCallsCountLock = NSLock() - private var canUserTriggerRoomNotificationUserIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var canUserTriggerRoomNotificationUserIDUnderlyingCallsCount = 0 var canUserTriggerRoomNotificationUserIDCallsCount: Int { get { canUserTriggerRoomNotificationUserIDCallsCountLock.withLock { canUserTriggerRoomNotificationUserIDUnderlyingCallsCount } } set { canUserTriggerRoomNotificationUserIDCallsCountLock.withLock { canUserTriggerRoomNotificationUserIDUnderlyingCallsCount = newValue } } @@ -10593,25 +10593,25 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl return canUserTriggerRoomNotificationUserIDCallsCount > 0 } private let canUserTriggerRoomNotificationUserIDReceivedUserIDLock = NSLock() - private var canUserTriggerRoomNotificationUserIDUnderlyingReceivedUserID: String? + private nonisolated(unsafe) var canUserTriggerRoomNotificationUserIDUnderlyingReceivedUserID: String? var canUserTriggerRoomNotificationUserIDReceivedUserID: String? { get { canUserTriggerRoomNotificationUserIDReceivedUserIDLock.withLock { canUserTriggerRoomNotificationUserIDUnderlyingReceivedUserID } } set { canUserTriggerRoomNotificationUserIDReceivedUserIDLock.withLock { canUserTriggerRoomNotificationUserIDUnderlyingReceivedUserID = newValue } } } private let canUserTriggerRoomNotificationUserIDReceivedInvocationsLock = NSLock() - private var canUserTriggerRoomNotificationUserIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var canUserTriggerRoomNotificationUserIDUnderlyingReceivedInvocations: [String] = [] var canUserTriggerRoomNotificationUserIDReceivedInvocations: [String] { get { canUserTriggerRoomNotificationUserIDReceivedInvocationsLock.withLock { canUserTriggerRoomNotificationUserIDUnderlyingReceivedInvocations } } set { canUserTriggerRoomNotificationUserIDReceivedInvocationsLock.withLock { canUserTriggerRoomNotificationUserIDUnderlyingReceivedInvocations = newValue } } } private let canUserTriggerRoomNotificationUserIDReturnValueLock = NSLock() - private var canUserTriggerRoomNotificationUserIDUnderlyingReturnValue: Result! + private nonisolated(unsafe) var canUserTriggerRoomNotificationUserIDUnderlyingReturnValue: Result! var canUserTriggerRoomNotificationUserIDReturnValue: Result! { get { canUserTriggerRoomNotificationUserIDReturnValueLock.withLock { canUserTriggerRoomNotificationUserIDUnderlyingReturnValue } } set { canUserTriggerRoomNotificationUserIDReturnValueLock.withLock { canUserTriggerRoomNotificationUserIDUnderlyingReturnValue = newValue } } } - var canUserTriggerRoomNotificationUserIDClosure: ((String) -> Result)? + nonisolated(unsafe) var canUserTriggerRoomNotificationUserIDClosure: ((String) -> Result)? func canUserTriggerRoomNotification(userID: String) -> Result { canUserTriggerRoomNotificationUserIDCallsCountLock.withLock { canUserTriggerRoomNotificationUserIDUnderlyingCallsCount += 1 } @@ -10626,7 +10626,7 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl //MARK: - canUserPinOrUnpin private let canUserPinOrUnpinUserIDCallsCountLock = NSLock() - private var canUserPinOrUnpinUserIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var canUserPinOrUnpinUserIDUnderlyingCallsCount = 0 var canUserPinOrUnpinUserIDCallsCount: Int { get { canUserPinOrUnpinUserIDCallsCountLock.withLock { canUserPinOrUnpinUserIDUnderlyingCallsCount } } set { canUserPinOrUnpinUserIDCallsCountLock.withLock { canUserPinOrUnpinUserIDUnderlyingCallsCount = newValue } } @@ -10635,25 +10635,25 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl return canUserPinOrUnpinUserIDCallsCount > 0 } private let canUserPinOrUnpinUserIDReceivedUserIDLock = NSLock() - private var canUserPinOrUnpinUserIDUnderlyingReceivedUserID: String? + private nonisolated(unsafe) var canUserPinOrUnpinUserIDUnderlyingReceivedUserID: String? var canUserPinOrUnpinUserIDReceivedUserID: String? { get { canUserPinOrUnpinUserIDReceivedUserIDLock.withLock { canUserPinOrUnpinUserIDUnderlyingReceivedUserID } } set { canUserPinOrUnpinUserIDReceivedUserIDLock.withLock { canUserPinOrUnpinUserIDUnderlyingReceivedUserID = newValue } } } private let canUserPinOrUnpinUserIDReceivedInvocationsLock = NSLock() - private var canUserPinOrUnpinUserIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var canUserPinOrUnpinUserIDUnderlyingReceivedInvocations: [String] = [] var canUserPinOrUnpinUserIDReceivedInvocations: [String] { get { canUserPinOrUnpinUserIDReceivedInvocationsLock.withLock { canUserPinOrUnpinUserIDUnderlyingReceivedInvocations } } set { canUserPinOrUnpinUserIDReceivedInvocationsLock.withLock { canUserPinOrUnpinUserIDUnderlyingReceivedInvocations = newValue } } } private let canUserPinOrUnpinUserIDReturnValueLock = NSLock() - private var canUserPinOrUnpinUserIDUnderlyingReturnValue: Result! + private nonisolated(unsafe) var canUserPinOrUnpinUserIDUnderlyingReturnValue: Result! var canUserPinOrUnpinUserIDReturnValue: Result! { get { canUserPinOrUnpinUserIDReturnValueLock.withLock { canUserPinOrUnpinUserIDUnderlyingReturnValue } } set { canUserPinOrUnpinUserIDReturnValueLock.withLock { canUserPinOrUnpinUserIDUnderlyingReturnValue = newValue } } } - var canUserPinOrUnpinUserIDClosure: ((String) -> Result)? + nonisolated(unsafe) var canUserPinOrUnpinUserIDClosure: ((String) -> Result)? func canUserPinOrUnpin(userID: String) -> Result { canUserPinOrUnpinUserIDCallsCountLock.withLock { canUserPinOrUnpinUserIDUnderlyingCallsCount += 1 } @@ -10668,7 +10668,7 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl //MARK: - canUserJoinCall private let canUserJoinCallUserIDCallsCountLock = NSLock() - private var canUserJoinCallUserIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var canUserJoinCallUserIDUnderlyingCallsCount = 0 var canUserJoinCallUserIDCallsCount: Int { get { canUserJoinCallUserIDCallsCountLock.withLock { canUserJoinCallUserIDUnderlyingCallsCount } } set { canUserJoinCallUserIDCallsCountLock.withLock { canUserJoinCallUserIDUnderlyingCallsCount = newValue } } @@ -10677,25 +10677,25 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl return canUserJoinCallUserIDCallsCount > 0 } private let canUserJoinCallUserIDReceivedUserIDLock = NSLock() - private var canUserJoinCallUserIDUnderlyingReceivedUserID: String? + private nonisolated(unsafe) var canUserJoinCallUserIDUnderlyingReceivedUserID: String? var canUserJoinCallUserIDReceivedUserID: String? { get { canUserJoinCallUserIDReceivedUserIDLock.withLock { canUserJoinCallUserIDUnderlyingReceivedUserID } } set { canUserJoinCallUserIDReceivedUserIDLock.withLock { canUserJoinCallUserIDUnderlyingReceivedUserID = newValue } } } private let canUserJoinCallUserIDReceivedInvocationsLock = NSLock() - private var canUserJoinCallUserIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var canUserJoinCallUserIDUnderlyingReceivedInvocations: [String] = [] var canUserJoinCallUserIDReceivedInvocations: [String] { get { canUserJoinCallUserIDReceivedInvocationsLock.withLock { canUserJoinCallUserIDUnderlyingReceivedInvocations } } set { canUserJoinCallUserIDReceivedInvocationsLock.withLock { canUserJoinCallUserIDUnderlyingReceivedInvocations = newValue } } } private let canUserJoinCallUserIDReturnValueLock = NSLock() - private var canUserJoinCallUserIDUnderlyingReturnValue: Result! + private nonisolated(unsafe) var canUserJoinCallUserIDUnderlyingReturnValue: Result! var canUserJoinCallUserIDReturnValue: Result! { get { canUserJoinCallUserIDReturnValueLock.withLock { canUserJoinCallUserIDUnderlyingReturnValue } } set { canUserJoinCallUserIDReturnValueLock.withLock { canUserJoinCallUserIDUnderlyingReturnValue = newValue } } } - var canUserJoinCallUserIDClosure: ((String) -> Result)? + nonisolated(unsafe) var canUserJoinCallUserIDClosure: ((String) -> Result)? func canUserJoinCall(userID: String) -> Result { canUserJoinCallUserIDCallsCountLock.withLock { canUserJoinCallUserIDUnderlyingCallsCount += 1 } @@ -10708,13 +10708,13 @@ class RoomPowerLevelsProxyMock: RoomPowerLevelsProxyProtocol, @unchecked Sendabl } } } -class RoomPreviewProxyMock: RoomPreviewProxyProtocol, @unchecked Sendable { +nonisolated class RoomPreviewProxyMock: RoomPreviewProxyProtocol, @unchecked Sendable { var info: RoomPreviewInfoProxy { get { return underlyingInfo } set(value) { underlyingInfo = value } } - var underlyingInfo: RoomPreviewInfoProxy! - var ownMembershipDetailsCallsCount = 0 + nonisolated(unsafe) var underlyingInfo: RoomPreviewInfoProxy! + nonisolated(unsafe) var ownMembershipDetailsCallsCount = 0 var ownMembershipDetailsCalled: Bool { return ownMembershipDetailsCallsCount > 0 } @@ -10729,39 +10729,39 @@ class RoomPreviewProxyMock: RoomPreviewProxyProtocol, @unchecked Sendable { } } } - var underlyingOwnMembershipDetails: RoomMembershipDetailsProxyProtocol? - var ownMembershipDetailsClosure: (() async -> RoomMembershipDetailsProxyProtocol?)? + nonisolated(unsafe) var underlyingOwnMembershipDetails: RoomMembershipDetailsProxyProtocol? + nonisolated(unsafe) var ownMembershipDetailsClosure: (() async -> RoomMembershipDetailsProxyProtocol?)? } -class RoomProxyMock: RoomProxyProtocol, @unchecked Sendable { +nonisolated class RoomProxyMock: RoomProxyProtocol, @unchecked Sendable { var id: String { get { return underlyingId } set(value) { underlyingId = value } } - var underlyingId: String! + nonisolated(unsafe) var underlyingId: String! var ownUserID: String { get { return underlyingOwnUserID } set(value) { underlyingOwnUserID = value } } - var underlyingOwnUserID: String! + nonisolated(unsafe) var underlyingOwnUserID: String! } -class RoomSummaryProviderMock: RoomSummaryProviderProtocol, @unchecked Sendable { +nonisolated class RoomSummaryProviderMock: RoomSummaryProviderProtocol, @unchecked Sendable { var statePublisher: CurrentValuePublisher { get { return underlyingStatePublisher } set(value) { underlyingStatePublisher = value } } - var underlyingStatePublisher: CurrentValuePublisher! + nonisolated(unsafe) var underlyingStatePublisher: CurrentValuePublisher! var roomListPublisher: CurrentValuePublisher<[RoomSummary], Never> { get { return underlyingRoomListPublisher } set(value) { underlyingRoomListPublisher = value } } - var underlyingRoomListPublisher: CurrentValuePublisher<[RoomSummary], Never>! + nonisolated(unsafe) var underlyingRoomListPublisher: CurrentValuePublisher<[RoomSummary], Never>! //MARK: - updateVisibleRange private let updateVisibleRangeCallsCountLock = NSLock() - private var updateVisibleRangeUnderlyingCallsCount = 0 + private nonisolated(unsafe) var updateVisibleRangeUnderlyingCallsCount = 0 var updateVisibleRangeCallsCount: Int { get { updateVisibleRangeCallsCountLock.withLock { updateVisibleRangeUnderlyingCallsCount } } set { updateVisibleRangeCallsCountLock.withLock { updateVisibleRangeUnderlyingCallsCount = newValue } } @@ -10770,18 +10770,18 @@ class RoomSummaryProviderMock: RoomSummaryProviderProtocol, @unchecked Sendable return updateVisibleRangeCallsCount > 0 } private let updateVisibleRangeReceivedRangeLock = NSLock() - private var updateVisibleRangeUnderlyingReceivedRange: Range? + private nonisolated(unsafe) var updateVisibleRangeUnderlyingReceivedRange: Range? var updateVisibleRangeReceivedRange: Range? { get { updateVisibleRangeReceivedRangeLock.withLock { updateVisibleRangeUnderlyingReceivedRange } } set { updateVisibleRangeReceivedRangeLock.withLock { updateVisibleRangeUnderlyingReceivedRange = newValue } } } private let updateVisibleRangeReceivedInvocationsLock = NSLock() - private var updateVisibleRangeUnderlyingReceivedInvocations: [Range] = [] + private nonisolated(unsafe) var updateVisibleRangeUnderlyingReceivedInvocations: [Range] = [] var updateVisibleRangeReceivedInvocations: [Range] { get { updateVisibleRangeReceivedInvocationsLock.withLock { updateVisibleRangeUnderlyingReceivedInvocations } } set { updateVisibleRangeReceivedInvocationsLock.withLock { updateVisibleRangeUnderlyingReceivedInvocations = newValue } } } - var updateVisibleRangeClosure: ((Range) -> Void)? + nonisolated(unsafe) var updateVisibleRangeClosure: ((Range) -> Void)? func updateVisibleRange(_ range: Range) { updateVisibleRangeCallsCountLock.withLock { updateVisibleRangeUnderlyingCallsCount += 1 } @@ -10792,7 +10792,7 @@ class RoomSummaryProviderMock: RoomSummaryProviderProtocol, @unchecked Sendable //MARK: - setFilter private let setFilterCallsCountLock = NSLock() - private var setFilterUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setFilterUnderlyingCallsCount = 0 var setFilterCallsCount: Int { get { setFilterCallsCountLock.withLock { setFilterUnderlyingCallsCount } } set { setFilterCallsCountLock.withLock { setFilterUnderlyingCallsCount = newValue } } @@ -10801,18 +10801,18 @@ class RoomSummaryProviderMock: RoomSummaryProviderProtocol, @unchecked Sendable return setFilterCallsCount > 0 } private let setFilterReceivedFilterLock = NSLock() - private var setFilterUnderlyingReceivedFilter: RoomSummaryProviderFilter? + private nonisolated(unsafe) var setFilterUnderlyingReceivedFilter: RoomSummaryProviderFilter? var setFilterReceivedFilter: RoomSummaryProviderFilter? { get { setFilterReceivedFilterLock.withLock { setFilterUnderlyingReceivedFilter } } set { setFilterReceivedFilterLock.withLock { setFilterUnderlyingReceivedFilter = newValue } } } private let setFilterReceivedInvocationsLock = NSLock() - private var setFilterUnderlyingReceivedInvocations: [RoomSummaryProviderFilter] = [] + private nonisolated(unsafe) var setFilterUnderlyingReceivedInvocations: [RoomSummaryProviderFilter] = [] var setFilterReceivedInvocations: [RoomSummaryProviderFilter] { get { setFilterReceivedInvocationsLock.withLock { setFilterUnderlyingReceivedInvocations } } set { setFilterReceivedInvocationsLock.withLock { setFilterUnderlyingReceivedInvocations = newValue } } } - var setFilterClosure: ((RoomSummaryProviderFilter) -> Void)? + nonisolated(unsafe) var setFilterClosure: ((RoomSummaryProviderFilter) -> Void)? func setFilter(_ filter: RoomSummaryProviderFilter) { setFilterCallsCountLock.withLock { setFilterUnderlyingCallsCount += 1 } @@ -10823,7 +10823,7 @@ class RoomSummaryProviderMock: RoomSummaryProviderProtocol, @unchecked Sendable //MARK: - setRoomList private let setRoomListCallsCountLock = NSLock() - private var setRoomListUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setRoomListUnderlyingCallsCount = 0 var setRoomListCallsCount: Int { get { setRoomListCallsCountLock.withLock { setRoomListUnderlyingCallsCount } } set { setRoomListCallsCountLock.withLock { setRoomListUnderlyingCallsCount = newValue } } @@ -10832,18 +10832,18 @@ class RoomSummaryProviderMock: RoomSummaryProviderProtocol, @unchecked Sendable return setRoomListCallsCount > 0 } private let setRoomListReceivedRoomListLock = NSLock() - private var setRoomListUnderlyingReceivedRoomList: RoomList? + private nonisolated(unsafe) var setRoomListUnderlyingReceivedRoomList: RoomList? var setRoomListReceivedRoomList: RoomList? { get { setRoomListReceivedRoomListLock.withLock { setRoomListUnderlyingReceivedRoomList } } set { setRoomListReceivedRoomListLock.withLock { setRoomListUnderlyingReceivedRoomList = newValue } } } private let setRoomListReceivedInvocationsLock = NSLock() - private var setRoomListUnderlyingReceivedInvocations: [RoomList] = [] + private nonisolated(unsafe) var setRoomListUnderlyingReceivedInvocations: [RoomList] = [] var setRoomListReceivedInvocations: [RoomList] { get { setRoomListReceivedInvocationsLock.withLock { setRoomListUnderlyingReceivedInvocations } } set { setRoomListReceivedInvocationsLock.withLock { setRoomListUnderlyingReceivedInvocations = newValue } } } - var setRoomListClosure: ((RoomList) -> Void)? + nonisolated(unsafe) var setRoomListClosure: ((RoomList) -> Void)? func setRoomList(_ roomList: RoomList) { setRoomListCallsCountLock.withLock { setRoomListUnderlyingCallsCount += 1 } @@ -10852,22 +10852,22 @@ class RoomSummaryProviderMock: RoomSummaryProviderProtocol, @unchecked Sendable setRoomListClosure?(roomList) } } -class RoomThreadListServiceProxyMock: RoomThreadListServiceProxyProtocol, @unchecked Sendable { +nonisolated class RoomThreadListServiceProxyMock: RoomThreadListServiceProxyProtocol, @unchecked Sendable { var itemsPublisher: CurrentValuePublisher<[RoomThreadListItem], Never> { get { return underlyingItemsPublisher } set(value) { underlyingItemsPublisher = value } } - var underlyingItemsPublisher: CurrentValuePublisher<[RoomThreadListItem], Never>! + nonisolated(unsafe) var underlyingItemsPublisher: CurrentValuePublisher<[RoomThreadListItem], Never>! var paginationStatePublisher: CurrentValuePublisher { get { return underlyingPaginationStatePublisher } set(value) { underlyingPaginationStatePublisher = value } } - var underlyingPaginationStatePublisher: CurrentValuePublisher! + nonisolated(unsafe) var underlyingPaginationStatePublisher: CurrentValuePublisher! //MARK: - paginate private let paginateCallsCountLock = NSLock() - private var paginateUnderlyingCallsCount = 0 + private nonisolated(unsafe) var paginateUnderlyingCallsCount = 0 var paginateCallsCount: Int { get { paginateCallsCountLock.withLock { paginateUnderlyingCallsCount } } set { paginateCallsCountLock.withLock { paginateUnderlyingCallsCount = newValue } } @@ -10877,14 +10877,14 @@ class RoomThreadListServiceProxyMock: RoomThreadListServiceProxyProtocol, @unche } private let paginateReturnValueLock = NSLock() - private var paginateUnderlyingReturnValue: Result! + private nonisolated(unsafe) var paginateUnderlyingReturnValue: Result! var paginateReturnValue: Result! { get { paginateReturnValueLock.withLock { paginateUnderlyingReturnValue } } set { paginateReturnValueLock.withLock { paginateUnderlyingReturnValue = newValue } } } - var paginateClosure: (() async -> Result)? + nonisolated(unsafe) var paginateClosure: (() async -> Result)? - func paginate() async -> Result { + @concurrent func paginate() async -> Result { paginateCallsCountLock.withLock { paginateUnderlyingCallsCount += 1 } if let paginateClosure = paginateClosure { return await paginateClosure() @@ -10893,22 +10893,22 @@ class RoomThreadListServiceProxyMock: RoomThreadListServiceProxyProtocol, @unche } } } -class SecureBackupControllerMock: SecureBackupControllerProtocol, @unchecked Sendable { +nonisolated class SecureBackupControllerMock: SecureBackupControllerProtocol, @unchecked Sendable { var recoveryState: CurrentValuePublisher { get { return underlyingRecoveryState } set(value) { underlyingRecoveryState = value } } - var underlyingRecoveryState: CurrentValuePublisher! + nonisolated(unsafe) var underlyingRecoveryState: CurrentValuePublisher! var keyBackupState: CurrentValuePublisher { get { return underlyingKeyBackupState } set(value) { underlyingKeyBackupState = value } } - var underlyingKeyBackupState: CurrentValuePublisher! + nonisolated(unsafe) var underlyingKeyBackupState: CurrentValuePublisher! //MARK: - enable private let enableCallsCountLock = NSLock() - private var enableUnderlyingCallsCount = 0 + private nonisolated(unsafe) var enableUnderlyingCallsCount = 0 var enableCallsCount: Int { get { enableCallsCountLock.withLock { enableUnderlyingCallsCount } } set { enableCallsCountLock.withLock { enableUnderlyingCallsCount = newValue } } @@ -10918,14 +10918,14 @@ class SecureBackupControllerMock: SecureBackupControllerProtocol, @unchecked Sen } private let enableReturnValueLock = NSLock() - private var enableUnderlyingReturnValue: Result! + private nonisolated(unsafe) var enableUnderlyingReturnValue: Result! var enableReturnValue: Result! { get { enableReturnValueLock.withLock { enableUnderlyingReturnValue } } set { enableReturnValueLock.withLock { enableUnderlyingReturnValue = newValue } } } - var enableClosure: (() async -> Result)? + nonisolated(unsafe) var enableClosure: (() async -> Result)? - func enable() async -> Result { + @concurrent func enable() async -> Result { enableCallsCountLock.withLock { enableUnderlyingCallsCount += 1 } if let enableClosure = enableClosure { return await enableClosure() @@ -10936,7 +10936,7 @@ class SecureBackupControllerMock: SecureBackupControllerProtocol, @unchecked Sen //MARK: - disable private let disableCallsCountLock = NSLock() - private var disableUnderlyingCallsCount = 0 + private nonisolated(unsafe) var disableUnderlyingCallsCount = 0 var disableCallsCount: Int { get { disableCallsCountLock.withLock { disableUnderlyingCallsCount } } set { disableCallsCountLock.withLock { disableUnderlyingCallsCount = newValue } } @@ -10946,14 +10946,14 @@ class SecureBackupControllerMock: SecureBackupControllerProtocol, @unchecked Sen } private let disableReturnValueLock = NSLock() - private var disableUnderlyingReturnValue: Result! + private nonisolated(unsafe) var disableUnderlyingReturnValue: Result! var disableReturnValue: Result! { get { disableReturnValueLock.withLock { disableUnderlyingReturnValue } } set { disableReturnValueLock.withLock { disableUnderlyingReturnValue = newValue } } } - var disableClosure: (() async -> Result)? + nonisolated(unsafe) var disableClosure: (() async -> Result)? - func disable() async -> Result { + @concurrent func disable() async -> Result { disableCallsCountLock.withLock { disableUnderlyingCallsCount += 1 } if let disableClosure = disableClosure { return await disableClosure() @@ -10964,7 +10964,7 @@ class SecureBackupControllerMock: SecureBackupControllerProtocol, @unchecked Sen //MARK: - generateRecoveryKey private let generateRecoveryKeyWithPassphraseCallsCountLock = NSLock() - private var generateRecoveryKeyWithPassphraseUnderlyingCallsCount = 0 + private nonisolated(unsafe) var generateRecoveryKeyWithPassphraseUnderlyingCallsCount = 0 var generateRecoveryKeyWithPassphraseCallsCount: Int { get { generateRecoveryKeyWithPassphraseCallsCountLock.withLock { generateRecoveryKeyWithPassphraseUnderlyingCallsCount } } set { generateRecoveryKeyWithPassphraseCallsCountLock.withLock { generateRecoveryKeyWithPassphraseUnderlyingCallsCount = newValue } } @@ -10973,27 +10973,27 @@ class SecureBackupControllerMock: SecureBackupControllerProtocol, @unchecked Sen return generateRecoveryKeyWithPassphraseCallsCount > 0 } private let generateRecoveryKeyWithPassphraseReceivedPassphraseLock = NSLock() - private var generateRecoveryKeyWithPassphraseUnderlyingReceivedPassphrase: String? + private nonisolated(unsafe) var generateRecoveryKeyWithPassphraseUnderlyingReceivedPassphrase: String? var generateRecoveryKeyWithPassphraseReceivedPassphrase: String? { get { generateRecoveryKeyWithPassphraseReceivedPassphraseLock.withLock { generateRecoveryKeyWithPassphraseUnderlyingReceivedPassphrase } } set { generateRecoveryKeyWithPassphraseReceivedPassphraseLock.withLock { generateRecoveryKeyWithPassphraseUnderlyingReceivedPassphrase = newValue } } } private let generateRecoveryKeyWithPassphraseReceivedInvocationsLock = NSLock() - private var generateRecoveryKeyWithPassphraseUnderlyingReceivedInvocations: [String?] = [] + private nonisolated(unsafe) var generateRecoveryKeyWithPassphraseUnderlyingReceivedInvocations: [String?] = [] var generateRecoveryKeyWithPassphraseReceivedInvocations: [String?] { get { generateRecoveryKeyWithPassphraseReceivedInvocationsLock.withLock { generateRecoveryKeyWithPassphraseUnderlyingReceivedInvocations } } set { generateRecoveryKeyWithPassphraseReceivedInvocationsLock.withLock { generateRecoveryKeyWithPassphraseUnderlyingReceivedInvocations = newValue } } } private let generateRecoveryKeyWithPassphraseReturnValueLock = NSLock() - private var generateRecoveryKeyWithPassphraseUnderlyingReturnValue: Result! + private nonisolated(unsafe) var generateRecoveryKeyWithPassphraseUnderlyingReturnValue: Result! var generateRecoveryKeyWithPassphraseReturnValue: Result! { get { generateRecoveryKeyWithPassphraseReturnValueLock.withLock { generateRecoveryKeyWithPassphraseUnderlyingReturnValue } } set { generateRecoveryKeyWithPassphraseReturnValueLock.withLock { generateRecoveryKeyWithPassphraseUnderlyingReturnValue = newValue } } } - var generateRecoveryKeyWithPassphraseClosure: ((String?) async -> Result)? + nonisolated(unsafe) var generateRecoveryKeyWithPassphraseClosure: ((String?) async -> Result)? - func generateRecoveryKey(withPassphrase passphrase: String?) async -> Result { + @concurrent func generateRecoveryKey(withPassphrase passphrase: String?) async -> Result { generateRecoveryKeyWithPassphraseCallsCountLock.withLock { generateRecoveryKeyWithPassphraseUnderlyingCallsCount += 1 } generateRecoveryKeyWithPassphraseReceivedPassphrase = passphrase generateRecoveryKeyWithPassphraseReceivedInvocationsLock.withLock { generateRecoveryKeyWithPassphraseUnderlyingReceivedInvocations.append(passphrase) } @@ -11006,7 +11006,7 @@ class SecureBackupControllerMock: SecureBackupControllerProtocol, @unchecked Sen //MARK: - confirmRecoveryKey private let confirmRecoveryKeyCallsCountLock = NSLock() - private var confirmRecoveryKeyUnderlyingCallsCount = 0 + private nonisolated(unsafe) var confirmRecoveryKeyUnderlyingCallsCount = 0 var confirmRecoveryKeyCallsCount: Int { get { confirmRecoveryKeyCallsCountLock.withLock { confirmRecoveryKeyUnderlyingCallsCount } } set { confirmRecoveryKeyCallsCountLock.withLock { confirmRecoveryKeyUnderlyingCallsCount = newValue } } @@ -11015,27 +11015,27 @@ class SecureBackupControllerMock: SecureBackupControllerProtocol, @unchecked Sen return confirmRecoveryKeyCallsCount > 0 } private let confirmRecoveryKeyReceivedKeyLock = NSLock() - private var confirmRecoveryKeyUnderlyingReceivedKey: String? + private nonisolated(unsafe) var confirmRecoveryKeyUnderlyingReceivedKey: String? var confirmRecoveryKeyReceivedKey: String? { get { confirmRecoveryKeyReceivedKeyLock.withLock { confirmRecoveryKeyUnderlyingReceivedKey } } set { confirmRecoveryKeyReceivedKeyLock.withLock { confirmRecoveryKeyUnderlyingReceivedKey = newValue } } } private let confirmRecoveryKeyReceivedInvocationsLock = NSLock() - private var confirmRecoveryKeyUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var confirmRecoveryKeyUnderlyingReceivedInvocations: [String] = [] var confirmRecoveryKeyReceivedInvocations: [String] { get { confirmRecoveryKeyReceivedInvocationsLock.withLock { confirmRecoveryKeyUnderlyingReceivedInvocations } } set { confirmRecoveryKeyReceivedInvocationsLock.withLock { confirmRecoveryKeyUnderlyingReceivedInvocations = newValue } } } private let confirmRecoveryKeyReturnValueLock = NSLock() - private var confirmRecoveryKeyUnderlyingReturnValue: Result! + private nonisolated(unsafe) var confirmRecoveryKeyUnderlyingReturnValue: Result! var confirmRecoveryKeyReturnValue: Result! { get { confirmRecoveryKeyReturnValueLock.withLock { confirmRecoveryKeyUnderlyingReturnValue } } set { confirmRecoveryKeyReturnValueLock.withLock { confirmRecoveryKeyUnderlyingReturnValue = newValue } } } - var confirmRecoveryKeyClosure: ((String) async -> Result)? + nonisolated(unsafe) var confirmRecoveryKeyClosure: ((String) async -> Result)? - func confirmRecoveryKey(_ key: String) async -> Result { + @concurrent func confirmRecoveryKey(_ key: String) async -> Result { confirmRecoveryKeyCallsCountLock.withLock { confirmRecoveryKeyUnderlyingCallsCount += 1 } confirmRecoveryKeyReceivedKey = key confirmRecoveryKeyReceivedInvocationsLock.withLock { confirmRecoveryKeyUnderlyingReceivedInvocations.append(key) } @@ -11048,7 +11048,7 @@ class SecureBackupControllerMock: SecureBackupControllerProtocol, @unchecked Sen //MARK: - waitForKeyBackupUpload private let waitForKeyBackupUploadUploadStateSubjectCallsCountLock = NSLock() - private var waitForKeyBackupUploadUploadStateSubjectUnderlyingCallsCount = 0 + private nonisolated(unsafe) var waitForKeyBackupUploadUploadStateSubjectUnderlyingCallsCount = 0 var waitForKeyBackupUploadUploadStateSubjectCallsCount: Int { get { waitForKeyBackupUploadUploadStateSubjectCallsCountLock.withLock { waitForKeyBackupUploadUploadStateSubjectUnderlyingCallsCount } } set { waitForKeyBackupUploadUploadStateSubjectCallsCountLock.withLock { waitForKeyBackupUploadUploadStateSubjectUnderlyingCallsCount = newValue } } @@ -11057,27 +11057,27 @@ class SecureBackupControllerMock: SecureBackupControllerProtocol, @unchecked Sen return waitForKeyBackupUploadUploadStateSubjectCallsCount > 0 } private let waitForKeyBackupUploadUploadStateSubjectReceivedUploadStateSubjectLock = NSLock() - private var waitForKeyBackupUploadUploadStateSubjectUnderlyingReceivedUploadStateSubject: CurrentValueSubject? + private nonisolated(unsafe) var waitForKeyBackupUploadUploadStateSubjectUnderlyingReceivedUploadStateSubject: CurrentValueSubject? var waitForKeyBackupUploadUploadStateSubjectReceivedUploadStateSubject: CurrentValueSubject? { get { waitForKeyBackupUploadUploadStateSubjectReceivedUploadStateSubjectLock.withLock { waitForKeyBackupUploadUploadStateSubjectUnderlyingReceivedUploadStateSubject } } set { waitForKeyBackupUploadUploadStateSubjectReceivedUploadStateSubjectLock.withLock { waitForKeyBackupUploadUploadStateSubjectUnderlyingReceivedUploadStateSubject = newValue } } } private let waitForKeyBackupUploadUploadStateSubjectReceivedInvocationsLock = NSLock() - private var waitForKeyBackupUploadUploadStateSubjectUnderlyingReceivedInvocations: [CurrentValueSubject] = [] + private nonisolated(unsafe) var waitForKeyBackupUploadUploadStateSubjectUnderlyingReceivedInvocations: [CurrentValueSubject] = [] var waitForKeyBackupUploadUploadStateSubjectReceivedInvocations: [CurrentValueSubject] { get { waitForKeyBackupUploadUploadStateSubjectReceivedInvocationsLock.withLock { waitForKeyBackupUploadUploadStateSubjectUnderlyingReceivedInvocations } } set { waitForKeyBackupUploadUploadStateSubjectReceivedInvocationsLock.withLock { waitForKeyBackupUploadUploadStateSubjectUnderlyingReceivedInvocations = newValue } } } private let waitForKeyBackupUploadUploadStateSubjectReturnValueLock = NSLock() - private var waitForKeyBackupUploadUploadStateSubjectUnderlyingReturnValue: Result! + private nonisolated(unsafe) var waitForKeyBackupUploadUploadStateSubjectUnderlyingReturnValue: Result! var waitForKeyBackupUploadUploadStateSubjectReturnValue: Result! { get { waitForKeyBackupUploadUploadStateSubjectReturnValueLock.withLock { waitForKeyBackupUploadUploadStateSubjectUnderlyingReturnValue } } set { waitForKeyBackupUploadUploadStateSubjectReturnValueLock.withLock { waitForKeyBackupUploadUploadStateSubjectUnderlyingReturnValue = newValue } } } - var waitForKeyBackupUploadUploadStateSubjectClosure: ((CurrentValueSubject) async -> Result)? + nonisolated(unsafe) var waitForKeyBackupUploadUploadStateSubjectClosure: ((CurrentValueSubject) async -> Result)? - func waitForKeyBackupUpload(uploadStateSubject: CurrentValueSubject) async -> Result { + @concurrent func waitForKeyBackupUpload(uploadStateSubject: CurrentValueSubject) async -> Result { waitForKeyBackupUploadUploadStateSubjectCallsCountLock.withLock { waitForKeyBackupUploadUploadStateSubjectUnderlyingCallsCount += 1 } waitForKeyBackupUploadUploadStateSubjectReceivedUploadStateSubject = uploadStateSubject waitForKeyBackupUploadUploadStateSubjectReceivedInvocationsLock.withLock { waitForKeyBackupUploadUploadStateSubjectUnderlyingReceivedInvocations.append(uploadStateSubject) } @@ -11088,17 +11088,17 @@ class SecureBackupControllerMock: SecureBackupControllerProtocol, @unchecked Sen } } } -class SessionVerificationControllerProxyMock: SessionVerificationControllerProxyProtocol, @unchecked Sendable { +nonisolated class SessionVerificationControllerProxyMock: SessionVerificationControllerProxyProtocol, @unchecked Sendable { var actions: PassthroughSubject { get { return underlyingActions } set(value) { underlyingActions = value } } - var underlyingActions: PassthroughSubject! + nonisolated(unsafe) var underlyingActions: PassthroughSubject! //MARK: - acknowledgeVerificationRequest private let acknowledgeVerificationRequestDetailsCallsCountLock = NSLock() - private var acknowledgeVerificationRequestDetailsUnderlyingCallsCount = 0 + private nonisolated(unsafe) var acknowledgeVerificationRequestDetailsUnderlyingCallsCount = 0 var acknowledgeVerificationRequestDetailsCallsCount: Int { get { acknowledgeVerificationRequestDetailsCallsCountLock.withLock { acknowledgeVerificationRequestDetailsUnderlyingCallsCount } } set { acknowledgeVerificationRequestDetailsCallsCountLock.withLock { acknowledgeVerificationRequestDetailsUnderlyingCallsCount = newValue } } @@ -11107,27 +11107,27 @@ class SessionVerificationControllerProxyMock: SessionVerificationControllerProxy return acknowledgeVerificationRequestDetailsCallsCount > 0 } private let acknowledgeVerificationRequestDetailsReceivedDetailsLock = NSLock() - private var acknowledgeVerificationRequestDetailsUnderlyingReceivedDetails: SessionVerificationRequestDetails? + private nonisolated(unsafe) var acknowledgeVerificationRequestDetailsUnderlyingReceivedDetails: SessionVerificationRequestDetails? var acknowledgeVerificationRequestDetailsReceivedDetails: SessionVerificationRequestDetails? { get { acknowledgeVerificationRequestDetailsReceivedDetailsLock.withLock { acknowledgeVerificationRequestDetailsUnderlyingReceivedDetails } } set { acknowledgeVerificationRequestDetailsReceivedDetailsLock.withLock { acknowledgeVerificationRequestDetailsUnderlyingReceivedDetails = newValue } } } private let acknowledgeVerificationRequestDetailsReceivedInvocationsLock = NSLock() - private var acknowledgeVerificationRequestDetailsUnderlyingReceivedInvocations: [SessionVerificationRequestDetails] = [] + private nonisolated(unsafe) var acknowledgeVerificationRequestDetailsUnderlyingReceivedInvocations: [SessionVerificationRequestDetails] = [] var acknowledgeVerificationRequestDetailsReceivedInvocations: [SessionVerificationRequestDetails] { get { acknowledgeVerificationRequestDetailsReceivedInvocationsLock.withLock { acknowledgeVerificationRequestDetailsUnderlyingReceivedInvocations } } set { acknowledgeVerificationRequestDetailsReceivedInvocationsLock.withLock { acknowledgeVerificationRequestDetailsUnderlyingReceivedInvocations = newValue } } } private let acknowledgeVerificationRequestDetailsReturnValueLock = NSLock() - private var acknowledgeVerificationRequestDetailsUnderlyingReturnValue: Result! + private nonisolated(unsafe) var acknowledgeVerificationRequestDetailsUnderlyingReturnValue: Result! var acknowledgeVerificationRequestDetailsReturnValue: Result! { get { acknowledgeVerificationRequestDetailsReturnValueLock.withLock { acknowledgeVerificationRequestDetailsUnderlyingReturnValue } } set { acknowledgeVerificationRequestDetailsReturnValueLock.withLock { acknowledgeVerificationRequestDetailsUnderlyingReturnValue = newValue } } } - var acknowledgeVerificationRequestDetailsClosure: ((SessionVerificationRequestDetails) async -> Result)? + nonisolated(unsafe) var acknowledgeVerificationRequestDetailsClosure: ((SessionVerificationRequestDetails) async -> Result)? - func acknowledgeVerificationRequest(details: SessionVerificationRequestDetails) async -> Result { + @concurrent func acknowledgeVerificationRequest(details: SessionVerificationRequestDetails) async -> Result { acknowledgeVerificationRequestDetailsCallsCountLock.withLock { acknowledgeVerificationRequestDetailsUnderlyingCallsCount += 1 } acknowledgeVerificationRequestDetailsReceivedDetails = details acknowledgeVerificationRequestDetailsReceivedInvocationsLock.withLock { acknowledgeVerificationRequestDetailsUnderlyingReceivedInvocations.append(details) } @@ -11140,7 +11140,7 @@ class SessionVerificationControllerProxyMock: SessionVerificationControllerProxy //MARK: - acceptVerificationRequest private let acceptVerificationRequestCallsCountLock = NSLock() - private var acceptVerificationRequestUnderlyingCallsCount = 0 + private nonisolated(unsafe) var acceptVerificationRequestUnderlyingCallsCount = 0 var acceptVerificationRequestCallsCount: Int { get { acceptVerificationRequestCallsCountLock.withLock { acceptVerificationRequestUnderlyingCallsCount } } set { acceptVerificationRequestCallsCountLock.withLock { acceptVerificationRequestUnderlyingCallsCount = newValue } } @@ -11150,14 +11150,14 @@ class SessionVerificationControllerProxyMock: SessionVerificationControllerProxy } private let acceptVerificationRequestReturnValueLock = NSLock() - private var acceptVerificationRequestUnderlyingReturnValue: Result! + private nonisolated(unsafe) var acceptVerificationRequestUnderlyingReturnValue: Result! var acceptVerificationRequestReturnValue: Result! { get { acceptVerificationRequestReturnValueLock.withLock { acceptVerificationRequestUnderlyingReturnValue } } set { acceptVerificationRequestReturnValueLock.withLock { acceptVerificationRequestUnderlyingReturnValue = newValue } } } - var acceptVerificationRequestClosure: (() async -> Result)? + nonisolated(unsafe) var acceptVerificationRequestClosure: (() async -> Result)? - func acceptVerificationRequest() async -> Result { + @concurrent func acceptVerificationRequest() async -> Result { acceptVerificationRequestCallsCountLock.withLock { acceptVerificationRequestUnderlyingCallsCount += 1 } if let acceptVerificationRequestClosure = acceptVerificationRequestClosure { return await acceptVerificationRequestClosure() @@ -11168,7 +11168,7 @@ class SessionVerificationControllerProxyMock: SessionVerificationControllerProxy //MARK: - requestDeviceVerification private let requestDeviceVerificationCallsCountLock = NSLock() - private var requestDeviceVerificationUnderlyingCallsCount = 0 + private nonisolated(unsafe) var requestDeviceVerificationUnderlyingCallsCount = 0 var requestDeviceVerificationCallsCount: Int { get { requestDeviceVerificationCallsCountLock.withLock { requestDeviceVerificationUnderlyingCallsCount } } set { requestDeviceVerificationCallsCountLock.withLock { requestDeviceVerificationUnderlyingCallsCount = newValue } } @@ -11178,14 +11178,14 @@ class SessionVerificationControllerProxyMock: SessionVerificationControllerProxy } private let requestDeviceVerificationReturnValueLock = NSLock() - private var requestDeviceVerificationUnderlyingReturnValue: Result! + private nonisolated(unsafe) var requestDeviceVerificationUnderlyingReturnValue: Result! var requestDeviceVerificationReturnValue: Result! { get { requestDeviceVerificationReturnValueLock.withLock { requestDeviceVerificationUnderlyingReturnValue } } set { requestDeviceVerificationReturnValueLock.withLock { requestDeviceVerificationUnderlyingReturnValue = newValue } } } - var requestDeviceVerificationClosure: (() async -> Result)? + nonisolated(unsafe) var requestDeviceVerificationClosure: (() async -> Result)? - func requestDeviceVerification() async -> Result { + @concurrent func requestDeviceVerification() async -> Result { requestDeviceVerificationCallsCountLock.withLock { requestDeviceVerificationUnderlyingCallsCount += 1 } if let requestDeviceVerificationClosure = requestDeviceVerificationClosure { return await requestDeviceVerificationClosure() @@ -11196,7 +11196,7 @@ class SessionVerificationControllerProxyMock: SessionVerificationControllerProxy //MARK: - requestUserVerification private let requestUserVerificationCallsCountLock = NSLock() - private var requestUserVerificationUnderlyingCallsCount = 0 + private nonisolated(unsafe) var requestUserVerificationUnderlyingCallsCount = 0 var requestUserVerificationCallsCount: Int { get { requestUserVerificationCallsCountLock.withLock { requestUserVerificationUnderlyingCallsCount } } set { requestUserVerificationCallsCountLock.withLock { requestUserVerificationUnderlyingCallsCount = newValue } } @@ -11205,27 +11205,27 @@ class SessionVerificationControllerProxyMock: SessionVerificationControllerProxy return requestUserVerificationCallsCount > 0 } private let requestUserVerificationReceivedUserIDLock = NSLock() - private var requestUserVerificationUnderlyingReceivedUserID: String? + private nonisolated(unsafe) var requestUserVerificationUnderlyingReceivedUserID: String? var requestUserVerificationReceivedUserID: String? { get { requestUserVerificationReceivedUserIDLock.withLock { requestUserVerificationUnderlyingReceivedUserID } } set { requestUserVerificationReceivedUserIDLock.withLock { requestUserVerificationUnderlyingReceivedUserID = newValue } } } private let requestUserVerificationReceivedInvocationsLock = NSLock() - private var requestUserVerificationUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var requestUserVerificationUnderlyingReceivedInvocations: [String] = [] var requestUserVerificationReceivedInvocations: [String] { get { requestUserVerificationReceivedInvocationsLock.withLock { requestUserVerificationUnderlyingReceivedInvocations } } set { requestUserVerificationReceivedInvocationsLock.withLock { requestUserVerificationUnderlyingReceivedInvocations = newValue } } } private let requestUserVerificationReturnValueLock = NSLock() - private var requestUserVerificationUnderlyingReturnValue: Result! + private nonisolated(unsafe) var requestUserVerificationUnderlyingReturnValue: Result! var requestUserVerificationReturnValue: Result! { get { requestUserVerificationReturnValueLock.withLock { requestUserVerificationUnderlyingReturnValue } } set { requestUserVerificationReturnValueLock.withLock { requestUserVerificationUnderlyingReturnValue = newValue } } } - var requestUserVerificationClosure: ((String) async -> Result)? + nonisolated(unsafe) var requestUserVerificationClosure: ((String) async -> Result)? - func requestUserVerification(_ userID: String) async -> Result { + @concurrent func requestUserVerification(_ userID: String) async -> Result { requestUserVerificationCallsCountLock.withLock { requestUserVerificationUnderlyingCallsCount += 1 } requestUserVerificationReceivedUserID = userID requestUserVerificationReceivedInvocationsLock.withLock { requestUserVerificationUnderlyingReceivedInvocations.append(userID) } @@ -11238,7 +11238,7 @@ class SessionVerificationControllerProxyMock: SessionVerificationControllerProxy //MARK: - startSasVerification private let startSasVerificationCallsCountLock = NSLock() - private var startSasVerificationUnderlyingCallsCount = 0 + private nonisolated(unsafe) var startSasVerificationUnderlyingCallsCount = 0 var startSasVerificationCallsCount: Int { get { startSasVerificationCallsCountLock.withLock { startSasVerificationUnderlyingCallsCount } } set { startSasVerificationCallsCountLock.withLock { startSasVerificationUnderlyingCallsCount = newValue } } @@ -11248,14 +11248,14 @@ class SessionVerificationControllerProxyMock: SessionVerificationControllerProxy } private let startSasVerificationReturnValueLock = NSLock() - private var startSasVerificationUnderlyingReturnValue: Result! + private nonisolated(unsafe) var startSasVerificationUnderlyingReturnValue: Result! var startSasVerificationReturnValue: Result! { get { startSasVerificationReturnValueLock.withLock { startSasVerificationUnderlyingReturnValue } } set { startSasVerificationReturnValueLock.withLock { startSasVerificationUnderlyingReturnValue = newValue } } } - var startSasVerificationClosure: (() async -> Result)? + nonisolated(unsafe) var startSasVerificationClosure: (() async -> Result)? - func startSasVerification() async -> Result { + @concurrent func startSasVerification() async -> Result { startSasVerificationCallsCountLock.withLock { startSasVerificationUnderlyingCallsCount += 1 } if let startSasVerificationClosure = startSasVerificationClosure { return await startSasVerificationClosure() @@ -11266,7 +11266,7 @@ class SessionVerificationControllerProxyMock: SessionVerificationControllerProxy //MARK: - approveVerification private let approveVerificationCallsCountLock = NSLock() - private var approveVerificationUnderlyingCallsCount = 0 + private nonisolated(unsafe) var approveVerificationUnderlyingCallsCount = 0 var approveVerificationCallsCount: Int { get { approveVerificationCallsCountLock.withLock { approveVerificationUnderlyingCallsCount } } set { approveVerificationCallsCountLock.withLock { approveVerificationUnderlyingCallsCount = newValue } } @@ -11276,14 +11276,14 @@ class SessionVerificationControllerProxyMock: SessionVerificationControllerProxy } private let approveVerificationReturnValueLock = NSLock() - private var approveVerificationUnderlyingReturnValue: Result! + private nonisolated(unsafe) var approveVerificationUnderlyingReturnValue: Result! var approveVerificationReturnValue: Result! { get { approveVerificationReturnValueLock.withLock { approveVerificationUnderlyingReturnValue } } set { approveVerificationReturnValueLock.withLock { approveVerificationUnderlyingReturnValue = newValue } } } - var approveVerificationClosure: (() async -> Result)? + nonisolated(unsafe) var approveVerificationClosure: (() async -> Result)? - func approveVerification() async -> Result { + @concurrent func approveVerification() async -> Result { approveVerificationCallsCountLock.withLock { approveVerificationUnderlyingCallsCount += 1 } if let approveVerificationClosure = approveVerificationClosure { return await approveVerificationClosure() @@ -11294,7 +11294,7 @@ class SessionVerificationControllerProxyMock: SessionVerificationControllerProxy //MARK: - declineVerification private let declineVerificationCallsCountLock = NSLock() - private var declineVerificationUnderlyingCallsCount = 0 + private nonisolated(unsafe) var declineVerificationUnderlyingCallsCount = 0 var declineVerificationCallsCount: Int { get { declineVerificationCallsCountLock.withLock { declineVerificationUnderlyingCallsCount } } set { declineVerificationCallsCountLock.withLock { declineVerificationUnderlyingCallsCount = newValue } } @@ -11304,14 +11304,14 @@ class SessionVerificationControllerProxyMock: SessionVerificationControllerProxy } private let declineVerificationReturnValueLock = NSLock() - private var declineVerificationUnderlyingReturnValue: Result! + private nonisolated(unsafe) var declineVerificationUnderlyingReturnValue: Result! var declineVerificationReturnValue: Result! { get { declineVerificationReturnValueLock.withLock { declineVerificationUnderlyingReturnValue } } set { declineVerificationReturnValueLock.withLock { declineVerificationUnderlyingReturnValue = newValue } } } - var declineVerificationClosure: (() async -> Result)? + nonisolated(unsafe) var declineVerificationClosure: (() async -> Result)? - func declineVerification() async -> Result { + @concurrent func declineVerification() async -> Result { declineVerificationCallsCountLock.withLock { declineVerificationUnderlyingCallsCount += 1 } if let declineVerificationClosure = declineVerificationClosure { return await declineVerificationClosure() @@ -11322,7 +11322,7 @@ class SessionVerificationControllerProxyMock: SessionVerificationControllerProxy //MARK: - cancelVerification private let cancelVerificationCallsCountLock = NSLock() - private var cancelVerificationUnderlyingCallsCount = 0 + private nonisolated(unsafe) var cancelVerificationUnderlyingCallsCount = 0 var cancelVerificationCallsCount: Int { get { cancelVerificationCallsCountLock.withLock { cancelVerificationUnderlyingCallsCount } } set { cancelVerificationCallsCountLock.withLock { cancelVerificationUnderlyingCallsCount = newValue } } @@ -11332,14 +11332,14 @@ class SessionVerificationControllerProxyMock: SessionVerificationControllerProxy } private let cancelVerificationReturnValueLock = NSLock() - private var cancelVerificationUnderlyingReturnValue: Result! + private nonisolated(unsafe) var cancelVerificationUnderlyingReturnValue: Result! var cancelVerificationReturnValue: Result! { get { cancelVerificationReturnValueLock.withLock { cancelVerificationUnderlyingReturnValue } } set { cancelVerificationReturnValueLock.withLock { cancelVerificationUnderlyingReturnValue = newValue } } } - var cancelVerificationClosure: (() async -> Result)? + nonisolated(unsafe) var cancelVerificationClosure: (() async -> Result)? - func cancelVerification() async -> Result { + @concurrent func cancelVerification() async -> Result { cancelVerificationCallsCountLock.withLock { cancelVerificationUnderlyingCallsCount += 1 } if let cancelVerificationClosure = cancelVerificationClosure { return await cancelVerificationClosure() @@ -11348,32 +11348,32 @@ class SessionVerificationControllerProxyMock: SessionVerificationControllerProxy } } } -class SpaceRoomListProxyMock: SpaceRoomListProxyProtocol, @unchecked Sendable { +nonisolated class SpaceRoomListProxyMock: SpaceRoomListProxyProtocol, @unchecked Sendable { var id: String { get { return underlyingId } set(value) { underlyingId = value } } - var underlyingId: String! + nonisolated(unsafe) var underlyingId: String! var spaceServiceRoomPublisher: CurrentValuePublisher { get { return underlyingSpaceServiceRoomPublisher } set(value) { underlyingSpaceServiceRoomPublisher = value } } - var underlyingSpaceServiceRoomPublisher: CurrentValuePublisher! + nonisolated(unsafe) var underlyingSpaceServiceRoomPublisher: CurrentValuePublisher! var spaceRoomsPublisher: CurrentValuePublisher<[SpaceServiceRoom], Never> { get { return underlyingSpaceRoomsPublisher } set(value) { underlyingSpaceRoomsPublisher = value } } - var underlyingSpaceRoomsPublisher: CurrentValuePublisher<[SpaceServiceRoom], Never>! + nonisolated(unsafe) var underlyingSpaceRoomsPublisher: CurrentValuePublisher<[SpaceServiceRoom], Never>! var paginationStatePublisher: CurrentValuePublisher { get { return underlyingPaginationStatePublisher } set(value) { underlyingPaginationStatePublisher = value } } - var underlyingPaginationStatePublisher: CurrentValuePublisher! + nonisolated(unsafe) var underlyingPaginationStatePublisher: CurrentValuePublisher! //MARK: - paginate private let paginateCallsCountLock = NSLock() - private var paginateUnderlyingCallsCount = 0 + private nonisolated(unsafe) var paginateUnderlyingCallsCount = 0 var paginateCallsCount: Int { get { paginateCallsCountLock.withLock { paginateUnderlyingCallsCount } } set { paginateCallsCountLock.withLock { paginateUnderlyingCallsCount = newValue } } @@ -11381,16 +11381,16 @@ class SpaceRoomListProxyMock: SpaceRoomListProxyProtocol, @unchecked Sendable { var paginateCalled: Bool { return paginateCallsCount > 0 } - var paginateClosure: (() async -> Void)? + nonisolated(unsafe) var paginateClosure: (() async -> Void)? - func paginate() async { + @concurrent func paginate() async { paginateCallsCountLock.withLock { paginateUnderlyingCallsCount += 1 } await paginateClosure?() } //MARK: - reset private let resetCallsCountLock = NSLock() - private var resetUnderlyingCallsCount = 0 + private nonisolated(unsafe) var resetUnderlyingCallsCount = 0 var resetCallsCount: Int { get { resetCallsCountLock.withLock { resetUnderlyingCallsCount } } set { resetCallsCountLock.withLock { resetUnderlyingCallsCount = newValue } } @@ -11398,29 +11398,29 @@ class SpaceRoomListProxyMock: SpaceRoomListProxyProtocol, @unchecked Sendable { var resetCalled: Bool { return resetCallsCount > 0 } - var resetClosure: (() async -> Void)? + nonisolated(unsafe) var resetClosure: (() async -> Void)? - func reset() async { + @concurrent func reset() async { resetCallsCountLock.withLock { resetUnderlyingCallsCount += 1 } await resetClosure?() } } -class SpaceServiceProxyMock: SpaceServiceProxyProtocol, @unchecked Sendable { +nonisolated class SpaceServiceProxyMock: SpaceServiceProxyProtocol, @unchecked Sendable { var topLevelSpacesPublisher: CurrentValuePublisher<[SpaceServiceRoom], Never> { get { return underlyingTopLevelSpacesPublisher } set(value) { underlyingTopLevelSpacesPublisher = value } } - var underlyingTopLevelSpacesPublisher: CurrentValuePublisher<[SpaceServiceRoom], Never>! + nonisolated(unsafe) var underlyingTopLevelSpacesPublisher: CurrentValuePublisher<[SpaceServiceRoom], Never>! var spaceFilterPublisher: CurrentValuePublisher<[SpaceServiceFilter], Never> { get { return underlyingSpaceFilterPublisher } set(value) { underlyingSpaceFilterPublisher = value } } - var underlyingSpaceFilterPublisher: CurrentValuePublisher<[SpaceServiceFilter], Never>! + nonisolated(unsafe) var underlyingSpaceFilterPublisher: CurrentValuePublisher<[SpaceServiceFilter], Never>! //MARK: - spaceRoomList private let spaceRoomListSpaceIDCallsCountLock = NSLock() - private var spaceRoomListSpaceIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var spaceRoomListSpaceIDUnderlyingCallsCount = 0 var spaceRoomListSpaceIDCallsCount: Int { get { spaceRoomListSpaceIDCallsCountLock.withLock { spaceRoomListSpaceIDUnderlyingCallsCount } } set { spaceRoomListSpaceIDCallsCountLock.withLock { spaceRoomListSpaceIDUnderlyingCallsCount = newValue } } @@ -11429,27 +11429,27 @@ class SpaceServiceProxyMock: SpaceServiceProxyProtocol, @unchecked Sendable { return spaceRoomListSpaceIDCallsCount > 0 } private let spaceRoomListSpaceIDReceivedSpaceIDLock = NSLock() - private var spaceRoomListSpaceIDUnderlyingReceivedSpaceID: String? + private nonisolated(unsafe) var spaceRoomListSpaceIDUnderlyingReceivedSpaceID: String? var spaceRoomListSpaceIDReceivedSpaceID: String? { get { spaceRoomListSpaceIDReceivedSpaceIDLock.withLock { spaceRoomListSpaceIDUnderlyingReceivedSpaceID } } set { spaceRoomListSpaceIDReceivedSpaceIDLock.withLock { spaceRoomListSpaceIDUnderlyingReceivedSpaceID = newValue } } } private let spaceRoomListSpaceIDReceivedInvocationsLock = NSLock() - private var spaceRoomListSpaceIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var spaceRoomListSpaceIDUnderlyingReceivedInvocations: [String] = [] var spaceRoomListSpaceIDReceivedInvocations: [String] { get { spaceRoomListSpaceIDReceivedInvocationsLock.withLock { spaceRoomListSpaceIDUnderlyingReceivedInvocations } } set { spaceRoomListSpaceIDReceivedInvocationsLock.withLock { spaceRoomListSpaceIDUnderlyingReceivedInvocations = newValue } } } private let spaceRoomListSpaceIDReturnValueLock = NSLock() - private var spaceRoomListSpaceIDUnderlyingReturnValue: Result! + private nonisolated(unsafe) var spaceRoomListSpaceIDUnderlyingReturnValue: Result! var spaceRoomListSpaceIDReturnValue: Result! { get { spaceRoomListSpaceIDReturnValueLock.withLock { spaceRoomListSpaceIDUnderlyingReturnValue } } set { spaceRoomListSpaceIDReturnValueLock.withLock { spaceRoomListSpaceIDUnderlyingReturnValue = newValue } } } - var spaceRoomListSpaceIDClosure: ((String) async -> Result)? + nonisolated(unsafe) var spaceRoomListSpaceIDClosure: ((String) async -> Result)? - func spaceRoomList(spaceID: String) async -> Result { + @concurrent func spaceRoomList(spaceID: String) async -> Result { spaceRoomListSpaceIDCallsCountLock.withLock { spaceRoomListSpaceIDUnderlyingCallsCount += 1 } spaceRoomListSpaceIDReceivedSpaceID = spaceID spaceRoomListSpaceIDReceivedInvocationsLock.withLock { spaceRoomListSpaceIDUnderlyingReceivedInvocations.append(spaceID) } @@ -11462,7 +11462,7 @@ class SpaceServiceProxyMock: SpaceServiceProxyProtocol, @unchecked Sendable { //MARK: - spaceForIdentifier private let spaceForIdentifierSpaceIDCallsCountLock = NSLock() - private var spaceForIdentifierSpaceIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var spaceForIdentifierSpaceIDUnderlyingCallsCount = 0 var spaceForIdentifierSpaceIDCallsCount: Int { get { spaceForIdentifierSpaceIDCallsCountLock.withLock { spaceForIdentifierSpaceIDUnderlyingCallsCount } } set { spaceForIdentifierSpaceIDCallsCountLock.withLock { spaceForIdentifierSpaceIDUnderlyingCallsCount = newValue } } @@ -11471,27 +11471,27 @@ class SpaceServiceProxyMock: SpaceServiceProxyProtocol, @unchecked Sendable { return spaceForIdentifierSpaceIDCallsCount > 0 } private let spaceForIdentifierSpaceIDReceivedSpaceIDLock = NSLock() - private var spaceForIdentifierSpaceIDUnderlyingReceivedSpaceID: String? + private nonisolated(unsafe) var spaceForIdentifierSpaceIDUnderlyingReceivedSpaceID: String? var spaceForIdentifierSpaceIDReceivedSpaceID: String? { get { spaceForIdentifierSpaceIDReceivedSpaceIDLock.withLock { spaceForIdentifierSpaceIDUnderlyingReceivedSpaceID } } set { spaceForIdentifierSpaceIDReceivedSpaceIDLock.withLock { spaceForIdentifierSpaceIDUnderlyingReceivedSpaceID = newValue } } } private let spaceForIdentifierSpaceIDReceivedInvocationsLock = NSLock() - private var spaceForIdentifierSpaceIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var spaceForIdentifierSpaceIDUnderlyingReceivedInvocations: [String] = [] var spaceForIdentifierSpaceIDReceivedInvocations: [String] { get { spaceForIdentifierSpaceIDReceivedInvocationsLock.withLock { spaceForIdentifierSpaceIDUnderlyingReceivedInvocations } } set { spaceForIdentifierSpaceIDReceivedInvocationsLock.withLock { spaceForIdentifierSpaceIDUnderlyingReceivedInvocations = newValue } } } private let spaceForIdentifierSpaceIDReturnValueLock = NSLock() - private var spaceForIdentifierSpaceIDUnderlyingReturnValue: Result! + private nonisolated(unsafe) var spaceForIdentifierSpaceIDUnderlyingReturnValue: Result! var spaceForIdentifierSpaceIDReturnValue: Result! { get { spaceForIdentifierSpaceIDReturnValueLock.withLock { spaceForIdentifierSpaceIDUnderlyingReturnValue } } set { spaceForIdentifierSpaceIDReturnValueLock.withLock { spaceForIdentifierSpaceIDUnderlyingReturnValue = newValue } } } - var spaceForIdentifierSpaceIDClosure: ((String) async -> Result)? + nonisolated(unsafe) var spaceForIdentifierSpaceIDClosure: ((String) async -> Result)? - func spaceForIdentifier(spaceID: String) async -> Result { + @concurrent func spaceForIdentifier(spaceID: String) async -> Result { spaceForIdentifierSpaceIDCallsCountLock.withLock { spaceForIdentifierSpaceIDUnderlyingCallsCount += 1 } spaceForIdentifierSpaceIDReceivedSpaceID = spaceID spaceForIdentifierSpaceIDReceivedInvocationsLock.withLock { spaceForIdentifierSpaceIDUnderlyingReceivedInvocations.append(spaceID) } @@ -11504,7 +11504,7 @@ class SpaceServiceProxyMock: SpaceServiceProxyProtocol, @unchecked Sendable { //MARK: - leaveSpace private let leaveSpaceSpaceIDCallsCountLock = NSLock() - private var leaveSpaceSpaceIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var leaveSpaceSpaceIDUnderlyingCallsCount = 0 var leaveSpaceSpaceIDCallsCount: Int { get { leaveSpaceSpaceIDCallsCountLock.withLock { leaveSpaceSpaceIDUnderlyingCallsCount } } set { leaveSpaceSpaceIDCallsCountLock.withLock { leaveSpaceSpaceIDUnderlyingCallsCount = newValue } } @@ -11513,27 +11513,27 @@ class SpaceServiceProxyMock: SpaceServiceProxyProtocol, @unchecked Sendable { return leaveSpaceSpaceIDCallsCount > 0 } private let leaveSpaceSpaceIDReceivedSpaceIDLock = NSLock() - private var leaveSpaceSpaceIDUnderlyingReceivedSpaceID: String? + private nonisolated(unsafe) var leaveSpaceSpaceIDUnderlyingReceivedSpaceID: String? var leaveSpaceSpaceIDReceivedSpaceID: String? { get { leaveSpaceSpaceIDReceivedSpaceIDLock.withLock { leaveSpaceSpaceIDUnderlyingReceivedSpaceID } } set { leaveSpaceSpaceIDReceivedSpaceIDLock.withLock { leaveSpaceSpaceIDUnderlyingReceivedSpaceID = newValue } } } private let leaveSpaceSpaceIDReceivedInvocationsLock = NSLock() - private var leaveSpaceSpaceIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var leaveSpaceSpaceIDUnderlyingReceivedInvocations: [String] = [] var leaveSpaceSpaceIDReceivedInvocations: [String] { get { leaveSpaceSpaceIDReceivedInvocationsLock.withLock { leaveSpaceSpaceIDUnderlyingReceivedInvocations } } set { leaveSpaceSpaceIDReceivedInvocationsLock.withLock { leaveSpaceSpaceIDUnderlyingReceivedInvocations = newValue } } } private let leaveSpaceSpaceIDReturnValueLock = NSLock() - private var leaveSpaceSpaceIDUnderlyingReturnValue: Result! + private nonisolated(unsafe) var leaveSpaceSpaceIDUnderlyingReturnValue: Result! var leaveSpaceSpaceIDReturnValue: Result! { get { leaveSpaceSpaceIDReturnValueLock.withLock { leaveSpaceSpaceIDUnderlyingReturnValue } } set { leaveSpaceSpaceIDReturnValueLock.withLock { leaveSpaceSpaceIDUnderlyingReturnValue = newValue } } } - var leaveSpaceSpaceIDClosure: ((String) async -> Result)? + nonisolated(unsafe) var leaveSpaceSpaceIDClosure: ((String) async -> Result)? - func leaveSpace(spaceID: String) async -> Result { + @concurrent func leaveSpace(spaceID: String) async -> Result { leaveSpaceSpaceIDCallsCountLock.withLock { leaveSpaceSpaceIDUnderlyingCallsCount += 1 } leaveSpaceSpaceIDReceivedSpaceID = spaceID leaveSpaceSpaceIDReceivedInvocationsLock.withLock { leaveSpaceSpaceIDUnderlyingReceivedInvocations.append(spaceID) } @@ -11546,7 +11546,7 @@ class SpaceServiceProxyMock: SpaceServiceProxyProtocol, @unchecked Sendable { //MARK: - joinedParents private let joinedParentsChildIDCallsCountLock = NSLock() - private var joinedParentsChildIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var joinedParentsChildIDUnderlyingCallsCount = 0 var joinedParentsChildIDCallsCount: Int { get { joinedParentsChildIDCallsCountLock.withLock { joinedParentsChildIDUnderlyingCallsCount } } set { joinedParentsChildIDCallsCountLock.withLock { joinedParentsChildIDUnderlyingCallsCount = newValue } } @@ -11555,27 +11555,27 @@ class SpaceServiceProxyMock: SpaceServiceProxyProtocol, @unchecked Sendable { return joinedParentsChildIDCallsCount > 0 } private let joinedParentsChildIDReceivedChildIDLock = NSLock() - private var joinedParentsChildIDUnderlyingReceivedChildID: String? + private nonisolated(unsafe) var joinedParentsChildIDUnderlyingReceivedChildID: String? var joinedParentsChildIDReceivedChildID: String? { get { joinedParentsChildIDReceivedChildIDLock.withLock { joinedParentsChildIDUnderlyingReceivedChildID } } set { joinedParentsChildIDReceivedChildIDLock.withLock { joinedParentsChildIDUnderlyingReceivedChildID = newValue } } } private let joinedParentsChildIDReceivedInvocationsLock = NSLock() - private var joinedParentsChildIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var joinedParentsChildIDUnderlyingReceivedInvocations: [String] = [] var joinedParentsChildIDReceivedInvocations: [String] { get { joinedParentsChildIDReceivedInvocationsLock.withLock { joinedParentsChildIDUnderlyingReceivedInvocations } } set { joinedParentsChildIDReceivedInvocationsLock.withLock { joinedParentsChildIDUnderlyingReceivedInvocations = newValue } } } private let joinedParentsChildIDReturnValueLock = NSLock() - private var joinedParentsChildIDUnderlyingReturnValue: Result<[SpaceServiceRoom], SpaceServiceProxyError>! + private nonisolated(unsafe) var joinedParentsChildIDUnderlyingReturnValue: Result<[SpaceServiceRoom], SpaceServiceProxyError>! var joinedParentsChildIDReturnValue: Result<[SpaceServiceRoom], SpaceServiceProxyError>! { get { joinedParentsChildIDReturnValueLock.withLock { joinedParentsChildIDUnderlyingReturnValue } } set { joinedParentsChildIDReturnValueLock.withLock { joinedParentsChildIDUnderlyingReturnValue = newValue } } } - var joinedParentsChildIDClosure: ((String) async -> Result<[SpaceServiceRoom], SpaceServiceProxyError>)? + nonisolated(unsafe) var joinedParentsChildIDClosure: ((String) async -> Result<[SpaceServiceRoom], SpaceServiceProxyError>)? - func joinedParents(childID: String) async -> Result<[SpaceServiceRoom], SpaceServiceProxyError> { + @concurrent func joinedParents(childID: String) async -> Result<[SpaceServiceRoom], SpaceServiceProxyError> { joinedParentsChildIDCallsCountLock.withLock { joinedParentsChildIDUnderlyingCallsCount += 1 } joinedParentsChildIDReceivedChildID = childID joinedParentsChildIDReceivedInvocationsLock.withLock { joinedParentsChildIDUnderlyingReceivedInvocations.append(childID) } @@ -11588,7 +11588,7 @@ class SpaceServiceProxyMock: SpaceServiceProxyProtocol, @unchecked Sendable { //MARK: - editableSpaces private let editableSpacesCallsCountLock = NSLock() - private var editableSpacesUnderlyingCallsCount = 0 + private nonisolated(unsafe) var editableSpacesUnderlyingCallsCount = 0 var editableSpacesCallsCount: Int { get { editableSpacesCallsCountLock.withLock { editableSpacesUnderlyingCallsCount } } set { editableSpacesCallsCountLock.withLock { editableSpacesUnderlyingCallsCount = newValue } } @@ -11598,14 +11598,14 @@ class SpaceServiceProxyMock: SpaceServiceProxyProtocol, @unchecked Sendable { } private let editableSpacesReturnValueLock = NSLock() - private var editableSpacesUnderlyingReturnValue: [SpaceServiceRoom]! + private nonisolated(unsafe) var editableSpacesUnderlyingReturnValue: [SpaceServiceRoom]! var editableSpacesReturnValue: [SpaceServiceRoom]! { get { editableSpacesReturnValueLock.withLock { editableSpacesUnderlyingReturnValue } } set { editableSpacesReturnValueLock.withLock { editableSpacesUnderlyingReturnValue = newValue } } } - var editableSpacesClosure: (() async -> [SpaceServiceRoom])? + nonisolated(unsafe) var editableSpacesClosure: (() async -> [SpaceServiceRoom])? - func editableSpaces() async -> [SpaceServiceRoom] { + @concurrent func editableSpaces() async -> [SpaceServiceRoom] { editableSpacesCallsCountLock.withLock { editableSpacesUnderlyingCallsCount += 1 } if let editableSpacesClosure = editableSpacesClosure { return await editableSpacesClosure() @@ -11616,7 +11616,7 @@ class SpaceServiceProxyMock: SpaceServiceProxyProtocol, @unchecked Sendable { //MARK: - addChild private let addChildToCallsCountLock = NSLock() - private var addChildToUnderlyingCallsCount = 0 + private nonisolated(unsafe) var addChildToUnderlyingCallsCount = 0 var addChildToCallsCount: Int { get { addChildToCallsCountLock.withLock { addChildToUnderlyingCallsCount } } set { addChildToCallsCountLock.withLock { addChildToUnderlyingCallsCount = newValue } } @@ -11625,27 +11625,27 @@ class SpaceServiceProxyMock: SpaceServiceProxyProtocol, @unchecked Sendable { return addChildToCallsCount > 0 } private let addChildToReceivedArgumentsLock = NSLock() - private var addChildToUnderlyingReceivedArguments: (childID: String, spaceID: String)? + private nonisolated(unsafe) var addChildToUnderlyingReceivedArguments: (childID: String, spaceID: String)? var addChildToReceivedArguments: (childID: String, spaceID: String)? { get { addChildToReceivedArgumentsLock.withLock { addChildToUnderlyingReceivedArguments } } set { addChildToReceivedArgumentsLock.withLock { addChildToUnderlyingReceivedArguments = newValue } } } private let addChildToReceivedInvocationsLock = NSLock() - private var addChildToUnderlyingReceivedInvocations: [(childID: String, spaceID: String)] = [] + private nonisolated(unsafe) var addChildToUnderlyingReceivedInvocations: [(childID: String, spaceID: String)] = [] var addChildToReceivedInvocations: [(childID: String, spaceID: String)] { get { addChildToReceivedInvocationsLock.withLock { addChildToUnderlyingReceivedInvocations } } set { addChildToReceivedInvocationsLock.withLock { addChildToUnderlyingReceivedInvocations = newValue } } } private let addChildToReturnValueLock = NSLock() - private var addChildToUnderlyingReturnValue: Result! + private nonisolated(unsafe) var addChildToUnderlyingReturnValue: Result! var addChildToReturnValue: Result! { get { addChildToReturnValueLock.withLock { addChildToUnderlyingReturnValue } } set { addChildToReturnValueLock.withLock { addChildToUnderlyingReturnValue = newValue } } } - var addChildToClosure: ((String, String) async -> Result)? + nonisolated(unsafe) var addChildToClosure: ((String, String) async -> Result)? - func addChild(_ childID: String, to spaceID: String) async -> Result { + @concurrent func addChild(_ childID: String, to spaceID: String) async -> Result { addChildToCallsCountLock.withLock { addChildToUnderlyingCallsCount += 1 } addChildToReceivedArguments = (childID: childID, spaceID: spaceID) addChildToReceivedInvocationsLock.withLock { addChildToUnderlyingReceivedInvocations.append((childID: childID, spaceID: spaceID)) } @@ -11658,7 +11658,7 @@ class SpaceServiceProxyMock: SpaceServiceProxyProtocol, @unchecked Sendable { //MARK: - removeChild private let removeChildFromCallsCountLock = NSLock() - private var removeChildFromUnderlyingCallsCount = 0 + private nonisolated(unsafe) var removeChildFromUnderlyingCallsCount = 0 var removeChildFromCallsCount: Int { get { removeChildFromCallsCountLock.withLock { removeChildFromUnderlyingCallsCount } } set { removeChildFromCallsCountLock.withLock { removeChildFromUnderlyingCallsCount = newValue } } @@ -11667,27 +11667,27 @@ class SpaceServiceProxyMock: SpaceServiceProxyProtocol, @unchecked Sendable { return removeChildFromCallsCount > 0 } private let removeChildFromReceivedArgumentsLock = NSLock() - private var removeChildFromUnderlyingReceivedArguments: (childID: String, spaceID: String)? + private nonisolated(unsafe) var removeChildFromUnderlyingReceivedArguments: (childID: String, spaceID: String)? var removeChildFromReceivedArguments: (childID: String, spaceID: String)? { get { removeChildFromReceivedArgumentsLock.withLock { removeChildFromUnderlyingReceivedArguments } } set { removeChildFromReceivedArgumentsLock.withLock { removeChildFromUnderlyingReceivedArguments = newValue } } } private let removeChildFromReceivedInvocationsLock = NSLock() - private var removeChildFromUnderlyingReceivedInvocations: [(childID: String, spaceID: String)] = [] + private nonisolated(unsafe) var removeChildFromUnderlyingReceivedInvocations: [(childID: String, spaceID: String)] = [] var removeChildFromReceivedInvocations: [(childID: String, spaceID: String)] { get { removeChildFromReceivedInvocationsLock.withLock { removeChildFromUnderlyingReceivedInvocations } } set { removeChildFromReceivedInvocationsLock.withLock { removeChildFromUnderlyingReceivedInvocations = newValue } } } private let removeChildFromReturnValueLock = NSLock() - private var removeChildFromUnderlyingReturnValue: Result! + private nonisolated(unsafe) var removeChildFromUnderlyingReturnValue: Result! var removeChildFromReturnValue: Result! { get { removeChildFromReturnValueLock.withLock { removeChildFromUnderlyingReturnValue } } set { removeChildFromReturnValueLock.withLock { removeChildFromUnderlyingReturnValue = newValue } } } - var removeChildFromClosure: ((String, String) async -> Result)? + nonisolated(unsafe) var removeChildFromClosure: ((String, String) async -> Result)? - func removeChild(_ childID: String, from spaceID: String) async -> Result { + @concurrent func removeChild(_ childID: String, from spaceID: String) async -> Result { removeChildFromCallsCountLock.withLock { removeChildFromUnderlyingCallsCount += 1 } removeChildFromReceivedArguments = (childID: childID, spaceID: spaceID) removeChildFromReceivedInvocationsLock.withLock { removeChildFromUnderlyingReceivedInvocations.append((childID: childID, spaceID: spaceID)) } @@ -11698,22 +11698,22 @@ class SpaceServiceProxyMock: SpaceServiceProxyProtocol, @unchecked Sendable { } } } -class StaticRoomSummaryProviderMock: StaticRoomSummaryProviderProtocol, @unchecked Sendable { +nonisolated class StaticRoomSummaryProviderMock: StaticRoomSummaryProviderProtocol, @unchecked Sendable { var statePublisher: CurrentValuePublisher { get { return underlyingStatePublisher } set(value) { underlyingStatePublisher = value } } - var underlyingStatePublisher: CurrentValuePublisher! + nonisolated(unsafe) var underlyingStatePublisher: CurrentValuePublisher! var roomListPublisher: CurrentValuePublisher<[RoomSummary], Never> { get { return underlyingRoomListPublisher } set(value) { underlyingRoomListPublisher = value } } - var underlyingRoomListPublisher: CurrentValuePublisher<[RoomSummary], Never>! + nonisolated(unsafe) var underlyingRoomListPublisher: CurrentValuePublisher<[RoomSummary], Never>! //MARK: - setRoomList private let setRoomListCallsCountLock = NSLock() - private var setRoomListUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setRoomListUnderlyingCallsCount = 0 var setRoomListCallsCount: Int { get { setRoomListCallsCountLock.withLock { setRoomListUnderlyingCallsCount } } set { setRoomListCallsCountLock.withLock { setRoomListUnderlyingCallsCount = newValue } } @@ -11722,18 +11722,18 @@ class StaticRoomSummaryProviderMock: StaticRoomSummaryProviderProtocol, @uncheck return setRoomListCallsCount > 0 } private let setRoomListReceivedRoomListLock = NSLock() - private var setRoomListUnderlyingReceivedRoomList: RoomList? + private nonisolated(unsafe) var setRoomListUnderlyingReceivedRoomList: RoomList? var setRoomListReceivedRoomList: RoomList? { get { setRoomListReceivedRoomListLock.withLock { setRoomListUnderlyingReceivedRoomList } } set { setRoomListReceivedRoomListLock.withLock { setRoomListUnderlyingReceivedRoomList = newValue } } } private let setRoomListReceivedInvocationsLock = NSLock() - private var setRoomListUnderlyingReceivedInvocations: [RoomList] = [] + private nonisolated(unsafe) var setRoomListUnderlyingReceivedInvocations: [RoomList] = [] var setRoomListReceivedInvocations: [RoomList] { get { setRoomListReceivedInvocationsLock.withLock { setRoomListUnderlyingReceivedInvocations } } set { setRoomListReceivedInvocationsLock.withLock { setRoomListUnderlyingReceivedInvocations = newValue } } } - var setRoomListClosure: ((RoomList) -> Void)? + nonisolated(unsafe) var setRoomListClosure: ((RoomList) -> Void)? func setRoomList(_ roomList: RoomList) { setRoomListCallsCountLock.withLock { setRoomListUnderlyingCallsCount += 1 } @@ -11742,12 +11742,12 @@ class StaticRoomSummaryProviderMock: StaticRoomSummaryProviderProtocol, @uncheck setRoomListClosure?(roomList) } } -class TimelineControllerFactoryMock: TimelineControllerFactoryProtocol, @unchecked Sendable { +nonisolated class TimelineControllerFactoryMock: TimelineControllerFactoryProtocol, @unchecked Sendable { //MARK: - buildTimelineController private let buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderCallsCountLock = NSLock() - private var buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderUnderlyingCallsCount = 0 + private nonisolated(unsafe) var buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderUnderlyingCallsCount = 0 var buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderCallsCount: Int { get { buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderCallsCountLock.withLock { buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderUnderlyingCallsCount } } set { buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderCallsCountLock.withLock { buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderUnderlyingCallsCount = newValue } } @@ -11756,25 +11756,25 @@ class TimelineControllerFactoryMock: TimelineControllerFactoryProtocol, @uncheck return buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderCallsCount > 0 } private let buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderReceivedArgumentsLock = NSLock() - private var buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderUnderlyingReceivedArguments: (roomProxy: JoinedRoomProxyProtocol, initialFocussedEventID: String?, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol)? + private nonisolated(unsafe) var buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderUnderlyingReceivedArguments: (roomProxy: JoinedRoomProxyProtocol, initialFocussedEventID: String?, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol)? var buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderReceivedArguments: (roomProxy: JoinedRoomProxyProtocol, initialFocussedEventID: String?, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol)? { get { buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderReceivedArgumentsLock.withLock { buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderUnderlyingReceivedArguments } } set { buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderReceivedArgumentsLock.withLock { buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderUnderlyingReceivedArguments = newValue } } } private let buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderReceivedInvocationsLock = NSLock() - private var buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderUnderlyingReceivedInvocations: [(roomProxy: JoinedRoomProxyProtocol, initialFocussedEventID: String?, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol)] = [] + private nonisolated(unsafe) var buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderUnderlyingReceivedInvocations: [(roomProxy: JoinedRoomProxyProtocol, initialFocussedEventID: String?, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol)] = [] var buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderReceivedInvocations: [(roomProxy: JoinedRoomProxyProtocol, initialFocussedEventID: String?, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol)] { get { buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderReceivedInvocationsLock.withLock { buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderUnderlyingReceivedInvocations } } set { buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderReceivedInvocationsLock.withLock { buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderUnderlyingReceivedInvocations = newValue } } } private let buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderReturnValueLock = NSLock() - private var buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderUnderlyingReturnValue: TimelineControllerProtocol! + private nonisolated(unsafe) var buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderUnderlyingReturnValue: TimelineControllerProtocol! var buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderReturnValue: TimelineControllerProtocol! { get { buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderReturnValueLock.withLock { buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderUnderlyingReturnValue } } set { buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderReturnValueLock.withLock { buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderUnderlyingReturnValue = newValue } } } - var buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderClosure: ((JoinedRoomProxyProtocol, String?, RoomTimelineItemFactoryProtocol, MediaProviderProtocol) -> TimelineControllerProtocol)? + nonisolated(unsafe) var buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderClosure: ((JoinedRoomProxyProtocol, String?, RoomTimelineItemFactoryProtocol, MediaProviderProtocol) -> TimelineControllerProtocol)? func buildTimelineController(roomProxy: JoinedRoomProxyProtocol, initialFocussedEventID: String?, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol) -> TimelineControllerProtocol { buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderCallsCountLock.withLock { buildTimelineControllerRoomProxyInitialFocussedEventIDTimelineItemFactoryMediaProviderUnderlyingCallsCount += 1 } @@ -11789,7 +11789,7 @@ class TimelineControllerFactoryMock: TimelineControllerFactoryProtocol, @uncheck //MARK: - buildThreadTimelineController private let buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderCallsCountLock = NSLock() - private var buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderUnderlyingCallsCount = 0 + private nonisolated(unsafe) var buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderUnderlyingCallsCount = 0 var buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderCallsCount: Int { get { buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderCallsCountLock.withLock { buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderUnderlyingCallsCount } } set { buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderCallsCountLock.withLock { buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderUnderlyingCallsCount = newValue } } @@ -11798,27 +11798,27 @@ class TimelineControllerFactoryMock: TimelineControllerFactoryProtocol, @uncheck return buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderCallsCount > 0 } private let buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderReceivedArgumentsLock = NSLock() - private var buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedArguments: (threadRootEventID: String, initialFocussedEventID: String?, roomProxy: JoinedRoomProxyProtocol, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol)? + private nonisolated(unsafe) var buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedArguments: (threadRootEventID: String, initialFocussedEventID: String?, roomProxy: JoinedRoomProxyProtocol, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol)? var buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderReceivedArguments: (threadRootEventID: String, initialFocussedEventID: String?, roomProxy: JoinedRoomProxyProtocol, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol)? { get { buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderReceivedArgumentsLock.withLock { buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedArguments } } set { buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderReceivedArgumentsLock.withLock { buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedArguments = newValue } } } private let buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderReceivedInvocationsLock = NSLock() - private var buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedInvocations: [(threadRootEventID: String, initialFocussedEventID: String?, roomProxy: JoinedRoomProxyProtocol, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol)] = [] + private nonisolated(unsafe) var buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedInvocations: [(threadRootEventID: String, initialFocussedEventID: String?, roomProxy: JoinedRoomProxyProtocol, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol)] = [] var buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderReceivedInvocations: [(threadRootEventID: String, initialFocussedEventID: String?, roomProxy: JoinedRoomProxyProtocol, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol)] { get { buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderReceivedInvocationsLock.withLock { buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedInvocations } } set { buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderReceivedInvocationsLock.withLock { buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedInvocations = newValue } } } private let buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderReturnValueLock = NSLock() - private var buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderUnderlyingReturnValue: Result! + private nonisolated(unsafe) var buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderUnderlyingReturnValue: Result! var buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderReturnValue: Result! { get { buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderReturnValueLock.withLock { buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderUnderlyingReturnValue } } set { buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderReturnValueLock.withLock { buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderUnderlyingReturnValue = newValue } } } - var buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderClosure: ((String, String?, JoinedRoomProxyProtocol, RoomTimelineItemFactoryProtocol, MediaProviderProtocol) async -> Result)? + nonisolated(unsafe) var buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderClosure: ((String, String?, JoinedRoomProxyProtocol, RoomTimelineItemFactoryProtocol, MediaProviderProtocol) async -> Result)? - func buildThreadTimelineController(threadRootEventID: String, initialFocussedEventID: String?, roomProxy: JoinedRoomProxyProtocol, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol) async -> Result { + @concurrent func buildThreadTimelineController(threadRootEventID: String, initialFocussedEventID: String?, roomProxy: JoinedRoomProxyProtocol, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol) async -> Result { buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderCallsCountLock.withLock { buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderUnderlyingCallsCount += 1 } buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderReceivedArguments = (threadRootEventID: threadRootEventID, initialFocussedEventID: initialFocussedEventID, roomProxy: roomProxy, timelineItemFactory: timelineItemFactory, mediaProvider: mediaProvider) buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderReceivedInvocationsLock.withLock { buildThreadTimelineControllerThreadRootEventIDInitialFocussedEventIDRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedInvocations.append((threadRootEventID: threadRootEventID, initialFocussedEventID: initialFocussedEventID, roomProxy: roomProxy, timelineItemFactory: timelineItemFactory, mediaProvider: mediaProvider)) } @@ -11831,7 +11831,7 @@ class TimelineControllerFactoryMock: TimelineControllerFactoryProtocol, @uncheck //MARK: - buildPinnedEventsTimelineController private let buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderCallsCountLock = NSLock() - private var buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderUnderlyingCallsCount = 0 + private nonisolated(unsafe) var buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderUnderlyingCallsCount = 0 var buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderCallsCount: Int { get { buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderCallsCountLock.withLock { buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderUnderlyingCallsCount } } set { buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderCallsCountLock.withLock { buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderUnderlyingCallsCount = newValue } } @@ -11840,27 +11840,27 @@ class TimelineControllerFactoryMock: TimelineControllerFactoryProtocol, @uncheck return buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderCallsCount > 0 } private let buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderReceivedArgumentsLock = NSLock() - private var buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedArguments: (roomProxy: JoinedRoomProxyProtocol, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol)? + private nonisolated(unsafe) var buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedArguments: (roomProxy: JoinedRoomProxyProtocol, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol)? var buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderReceivedArguments: (roomProxy: JoinedRoomProxyProtocol, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol)? { get { buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderReceivedArgumentsLock.withLock { buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedArguments } } set { buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderReceivedArgumentsLock.withLock { buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedArguments = newValue } } } private let buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderReceivedInvocationsLock = NSLock() - private var buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedInvocations: [(roomProxy: JoinedRoomProxyProtocol, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol)] = [] + private nonisolated(unsafe) var buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedInvocations: [(roomProxy: JoinedRoomProxyProtocol, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol)] = [] var buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderReceivedInvocations: [(roomProxy: JoinedRoomProxyProtocol, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol)] { get { buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderReceivedInvocationsLock.withLock { buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedInvocations } } set { buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderReceivedInvocationsLock.withLock { buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedInvocations = newValue } } } private let buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderReturnValueLock = NSLock() - private var buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderUnderlyingReturnValue: Result! + private nonisolated(unsafe) var buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderUnderlyingReturnValue: Result! var buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderReturnValue: Result! { get { buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderReturnValueLock.withLock { buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderUnderlyingReturnValue } } set { buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderReturnValueLock.withLock { buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderUnderlyingReturnValue = newValue } } } - var buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderClosure: ((JoinedRoomProxyProtocol, RoomTimelineItemFactoryProtocol, MediaProviderProtocol) async -> Result)? + nonisolated(unsafe) var buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderClosure: ((JoinedRoomProxyProtocol, RoomTimelineItemFactoryProtocol, MediaProviderProtocol) async -> Result)? - func buildPinnedEventsTimelineController(roomProxy: JoinedRoomProxyProtocol, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol) async -> Result { + @concurrent func buildPinnedEventsTimelineController(roomProxy: JoinedRoomProxyProtocol, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol) async -> Result { buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderCallsCountLock.withLock { buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderUnderlyingCallsCount += 1 } buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderReceivedArguments = (roomProxy: roomProxy, timelineItemFactory: timelineItemFactory, mediaProvider: mediaProvider) buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderReceivedInvocationsLock.withLock { buildPinnedEventsTimelineControllerRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedInvocations.append((roomProxy: roomProxy, timelineItemFactory: timelineItemFactory, mediaProvider: mediaProvider)) } @@ -11873,7 +11873,7 @@ class TimelineControllerFactoryMock: TimelineControllerFactoryProtocol, @uncheck //MARK: - buildMessageFilteredTimelineController private let buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderCallsCountLock = NSLock() - private var buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderUnderlyingCallsCount = 0 + private nonisolated(unsafe) var buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderUnderlyingCallsCount = 0 var buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderCallsCount: Int { get { buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderCallsCountLock.withLock { buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderUnderlyingCallsCount } } set { buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderCallsCountLock.withLock { buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderUnderlyingCallsCount = newValue } } @@ -11882,27 +11882,27 @@ class TimelineControllerFactoryMock: TimelineControllerFactoryProtocol, @uncheck return buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderCallsCount > 0 } private let buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderReceivedArgumentsLock = NSLock() - private var buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedArguments: (focus: TimelineFocus, allowedMessageTypes: [TimelineAllowedMessageType], presentation: TimelineKind.MediaPresentation, roomProxy: JoinedRoomProxyProtocol, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol)? + private nonisolated(unsafe) var buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedArguments: (focus: TimelineFocus, allowedMessageTypes: [TimelineAllowedMessageType], presentation: TimelineKind.MediaPresentation, roomProxy: JoinedRoomProxyProtocol, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol)? var buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderReceivedArguments: (focus: TimelineFocus, allowedMessageTypes: [TimelineAllowedMessageType], presentation: TimelineKind.MediaPresentation, roomProxy: JoinedRoomProxyProtocol, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol)? { get { buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderReceivedArgumentsLock.withLock { buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedArguments } } set { buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderReceivedArgumentsLock.withLock { buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedArguments = newValue } } } private let buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderReceivedInvocationsLock = NSLock() - private var buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedInvocations: [(focus: TimelineFocus, allowedMessageTypes: [TimelineAllowedMessageType], presentation: TimelineKind.MediaPresentation, roomProxy: JoinedRoomProxyProtocol, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol)] = [] + private nonisolated(unsafe) var buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedInvocations: [(focus: TimelineFocus, allowedMessageTypes: [TimelineAllowedMessageType], presentation: TimelineKind.MediaPresentation, roomProxy: JoinedRoomProxyProtocol, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol)] = [] var buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderReceivedInvocations: [(focus: TimelineFocus, allowedMessageTypes: [TimelineAllowedMessageType], presentation: TimelineKind.MediaPresentation, roomProxy: JoinedRoomProxyProtocol, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol)] { get { buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderReceivedInvocationsLock.withLock { buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedInvocations } } set { buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderReceivedInvocationsLock.withLock { buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedInvocations = newValue } } } private let buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderReturnValueLock = NSLock() - private var buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderUnderlyingReturnValue: Result! + private nonisolated(unsafe) var buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderUnderlyingReturnValue: Result! var buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderReturnValue: Result! { get { buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderReturnValueLock.withLock { buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderUnderlyingReturnValue } } set { buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderReturnValueLock.withLock { buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderUnderlyingReturnValue = newValue } } } - var buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderClosure: ((TimelineFocus, [TimelineAllowedMessageType], TimelineKind.MediaPresentation, JoinedRoomProxyProtocol, RoomTimelineItemFactoryProtocol, MediaProviderProtocol) async -> Result)? + nonisolated(unsafe) var buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderClosure: ((TimelineFocus, [TimelineAllowedMessageType], TimelineKind.MediaPresentation, JoinedRoomProxyProtocol, RoomTimelineItemFactoryProtocol, MediaProviderProtocol) async -> Result)? - func buildMessageFilteredTimelineController(focus: TimelineFocus, allowedMessageTypes: [TimelineAllowedMessageType], presentation: TimelineKind.MediaPresentation, roomProxy: JoinedRoomProxyProtocol, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol) async -> Result { + @concurrent func buildMessageFilteredTimelineController(focus: TimelineFocus, allowedMessageTypes: [TimelineAllowedMessageType], presentation: TimelineKind.MediaPresentation, roomProxy: JoinedRoomProxyProtocol, timelineItemFactory: RoomTimelineItemFactoryProtocol, mediaProvider: MediaProviderProtocol) async -> Result { buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderCallsCountLock.withLock { buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderUnderlyingCallsCount += 1 } buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderReceivedArguments = (focus: focus, allowedMessageTypes: allowedMessageTypes, presentation: presentation, roomProxy: roomProxy, timelineItemFactory: timelineItemFactory, mediaProvider: mediaProvider) buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderReceivedInvocationsLock.withLock { buildMessageFilteredTimelineControllerFocusAllowedMessageTypesPresentationRoomProxyTimelineItemFactoryMediaProviderUnderlyingReceivedInvocations.append((focus: focus, allowedMessageTypes: allowedMessageTypes, presentation: presentation, roomProxy: roomProxy, timelineItemFactory: timelineItemFactory, mediaProvider: mediaProvider)) } @@ -11913,33 +11913,33 @@ class TimelineControllerFactoryMock: TimelineControllerFactoryProtocol, @uncheck } } } -class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { +nonisolated class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { var roomID: String { get { return underlyingRoomID } set(value) { underlyingRoomID = value } } - var underlyingRoomID: String! + nonisolated(unsafe) var underlyingRoomID: String! var timelineKind: TimelineKind { get { return underlyingTimelineKind } set(value) { underlyingTimelineKind = value } } - var underlyingTimelineKind: TimelineKind! - var timelineItems: [RoomTimelineItemProtocol] = [] + nonisolated(unsafe) var underlyingTimelineKind: TimelineKind! + nonisolated(unsafe) var timelineItems: [RoomTimelineItemProtocol] = [] var paginationState: TimelinePaginationState { get { return underlyingPaginationState } set(value) { underlyingPaginationState = value } } - var underlyingPaginationState: TimelinePaginationState! + nonisolated(unsafe) var underlyingPaginationState: TimelinePaginationState! var callbacks: PassthroughSubject { get { return underlyingCallbacks } set(value) { underlyingCallbacks = value } } - var underlyingCallbacks: PassthroughSubject! + nonisolated(unsafe) var underlyingCallbacks: PassthroughSubject! //MARK: - processItemAppearance private let processItemAppearanceCallsCountLock = NSLock() - private var processItemAppearanceUnderlyingCallsCount = 0 + private nonisolated(unsafe) var processItemAppearanceUnderlyingCallsCount = 0 var processItemAppearanceCallsCount: Int { get { processItemAppearanceCallsCountLock.withLock { processItemAppearanceUnderlyingCallsCount } } set { processItemAppearanceCallsCountLock.withLock { processItemAppearanceUnderlyingCallsCount = newValue } } @@ -11948,20 +11948,20 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { return processItemAppearanceCallsCount > 0 } private let processItemAppearanceReceivedItemIDLock = NSLock() - private var processItemAppearanceUnderlyingReceivedItemID: TimelineItemIdentifier? + private nonisolated(unsafe) var processItemAppearanceUnderlyingReceivedItemID: TimelineItemIdentifier? var processItemAppearanceReceivedItemID: TimelineItemIdentifier? { get { processItemAppearanceReceivedItemIDLock.withLock { processItemAppearanceUnderlyingReceivedItemID } } set { processItemAppearanceReceivedItemIDLock.withLock { processItemAppearanceUnderlyingReceivedItemID = newValue } } } private let processItemAppearanceReceivedInvocationsLock = NSLock() - private var processItemAppearanceUnderlyingReceivedInvocations: [TimelineItemIdentifier] = [] + private nonisolated(unsafe) var processItemAppearanceUnderlyingReceivedInvocations: [TimelineItemIdentifier] = [] var processItemAppearanceReceivedInvocations: [TimelineItemIdentifier] { get { processItemAppearanceReceivedInvocationsLock.withLock { processItemAppearanceUnderlyingReceivedInvocations } } set { processItemAppearanceReceivedInvocationsLock.withLock { processItemAppearanceUnderlyingReceivedInvocations = newValue } } } - var processItemAppearanceClosure: ((TimelineItemIdentifier) async -> Void)? + nonisolated(unsafe) var processItemAppearanceClosure: ((TimelineItemIdentifier) async -> Void)? - func processItemAppearance(_ itemID: TimelineItemIdentifier) async { + @concurrent func processItemAppearance(_ itemID: TimelineItemIdentifier) async { processItemAppearanceCallsCountLock.withLock { processItemAppearanceUnderlyingCallsCount += 1 } processItemAppearanceReceivedItemID = itemID processItemAppearanceReceivedInvocationsLock.withLock { processItemAppearanceUnderlyingReceivedInvocations.append(itemID) } @@ -11970,7 +11970,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - processItemDisappearance private let processItemDisappearanceCallsCountLock = NSLock() - private var processItemDisappearanceUnderlyingCallsCount = 0 + private nonisolated(unsafe) var processItemDisappearanceUnderlyingCallsCount = 0 var processItemDisappearanceCallsCount: Int { get { processItemDisappearanceCallsCountLock.withLock { processItemDisappearanceUnderlyingCallsCount } } set { processItemDisappearanceCallsCountLock.withLock { processItemDisappearanceUnderlyingCallsCount = newValue } } @@ -11979,20 +11979,20 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { return processItemDisappearanceCallsCount > 0 } private let processItemDisappearanceReceivedItemIDLock = NSLock() - private var processItemDisappearanceUnderlyingReceivedItemID: TimelineItemIdentifier? + private nonisolated(unsafe) var processItemDisappearanceUnderlyingReceivedItemID: TimelineItemIdentifier? var processItemDisappearanceReceivedItemID: TimelineItemIdentifier? { get { processItemDisappearanceReceivedItemIDLock.withLock { processItemDisappearanceUnderlyingReceivedItemID } } set { processItemDisappearanceReceivedItemIDLock.withLock { processItemDisappearanceUnderlyingReceivedItemID = newValue } } } private let processItemDisappearanceReceivedInvocationsLock = NSLock() - private var processItemDisappearanceUnderlyingReceivedInvocations: [TimelineItemIdentifier] = [] + private nonisolated(unsafe) var processItemDisappearanceUnderlyingReceivedInvocations: [TimelineItemIdentifier] = [] var processItemDisappearanceReceivedInvocations: [TimelineItemIdentifier] { get { processItemDisappearanceReceivedInvocationsLock.withLock { processItemDisappearanceUnderlyingReceivedInvocations } } set { processItemDisappearanceReceivedInvocationsLock.withLock { processItemDisappearanceUnderlyingReceivedInvocations = newValue } } } - var processItemDisappearanceClosure: ((TimelineItemIdentifier) async -> Void)? + nonisolated(unsafe) var processItemDisappearanceClosure: ((TimelineItemIdentifier) async -> Void)? - func processItemDisappearance(_ itemID: TimelineItemIdentifier) async { + @concurrent func processItemDisappearance(_ itemID: TimelineItemIdentifier) async { processItemDisappearanceCallsCountLock.withLock { processItemDisappearanceUnderlyingCallsCount += 1 } processItemDisappearanceReceivedItemID = itemID processItemDisappearanceReceivedInvocationsLock.withLock { processItemDisappearanceUnderlyingReceivedInvocations.append(itemID) } @@ -12001,7 +12001,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - focusOnEvent private let focusOnEventTimelineSizeCallsCountLock = NSLock() - private var focusOnEventTimelineSizeUnderlyingCallsCount = 0 + private nonisolated(unsafe) var focusOnEventTimelineSizeUnderlyingCallsCount = 0 var focusOnEventTimelineSizeCallsCount: Int { get { focusOnEventTimelineSizeCallsCountLock.withLock { focusOnEventTimelineSizeUnderlyingCallsCount } } set { focusOnEventTimelineSizeCallsCountLock.withLock { focusOnEventTimelineSizeUnderlyingCallsCount = newValue } } @@ -12010,27 +12010,27 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { return focusOnEventTimelineSizeCallsCount > 0 } private let focusOnEventTimelineSizeReceivedArgumentsLock = NSLock() - private var focusOnEventTimelineSizeUnderlyingReceivedArguments: (eventID: String, timelineSize: UInt16)? + private nonisolated(unsafe) var focusOnEventTimelineSizeUnderlyingReceivedArguments: (eventID: String, timelineSize: UInt16)? var focusOnEventTimelineSizeReceivedArguments: (eventID: String, timelineSize: UInt16)? { get { focusOnEventTimelineSizeReceivedArgumentsLock.withLock { focusOnEventTimelineSizeUnderlyingReceivedArguments } } set { focusOnEventTimelineSizeReceivedArgumentsLock.withLock { focusOnEventTimelineSizeUnderlyingReceivedArguments = newValue } } } private let focusOnEventTimelineSizeReceivedInvocationsLock = NSLock() - private var focusOnEventTimelineSizeUnderlyingReceivedInvocations: [(eventID: String, timelineSize: UInt16)] = [] + private nonisolated(unsafe) var focusOnEventTimelineSizeUnderlyingReceivedInvocations: [(eventID: String, timelineSize: UInt16)] = [] var focusOnEventTimelineSizeReceivedInvocations: [(eventID: String, timelineSize: UInt16)] { get { focusOnEventTimelineSizeReceivedInvocationsLock.withLock { focusOnEventTimelineSizeUnderlyingReceivedInvocations } } set { focusOnEventTimelineSizeReceivedInvocationsLock.withLock { focusOnEventTimelineSizeUnderlyingReceivedInvocations = newValue } } } private let focusOnEventTimelineSizeReturnValueLock = NSLock() - private var focusOnEventTimelineSizeUnderlyingReturnValue: Result! + private nonisolated(unsafe) var focusOnEventTimelineSizeUnderlyingReturnValue: Result! var focusOnEventTimelineSizeReturnValue: Result! { get { focusOnEventTimelineSizeReturnValueLock.withLock { focusOnEventTimelineSizeUnderlyingReturnValue } } set { focusOnEventTimelineSizeReturnValueLock.withLock { focusOnEventTimelineSizeUnderlyingReturnValue = newValue } } } - var focusOnEventTimelineSizeClosure: ((String, UInt16) async -> Result)? + nonisolated(unsafe) var focusOnEventTimelineSizeClosure: ((String, UInt16) async -> Result)? - func focusOnEvent(_ eventID: String, timelineSize: UInt16) async -> Result { + @concurrent func focusOnEvent(_ eventID: String, timelineSize: UInt16) async -> Result { focusOnEventTimelineSizeCallsCountLock.withLock { focusOnEventTimelineSizeUnderlyingCallsCount += 1 } focusOnEventTimelineSizeReceivedArguments = (eventID: eventID, timelineSize: timelineSize) focusOnEventTimelineSizeReceivedInvocationsLock.withLock { focusOnEventTimelineSizeUnderlyingReceivedInvocations.append((eventID: eventID, timelineSize: timelineSize)) } @@ -12043,7 +12043,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - focusLive private let focusLiveCallsCountLock = NSLock() - private var focusLiveUnderlyingCallsCount = 0 + private nonisolated(unsafe) var focusLiveUnderlyingCallsCount = 0 var focusLiveCallsCount: Int { get { focusLiveCallsCountLock.withLock { focusLiveUnderlyingCallsCount } } set { focusLiveCallsCountLock.withLock { focusLiveUnderlyingCallsCount = newValue } } @@ -12051,7 +12051,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { var focusLiveCalled: Bool { return focusLiveCallsCount > 0 } - var focusLiveClosure: (() -> Void)? + nonisolated(unsafe) var focusLiveClosure: (() -> Void)? func focusLive() { focusLiveCallsCountLock.withLock { focusLiveUnderlyingCallsCount += 1 } @@ -12060,7 +12060,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - paginateBackwards private let paginateBackwardsRequestSizeCallsCountLock = NSLock() - private var paginateBackwardsRequestSizeUnderlyingCallsCount = 0 + private nonisolated(unsafe) var paginateBackwardsRequestSizeUnderlyingCallsCount = 0 var paginateBackwardsRequestSizeCallsCount: Int { get { paginateBackwardsRequestSizeCallsCountLock.withLock { paginateBackwardsRequestSizeUnderlyingCallsCount } } set { paginateBackwardsRequestSizeCallsCountLock.withLock { paginateBackwardsRequestSizeUnderlyingCallsCount = newValue } } @@ -12069,27 +12069,27 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { return paginateBackwardsRequestSizeCallsCount > 0 } private let paginateBackwardsRequestSizeReceivedRequestSizeLock = NSLock() - private var paginateBackwardsRequestSizeUnderlyingReceivedRequestSize: UInt16? + private nonisolated(unsafe) var paginateBackwardsRequestSizeUnderlyingReceivedRequestSize: UInt16? var paginateBackwardsRequestSizeReceivedRequestSize: UInt16? { get { paginateBackwardsRequestSizeReceivedRequestSizeLock.withLock { paginateBackwardsRequestSizeUnderlyingReceivedRequestSize } } set { paginateBackwardsRequestSizeReceivedRequestSizeLock.withLock { paginateBackwardsRequestSizeUnderlyingReceivedRequestSize = newValue } } } private let paginateBackwardsRequestSizeReceivedInvocationsLock = NSLock() - private var paginateBackwardsRequestSizeUnderlyingReceivedInvocations: [UInt16] = [] + private nonisolated(unsafe) var paginateBackwardsRequestSizeUnderlyingReceivedInvocations: [UInt16] = [] var paginateBackwardsRequestSizeReceivedInvocations: [UInt16] { get { paginateBackwardsRequestSizeReceivedInvocationsLock.withLock { paginateBackwardsRequestSizeUnderlyingReceivedInvocations } } set { paginateBackwardsRequestSizeReceivedInvocationsLock.withLock { paginateBackwardsRequestSizeUnderlyingReceivedInvocations = newValue } } } private let paginateBackwardsRequestSizeReturnValueLock = NSLock() - private var paginateBackwardsRequestSizeUnderlyingReturnValue: Result! + private nonisolated(unsafe) var paginateBackwardsRequestSizeUnderlyingReturnValue: Result! var paginateBackwardsRequestSizeReturnValue: Result! { get { paginateBackwardsRequestSizeReturnValueLock.withLock { paginateBackwardsRequestSizeUnderlyingReturnValue } } set { paginateBackwardsRequestSizeReturnValueLock.withLock { paginateBackwardsRequestSizeUnderlyingReturnValue = newValue } } } - var paginateBackwardsRequestSizeClosure: ((UInt16) async -> Result)? + nonisolated(unsafe) var paginateBackwardsRequestSizeClosure: ((UInt16) async -> Result)? - func paginateBackwards(requestSize: UInt16) async -> Result { + @concurrent func paginateBackwards(requestSize: UInt16) async -> Result { paginateBackwardsRequestSizeCallsCountLock.withLock { paginateBackwardsRequestSizeUnderlyingCallsCount += 1 } paginateBackwardsRequestSizeReceivedRequestSize = requestSize paginateBackwardsRequestSizeReceivedInvocationsLock.withLock { paginateBackwardsRequestSizeUnderlyingReceivedInvocations.append(requestSize) } @@ -12102,7 +12102,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - paginateForwards private let paginateForwardsRequestSizeCallsCountLock = NSLock() - private var paginateForwardsRequestSizeUnderlyingCallsCount = 0 + private nonisolated(unsafe) var paginateForwardsRequestSizeUnderlyingCallsCount = 0 var paginateForwardsRequestSizeCallsCount: Int { get { paginateForwardsRequestSizeCallsCountLock.withLock { paginateForwardsRequestSizeUnderlyingCallsCount } } set { paginateForwardsRequestSizeCallsCountLock.withLock { paginateForwardsRequestSizeUnderlyingCallsCount = newValue } } @@ -12111,27 +12111,27 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { return paginateForwardsRequestSizeCallsCount > 0 } private let paginateForwardsRequestSizeReceivedRequestSizeLock = NSLock() - private var paginateForwardsRequestSizeUnderlyingReceivedRequestSize: UInt16? + private nonisolated(unsafe) var paginateForwardsRequestSizeUnderlyingReceivedRequestSize: UInt16? var paginateForwardsRequestSizeReceivedRequestSize: UInt16? { get { paginateForwardsRequestSizeReceivedRequestSizeLock.withLock { paginateForwardsRequestSizeUnderlyingReceivedRequestSize } } set { paginateForwardsRequestSizeReceivedRequestSizeLock.withLock { paginateForwardsRequestSizeUnderlyingReceivedRequestSize = newValue } } } private let paginateForwardsRequestSizeReceivedInvocationsLock = NSLock() - private var paginateForwardsRequestSizeUnderlyingReceivedInvocations: [UInt16] = [] + private nonisolated(unsafe) var paginateForwardsRequestSizeUnderlyingReceivedInvocations: [UInt16] = [] var paginateForwardsRequestSizeReceivedInvocations: [UInt16] { get { paginateForwardsRequestSizeReceivedInvocationsLock.withLock { paginateForwardsRequestSizeUnderlyingReceivedInvocations } } set { paginateForwardsRequestSizeReceivedInvocationsLock.withLock { paginateForwardsRequestSizeUnderlyingReceivedInvocations = newValue } } } private let paginateForwardsRequestSizeReturnValueLock = NSLock() - private var paginateForwardsRequestSizeUnderlyingReturnValue: Result! + private nonisolated(unsafe) var paginateForwardsRequestSizeUnderlyingReturnValue: Result! var paginateForwardsRequestSizeReturnValue: Result! { get { paginateForwardsRequestSizeReturnValueLock.withLock { paginateForwardsRequestSizeUnderlyingReturnValue } } set { paginateForwardsRequestSizeReturnValueLock.withLock { paginateForwardsRequestSizeUnderlyingReturnValue = newValue } } } - var paginateForwardsRequestSizeClosure: ((UInt16) async -> Result)? + nonisolated(unsafe) var paginateForwardsRequestSizeClosure: ((UInt16) async -> Result)? - func paginateForwards(requestSize: UInt16) async -> Result { + @concurrent func paginateForwards(requestSize: UInt16) async -> Result { paginateForwardsRequestSizeCallsCountLock.withLock { paginateForwardsRequestSizeUnderlyingCallsCount += 1 } paginateForwardsRequestSizeReceivedRequestSize = requestSize paginateForwardsRequestSizeReceivedInvocationsLock.withLock { paginateForwardsRequestSizeUnderlyingReceivedInvocations.append(requestSize) } @@ -12144,7 +12144,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - sendReadReceipt private let sendReadReceiptForCallsCountLock = NSLock() - private var sendReadReceiptForUnderlyingCallsCount = 0 + private nonisolated(unsafe) var sendReadReceiptForUnderlyingCallsCount = 0 var sendReadReceiptForCallsCount: Int { get { sendReadReceiptForCallsCountLock.withLock { sendReadReceiptForUnderlyingCallsCount } } set { sendReadReceiptForCallsCountLock.withLock { sendReadReceiptForUnderlyingCallsCount = newValue } } @@ -12153,20 +12153,20 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { return sendReadReceiptForCallsCount > 0 } private let sendReadReceiptForReceivedItemIDLock = NSLock() - private var sendReadReceiptForUnderlyingReceivedItemID: TimelineItemIdentifier? + private nonisolated(unsafe) var sendReadReceiptForUnderlyingReceivedItemID: TimelineItemIdentifier? var sendReadReceiptForReceivedItemID: TimelineItemIdentifier? { get { sendReadReceiptForReceivedItemIDLock.withLock { sendReadReceiptForUnderlyingReceivedItemID } } set { sendReadReceiptForReceivedItemIDLock.withLock { sendReadReceiptForUnderlyingReceivedItemID = newValue } } } private let sendReadReceiptForReceivedInvocationsLock = NSLock() - private var sendReadReceiptForUnderlyingReceivedInvocations: [TimelineItemIdentifier] = [] + private nonisolated(unsafe) var sendReadReceiptForUnderlyingReceivedInvocations: [TimelineItemIdentifier] = [] var sendReadReceiptForReceivedInvocations: [TimelineItemIdentifier] { get { sendReadReceiptForReceivedInvocationsLock.withLock { sendReadReceiptForUnderlyingReceivedInvocations } } set { sendReadReceiptForReceivedInvocationsLock.withLock { sendReadReceiptForUnderlyingReceivedInvocations = newValue } } } - var sendReadReceiptForClosure: ((TimelineItemIdentifier) async -> Void)? + nonisolated(unsafe) var sendReadReceiptForClosure: ((TimelineItemIdentifier) async -> Void)? - func sendReadReceipt(for itemID: TimelineItemIdentifier) async { + @concurrent func sendReadReceipt(for itemID: TimelineItemIdentifier) async { sendReadReceiptForCallsCountLock.withLock { sendReadReceiptForUnderlyingCallsCount += 1 } sendReadReceiptForReceivedItemID = itemID sendReadReceiptForReceivedInvocationsLock.withLock { sendReadReceiptForUnderlyingReceivedInvocations.append(itemID) } @@ -12175,7 +12175,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - edit private let editMessageHtmlIntentionalMentionsCallsCountLock = NSLock() - private var editMessageHtmlIntentionalMentionsUnderlyingCallsCount = 0 + private nonisolated(unsafe) var editMessageHtmlIntentionalMentionsUnderlyingCallsCount = 0 var editMessageHtmlIntentionalMentionsCallsCount: Int { get { editMessageHtmlIntentionalMentionsCallsCountLock.withLock { editMessageHtmlIntentionalMentionsUnderlyingCallsCount } } set { editMessageHtmlIntentionalMentionsCallsCountLock.withLock { editMessageHtmlIntentionalMentionsUnderlyingCallsCount = newValue } } @@ -12184,20 +12184,20 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { return editMessageHtmlIntentionalMentionsCallsCount > 0 } private let editMessageHtmlIntentionalMentionsReceivedArgumentsLock = NSLock() - private var editMessageHtmlIntentionalMentionsUnderlyingReceivedArguments: (eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, message: String, html: String?, intentionalMentions: IntentionalMentions)? + private nonisolated(unsafe) var editMessageHtmlIntentionalMentionsUnderlyingReceivedArguments: (eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, message: String, html: String?, intentionalMentions: IntentionalMentions)? var editMessageHtmlIntentionalMentionsReceivedArguments: (eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, message: String, html: String?, intentionalMentions: IntentionalMentions)? { get { editMessageHtmlIntentionalMentionsReceivedArgumentsLock.withLock { editMessageHtmlIntentionalMentionsUnderlyingReceivedArguments } } set { editMessageHtmlIntentionalMentionsReceivedArgumentsLock.withLock { editMessageHtmlIntentionalMentionsUnderlyingReceivedArguments = newValue } } } private let editMessageHtmlIntentionalMentionsReceivedInvocationsLock = NSLock() - private var editMessageHtmlIntentionalMentionsUnderlyingReceivedInvocations: [(eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, message: String, html: String?, intentionalMentions: IntentionalMentions)] = [] + private nonisolated(unsafe) var editMessageHtmlIntentionalMentionsUnderlyingReceivedInvocations: [(eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, message: String, html: String?, intentionalMentions: IntentionalMentions)] = [] var editMessageHtmlIntentionalMentionsReceivedInvocations: [(eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, message: String, html: String?, intentionalMentions: IntentionalMentions)] { get { editMessageHtmlIntentionalMentionsReceivedInvocationsLock.withLock { editMessageHtmlIntentionalMentionsUnderlyingReceivedInvocations } } set { editMessageHtmlIntentionalMentionsReceivedInvocationsLock.withLock { editMessageHtmlIntentionalMentionsUnderlyingReceivedInvocations = newValue } } } - var editMessageHtmlIntentionalMentionsClosure: ((TimelineItemIdentifier.EventOrTransactionID, String, String?, IntentionalMentions) async -> Void)? + nonisolated(unsafe) var editMessageHtmlIntentionalMentionsClosure: ((TimelineItemIdentifier.EventOrTransactionID, String, String?, IntentionalMentions) async -> Void)? - func edit(_ eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, message: String, html: String?, intentionalMentions: IntentionalMentions) async { + @concurrent func edit(_ eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, message: String, html: String?, intentionalMentions: IntentionalMentions) async { editMessageHtmlIntentionalMentionsCallsCountLock.withLock { editMessageHtmlIntentionalMentionsUnderlyingCallsCount += 1 } editMessageHtmlIntentionalMentionsReceivedArguments = (eventOrTransactionID: eventOrTransactionID, message: message, html: html, intentionalMentions: intentionalMentions) editMessageHtmlIntentionalMentionsReceivedInvocationsLock.withLock { editMessageHtmlIntentionalMentionsUnderlyingReceivedInvocations.append((eventOrTransactionID: eventOrTransactionID, message: message, html: html, intentionalMentions: intentionalMentions)) } @@ -12206,7 +12206,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - editCaption private let editCaptionMessageHtmlIntentionalMentionsCallsCountLock = NSLock() - private var editCaptionMessageHtmlIntentionalMentionsUnderlyingCallsCount = 0 + private nonisolated(unsafe) var editCaptionMessageHtmlIntentionalMentionsUnderlyingCallsCount = 0 var editCaptionMessageHtmlIntentionalMentionsCallsCount: Int { get { editCaptionMessageHtmlIntentionalMentionsCallsCountLock.withLock { editCaptionMessageHtmlIntentionalMentionsUnderlyingCallsCount } } set { editCaptionMessageHtmlIntentionalMentionsCallsCountLock.withLock { editCaptionMessageHtmlIntentionalMentionsUnderlyingCallsCount = newValue } } @@ -12215,20 +12215,20 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { return editCaptionMessageHtmlIntentionalMentionsCallsCount > 0 } private let editCaptionMessageHtmlIntentionalMentionsReceivedArgumentsLock = NSLock() - private var editCaptionMessageHtmlIntentionalMentionsUnderlyingReceivedArguments: (eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, message: String, html: String?, intentionalMentions: IntentionalMentions)? + private nonisolated(unsafe) var editCaptionMessageHtmlIntentionalMentionsUnderlyingReceivedArguments: (eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, message: String, html: String?, intentionalMentions: IntentionalMentions)? var editCaptionMessageHtmlIntentionalMentionsReceivedArguments: (eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, message: String, html: String?, intentionalMentions: IntentionalMentions)? { get { editCaptionMessageHtmlIntentionalMentionsReceivedArgumentsLock.withLock { editCaptionMessageHtmlIntentionalMentionsUnderlyingReceivedArguments } } set { editCaptionMessageHtmlIntentionalMentionsReceivedArgumentsLock.withLock { editCaptionMessageHtmlIntentionalMentionsUnderlyingReceivedArguments = newValue } } } private let editCaptionMessageHtmlIntentionalMentionsReceivedInvocationsLock = NSLock() - private var editCaptionMessageHtmlIntentionalMentionsUnderlyingReceivedInvocations: [(eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, message: String, html: String?, intentionalMentions: IntentionalMentions)] = [] + private nonisolated(unsafe) var editCaptionMessageHtmlIntentionalMentionsUnderlyingReceivedInvocations: [(eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, message: String, html: String?, intentionalMentions: IntentionalMentions)] = [] var editCaptionMessageHtmlIntentionalMentionsReceivedInvocations: [(eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, message: String, html: String?, intentionalMentions: IntentionalMentions)] { get { editCaptionMessageHtmlIntentionalMentionsReceivedInvocationsLock.withLock { editCaptionMessageHtmlIntentionalMentionsUnderlyingReceivedInvocations } } set { editCaptionMessageHtmlIntentionalMentionsReceivedInvocationsLock.withLock { editCaptionMessageHtmlIntentionalMentionsUnderlyingReceivedInvocations = newValue } } } - var editCaptionMessageHtmlIntentionalMentionsClosure: ((TimelineItemIdentifier.EventOrTransactionID, String, String?, IntentionalMentions) async -> Void)? + nonisolated(unsafe) var editCaptionMessageHtmlIntentionalMentionsClosure: ((TimelineItemIdentifier.EventOrTransactionID, String, String?, IntentionalMentions) async -> Void)? - func editCaption(_ eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, message: String, html: String?, intentionalMentions: IntentionalMentions) async { + @concurrent func editCaption(_ eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, message: String, html: String?, intentionalMentions: IntentionalMentions) async { editCaptionMessageHtmlIntentionalMentionsCallsCountLock.withLock { editCaptionMessageHtmlIntentionalMentionsUnderlyingCallsCount += 1 } editCaptionMessageHtmlIntentionalMentionsReceivedArguments = (eventOrTransactionID: eventOrTransactionID, message: message, html: html, intentionalMentions: intentionalMentions) editCaptionMessageHtmlIntentionalMentionsReceivedInvocationsLock.withLock { editCaptionMessageHtmlIntentionalMentionsUnderlyingReceivedInvocations.append((eventOrTransactionID: eventOrTransactionID, message: message, html: html, intentionalMentions: intentionalMentions)) } @@ -12237,7 +12237,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - removeCaption private let removeCaptionCallsCountLock = NSLock() - private var removeCaptionUnderlyingCallsCount = 0 + private nonisolated(unsafe) var removeCaptionUnderlyingCallsCount = 0 var removeCaptionCallsCount: Int { get { removeCaptionCallsCountLock.withLock { removeCaptionUnderlyingCallsCount } } set { removeCaptionCallsCountLock.withLock { removeCaptionUnderlyingCallsCount = newValue } } @@ -12246,20 +12246,20 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { return removeCaptionCallsCount > 0 } private let removeCaptionReceivedEventOrTransactionIDLock = NSLock() - private var removeCaptionUnderlyingReceivedEventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID? + private nonisolated(unsafe) var removeCaptionUnderlyingReceivedEventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID? var removeCaptionReceivedEventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID? { get { removeCaptionReceivedEventOrTransactionIDLock.withLock { removeCaptionUnderlyingReceivedEventOrTransactionID } } set { removeCaptionReceivedEventOrTransactionIDLock.withLock { removeCaptionUnderlyingReceivedEventOrTransactionID = newValue } } } private let removeCaptionReceivedInvocationsLock = NSLock() - private var removeCaptionUnderlyingReceivedInvocations: [TimelineItemIdentifier.EventOrTransactionID] = [] + private nonisolated(unsafe) var removeCaptionUnderlyingReceivedInvocations: [TimelineItemIdentifier.EventOrTransactionID] = [] var removeCaptionReceivedInvocations: [TimelineItemIdentifier.EventOrTransactionID] { get { removeCaptionReceivedInvocationsLock.withLock { removeCaptionUnderlyingReceivedInvocations } } set { removeCaptionReceivedInvocationsLock.withLock { removeCaptionUnderlyingReceivedInvocations = newValue } } } - var removeCaptionClosure: ((TimelineItemIdentifier.EventOrTransactionID) async -> Void)? + nonisolated(unsafe) var removeCaptionClosure: ((TimelineItemIdentifier.EventOrTransactionID) async -> Void)? - func removeCaption(_ eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID) async { + @concurrent func removeCaption(_ eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID) async { removeCaptionCallsCountLock.withLock { removeCaptionUnderlyingCallsCount += 1 } removeCaptionReceivedEventOrTransactionID = eventOrTransactionID removeCaptionReceivedInvocationsLock.withLock { removeCaptionUnderlyingReceivedInvocations.append(eventOrTransactionID) } @@ -12268,7 +12268,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - toggleReaction private let toggleReactionToCallsCountLock = NSLock() - private var toggleReactionToUnderlyingCallsCount = 0 + private nonisolated(unsafe) var toggleReactionToUnderlyingCallsCount = 0 var toggleReactionToCallsCount: Int { get { toggleReactionToCallsCountLock.withLock { toggleReactionToUnderlyingCallsCount } } set { toggleReactionToCallsCountLock.withLock { toggleReactionToUnderlyingCallsCount = newValue } } @@ -12277,20 +12277,20 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { return toggleReactionToCallsCount > 0 } private let toggleReactionToReceivedArgumentsLock = NSLock() - private var toggleReactionToUnderlyingReceivedArguments: (reaction: String, eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID)? + private nonisolated(unsafe) var toggleReactionToUnderlyingReceivedArguments: (reaction: String, eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID)? var toggleReactionToReceivedArguments: (reaction: String, eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID)? { get { toggleReactionToReceivedArgumentsLock.withLock { toggleReactionToUnderlyingReceivedArguments } } set { toggleReactionToReceivedArgumentsLock.withLock { toggleReactionToUnderlyingReceivedArguments = newValue } } } private let toggleReactionToReceivedInvocationsLock = NSLock() - private var toggleReactionToUnderlyingReceivedInvocations: [(reaction: String, eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID)] = [] + private nonisolated(unsafe) var toggleReactionToUnderlyingReceivedInvocations: [(reaction: String, eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID)] = [] var toggleReactionToReceivedInvocations: [(reaction: String, eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID)] { get { toggleReactionToReceivedInvocationsLock.withLock { toggleReactionToUnderlyingReceivedInvocations } } set { toggleReactionToReceivedInvocationsLock.withLock { toggleReactionToUnderlyingReceivedInvocations = newValue } } } - var toggleReactionToClosure: ((String, TimelineItemIdentifier.EventOrTransactionID) async -> Void)? + nonisolated(unsafe) var toggleReactionToClosure: ((String, TimelineItemIdentifier.EventOrTransactionID) async -> Void)? - func toggleReaction(_ reaction: String, to eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID) async { + @concurrent func toggleReaction(_ reaction: String, to eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID) async { toggleReactionToCallsCountLock.withLock { toggleReactionToUnderlyingCallsCount += 1 } toggleReactionToReceivedArguments = (reaction: reaction, eventOrTransactionID: eventOrTransactionID) toggleReactionToReceivedInvocationsLock.withLock { toggleReactionToUnderlyingReceivedInvocations.append((reaction: reaction, eventOrTransactionID: eventOrTransactionID)) } @@ -12299,7 +12299,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - redact private let redactCallsCountLock = NSLock() - private var redactUnderlyingCallsCount = 0 + private nonisolated(unsafe) var redactUnderlyingCallsCount = 0 var redactCallsCount: Int { get { redactCallsCountLock.withLock { redactUnderlyingCallsCount } } set { redactCallsCountLock.withLock { redactUnderlyingCallsCount = newValue } } @@ -12308,20 +12308,20 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { return redactCallsCount > 0 } private let redactReceivedEventOrTransactionIDLock = NSLock() - private var redactUnderlyingReceivedEventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID? + private nonisolated(unsafe) var redactUnderlyingReceivedEventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID? var redactReceivedEventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID? { get { redactReceivedEventOrTransactionIDLock.withLock { redactUnderlyingReceivedEventOrTransactionID } } set { redactReceivedEventOrTransactionIDLock.withLock { redactUnderlyingReceivedEventOrTransactionID = newValue } } } private let redactReceivedInvocationsLock = NSLock() - private var redactUnderlyingReceivedInvocations: [TimelineItemIdentifier.EventOrTransactionID] = [] + private nonisolated(unsafe) var redactUnderlyingReceivedInvocations: [TimelineItemIdentifier.EventOrTransactionID] = [] var redactReceivedInvocations: [TimelineItemIdentifier.EventOrTransactionID] { get { redactReceivedInvocationsLock.withLock { redactUnderlyingReceivedInvocations } } set { redactReceivedInvocationsLock.withLock { redactUnderlyingReceivedInvocations = newValue } } } - var redactClosure: ((TimelineItemIdentifier.EventOrTransactionID) async -> Void)? + nonisolated(unsafe) var redactClosure: ((TimelineItemIdentifier.EventOrTransactionID) async -> Void)? - func redact(_ eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID) async { + @concurrent func redact(_ eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID) async { redactCallsCountLock.withLock { redactUnderlyingCallsCount += 1 } redactReceivedEventOrTransactionID = eventOrTransactionID redactReceivedInvocationsLock.withLock { redactUnderlyingReceivedInvocations.append(eventOrTransactionID) } @@ -12330,7 +12330,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - pin private let pinEventIDCallsCountLock = NSLock() - private var pinEventIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var pinEventIDUnderlyingCallsCount = 0 var pinEventIDCallsCount: Int { get { pinEventIDCallsCountLock.withLock { pinEventIDUnderlyingCallsCount } } set { pinEventIDCallsCountLock.withLock { pinEventIDUnderlyingCallsCount = newValue } } @@ -12339,20 +12339,20 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { return pinEventIDCallsCount > 0 } private let pinEventIDReceivedEventIDLock = NSLock() - private var pinEventIDUnderlyingReceivedEventID: String? + private nonisolated(unsafe) var pinEventIDUnderlyingReceivedEventID: String? var pinEventIDReceivedEventID: String? { get { pinEventIDReceivedEventIDLock.withLock { pinEventIDUnderlyingReceivedEventID } } set { pinEventIDReceivedEventIDLock.withLock { pinEventIDUnderlyingReceivedEventID = newValue } } } private let pinEventIDReceivedInvocationsLock = NSLock() - private var pinEventIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var pinEventIDUnderlyingReceivedInvocations: [String] = [] var pinEventIDReceivedInvocations: [String] { get { pinEventIDReceivedInvocationsLock.withLock { pinEventIDUnderlyingReceivedInvocations } } set { pinEventIDReceivedInvocationsLock.withLock { pinEventIDUnderlyingReceivedInvocations = newValue } } } - var pinEventIDClosure: ((String) async -> Void)? + nonisolated(unsafe) var pinEventIDClosure: ((String) async -> Void)? - func pin(eventID: String) async { + @concurrent func pin(eventID: String) async { pinEventIDCallsCountLock.withLock { pinEventIDUnderlyingCallsCount += 1 } pinEventIDReceivedEventID = eventID pinEventIDReceivedInvocationsLock.withLock { pinEventIDUnderlyingReceivedInvocations.append(eventID) } @@ -12361,7 +12361,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - unpin private let unpinEventIDCallsCountLock = NSLock() - private var unpinEventIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var unpinEventIDUnderlyingCallsCount = 0 var unpinEventIDCallsCount: Int { get { unpinEventIDCallsCountLock.withLock { unpinEventIDUnderlyingCallsCount } } set { unpinEventIDCallsCountLock.withLock { unpinEventIDUnderlyingCallsCount = newValue } } @@ -12370,20 +12370,20 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { return unpinEventIDCallsCount > 0 } private let unpinEventIDReceivedEventIDLock = NSLock() - private var unpinEventIDUnderlyingReceivedEventID: String? + private nonisolated(unsafe) var unpinEventIDUnderlyingReceivedEventID: String? var unpinEventIDReceivedEventID: String? { get { unpinEventIDReceivedEventIDLock.withLock { unpinEventIDUnderlyingReceivedEventID } } set { unpinEventIDReceivedEventIDLock.withLock { unpinEventIDUnderlyingReceivedEventID = newValue } } } private let unpinEventIDReceivedInvocationsLock = NSLock() - private var unpinEventIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var unpinEventIDUnderlyingReceivedInvocations: [String] = [] var unpinEventIDReceivedInvocations: [String] { get { unpinEventIDReceivedInvocationsLock.withLock { unpinEventIDUnderlyingReceivedInvocations } } set { unpinEventIDReceivedInvocationsLock.withLock { unpinEventIDUnderlyingReceivedInvocations = newValue } } } - var unpinEventIDClosure: ((String) async -> Void)? + nonisolated(unsafe) var unpinEventIDClosure: ((String) async -> Void)? - func unpin(eventID: String) async { + @concurrent func unpin(eventID: String) async { unpinEventIDCallsCountLock.withLock { unpinEventIDUnderlyingCallsCount += 1 } unpinEventIDReceivedEventID = eventID unpinEventIDReceivedInvocationsLock.withLock { unpinEventIDUnderlyingReceivedInvocations.append(eventID) } @@ -12392,7 +12392,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - messageEventContent private let messageEventContentForCallsCountLock = NSLock() - private var messageEventContentForUnderlyingCallsCount = 0 + private nonisolated(unsafe) var messageEventContentForUnderlyingCallsCount = 0 var messageEventContentForCallsCount: Int { get { messageEventContentForCallsCountLock.withLock { messageEventContentForUnderlyingCallsCount } } set { messageEventContentForCallsCountLock.withLock { messageEventContentForUnderlyingCallsCount = newValue } } @@ -12401,27 +12401,27 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { return messageEventContentForCallsCount > 0 } private let messageEventContentForReceivedItemIDLock = NSLock() - private var messageEventContentForUnderlyingReceivedItemID: TimelineItemIdentifier? + private nonisolated(unsafe) var messageEventContentForUnderlyingReceivedItemID: TimelineItemIdentifier? var messageEventContentForReceivedItemID: TimelineItemIdentifier? { get { messageEventContentForReceivedItemIDLock.withLock { messageEventContentForUnderlyingReceivedItemID } } set { messageEventContentForReceivedItemIDLock.withLock { messageEventContentForUnderlyingReceivedItemID = newValue } } } private let messageEventContentForReceivedInvocationsLock = NSLock() - private var messageEventContentForUnderlyingReceivedInvocations: [TimelineItemIdentifier] = [] + private nonisolated(unsafe) var messageEventContentForUnderlyingReceivedInvocations: [TimelineItemIdentifier] = [] var messageEventContentForReceivedInvocations: [TimelineItemIdentifier] { get { messageEventContentForReceivedInvocationsLock.withLock { messageEventContentForUnderlyingReceivedInvocations } } set { messageEventContentForReceivedInvocationsLock.withLock { messageEventContentForUnderlyingReceivedInvocations = newValue } } } private let messageEventContentForReturnValueLock = NSLock() - private var messageEventContentForUnderlyingReturnValue: RoomMessageEventContentWithoutRelation? + private nonisolated(unsafe) var messageEventContentForUnderlyingReturnValue: RoomMessageEventContentWithoutRelation? var messageEventContentForReturnValue: RoomMessageEventContentWithoutRelation? { get { messageEventContentForReturnValueLock.withLock { messageEventContentForUnderlyingReturnValue } } set { messageEventContentForReturnValueLock.withLock { messageEventContentForUnderlyingReturnValue = newValue } } } - var messageEventContentForClosure: ((TimelineItemIdentifier) async -> RoomMessageEventContentWithoutRelation?)? + nonisolated(unsafe) var messageEventContentForClosure: ((TimelineItemIdentifier) async -> RoomMessageEventContentWithoutRelation?)? - func messageEventContent(for itemID: TimelineItemIdentifier) async -> RoomMessageEventContentWithoutRelation? { + @concurrent func messageEventContent(for itemID: TimelineItemIdentifier) async -> RoomMessageEventContentWithoutRelation? { messageEventContentForCallsCountLock.withLock { messageEventContentForUnderlyingCallsCount += 1 } messageEventContentForReceivedItemID = itemID messageEventContentForReceivedInvocationsLock.withLock { messageEventContentForUnderlyingReceivedInvocations.append(itemID) } @@ -12434,7 +12434,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - debugInfo private let debugInfoForCallsCountLock = NSLock() - private var debugInfoForUnderlyingCallsCount = 0 + private nonisolated(unsafe) var debugInfoForUnderlyingCallsCount = 0 var debugInfoForCallsCount: Int { get { debugInfoForCallsCountLock.withLock { debugInfoForUnderlyingCallsCount } } set { debugInfoForCallsCountLock.withLock { debugInfoForUnderlyingCallsCount = newValue } } @@ -12443,25 +12443,25 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { return debugInfoForCallsCount > 0 } private let debugInfoForReceivedItemIDLock = NSLock() - private var debugInfoForUnderlyingReceivedItemID: TimelineItemIdentifier? + private nonisolated(unsafe) var debugInfoForUnderlyingReceivedItemID: TimelineItemIdentifier? var debugInfoForReceivedItemID: TimelineItemIdentifier? { get { debugInfoForReceivedItemIDLock.withLock { debugInfoForUnderlyingReceivedItemID } } set { debugInfoForReceivedItemIDLock.withLock { debugInfoForUnderlyingReceivedItemID = newValue } } } private let debugInfoForReceivedInvocationsLock = NSLock() - private var debugInfoForUnderlyingReceivedInvocations: [TimelineItemIdentifier] = [] + private nonisolated(unsafe) var debugInfoForUnderlyingReceivedInvocations: [TimelineItemIdentifier] = [] var debugInfoForReceivedInvocations: [TimelineItemIdentifier] { get { debugInfoForReceivedInvocationsLock.withLock { debugInfoForUnderlyingReceivedInvocations } } set { debugInfoForReceivedInvocationsLock.withLock { debugInfoForUnderlyingReceivedInvocations = newValue } } } private let debugInfoForReturnValueLock = NSLock() - private var debugInfoForUnderlyingReturnValue: TimelineItemDebugInfo! + private nonisolated(unsafe) var debugInfoForUnderlyingReturnValue: TimelineItemDebugInfo! var debugInfoForReturnValue: TimelineItemDebugInfo! { get { debugInfoForReturnValueLock.withLock { debugInfoForUnderlyingReturnValue } } set { debugInfoForReturnValueLock.withLock { debugInfoForUnderlyingReturnValue = newValue } } } - var debugInfoForClosure: ((TimelineItemIdentifier) -> TimelineItemDebugInfo)? + nonisolated(unsafe) var debugInfoForClosure: ((TimelineItemIdentifier) -> TimelineItemDebugInfo)? func debugInfo(for itemID: TimelineItemIdentifier) -> TimelineItemDebugInfo { debugInfoForCallsCountLock.withLock { debugInfoForUnderlyingCallsCount += 1 } @@ -12476,7 +12476,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - sendHandle private let sendHandleForCallsCountLock = NSLock() - private var sendHandleForUnderlyingCallsCount = 0 + private nonisolated(unsafe) var sendHandleForUnderlyingCallsCount = 0 var sendHandleForCallsCount: Int { get { sendHandleForCallsCountLock.withLock { sendHandleForUnderlyingCallsCount } } set { sendHandleForCallsCountLock.withLock { sendHandleForUnderlyingCallsCount = newValue } } @@ -12485,25 +12485,25 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { return sendHandleForCallsCount > 0 } private let sendHandleForReceivedItemIDLock = NSLock() - private var sendHandleForUnderlyingReceivedItemID: TimelineItemIdentifier? + private nonisolated(unsafe) var sendHandleForUnderlyingReceivedItemID: TimelineItemIdentifier? var sendHandleForReceivedItemID: TimelineItemIdentifier? { get { sendHandleForReceivedItemIDLock.withLock { sendHandleForUnderlyingReceivedItemID } } set { sendHandleForReceivedItemIDLock.withLock { sendHandleForUnderlyingReceivedItemID = newValue } } } private let sendHandleForReceivedInvocationsLock = NSLock() - private var sendHandleForUnderlyingReceivedInvocations: [TimelineItemIdentifier] = [] + private nonisolated(unsafe) var sendHandleForUnderlyingReceivedInvocations: [TimelineItemIdentifier] = [] var sendHandleForReceivedInvocations: [TimelineItemIdentifier] { get { sendHandleForReceivedInvocationsLock.withLock { sendHandleForUnderlyingReceivedInvocations } } set { sendHandleForReceivedInvocationsLock.withLock { sendHandleForUnderlyingReceivedInvocations = newValue } } } private let sendHandleForReturnValueLock = NSLock() - private var sendHandleForUnderlyingReturnValue: SendHandleProxy? + private nonisolated(unsafe) var sendHandleForUnderlyingReturnValue: SendHandleProxy? var sendHandleForReturnValue: SendHandleProxy? { get { sendHandleForReturnValueLock.withLock { sendHandleForUnderlyingReturnValue } } set { sendHandleForReturnValueLock.withLock { sendHandleForUnderlyingReturnValue = newValue } } } - var sendHandleForClosure: ((TimelineItemIdentifier) -> SendHandleProxy?)? + nonisolated(unsafe) var sendHandleForClosure: ((TimelineItemIdentifier) -> SendHandleProxy?)? func sendHandle(for itemID: TimelineItemIdentifier) -> SendHandleProxy? { sendHandleForCallsCountLock.withLock { sendHandleForUnderlyingCallsCount += 1 } @@ -12518,7 +12518,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - eventTimestamp private let eventTimestampForCallsCountLock = NSLock() - private var eventTimestampForUnderlyingCallsCount = 0 + private nonisolated(unsafe) var eventTimestampForUnderlyingCallsCount = 0 var eventTimestampForCallsCount: Int { get { eventTimestampForCallsCountLock.withLock { eventTimestampForUnderlyingCallsCount } } set { eventTimestampForCallsCountLock.withLock { eventTimestampForUnderlyingCallsCount = newValue } } @@ -12527,25 +12527,25 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { return eventTimestampForCallsCount > 0 } private let eventTimestampForReceivedItemIDLock = NSLock() - private var eventTimestampForUnderlyingReceivedItemID: TimelineItemIdentifier? + private nonisolated(unsafe) var eventTimestampForUnderlyingReceivedItemID: TimelineItemIdentifier? var eventTimestampForReceivedItemID: TimelineItemIdentifier? { get { eventTimestampForReceivedItemIDLock.withLock { eventTimestampForUnderlyingReceivedItemID } } set { eventTimestampForReceivedItemIDLock.withLock { eventTimestampForUnderlyingReceivedItemID = newValue } } } private let eventTimestampForReceivedInvocationsLock = NSLock() - private var eventTimestampForUnderlyingReceivedInvocations: [TimelineItemIdentifier] = [] + private nonisolated(unsafe) var eventTimestampForUnderlyingReceivedInvocations: [TimelineItemIdentifier] = [] var eventTimestampForReceivedInvocations: [TimelineItemIdentifier] { get { eventTimestampForReceivedInvocationsLock.withLock { eventTimestampForUnderlyingReceivedInvocations } } set { eventTimestampForReceivedInvocationsLock.withLock { eventTimestampForUnderlyingReceivedInvocations = newValue } } } private let eventTimestampForReturnValueLock = NSLock() - private var eventTimestampForUnderlyingReturnValue: Date? + private nonisolated(unsafe) var eventTimestampForUnderlyingReturnValue: Date? var eventTimestampForReturnValue: Date? { get { eventTimestampForReturnValueLock.withLock { eventTimestampForUnderlyingReturnValue } } set { eventTimestampForReturnValueLock.withLock { eventTimestampForUnderlyingReturnValue = newValue } } } - var eventTimestampForClosure: ((TimelineItemIdentifier) -> Date?)? + nonisolated(unsafe) var eventTimestampForClosure: ((TimelineItemIdentifier) -> Date?)? func eventTimestamp(for itemID: TimelineItemIdentifier) -> Date? { eventTimestampForCallsCountLock.withLock { eventTimestampForUnderlyingCallsCount += 1 } @@ -12560,7 +12560,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - sendMessage private let sendMessageHtmlInReplyToEventIDIntentionalMentionsCallsCountLock = NSLock() - private var sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingCallsCount = 0 + private nonisolated(unsafe) var sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingCallsCount = 0 var sendMessageHtmlInReplyToEventIDIntentionalMentionsCallsCount: Int { get { sendMessageHtmlInReplyToEventIDIntentionalMentionsCallsCountLock.withLock { sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingCallsCount } } set { sendMessageHtmlInReplyToEventIDIntentionalMentionsCallsCountLock.withLock { sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingCallsCount = newValue } } @@ -12569,20 +12569,20 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { return sendMessageHtmlInReplyToEventIDIntentionalMentionsCallsCount > 0 } private let sendMessageHtmlInReplyToEventIDIntentionalMentionsReceivedArgumentsLock = NSLock() - private var sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingReceivedArguments: (message: String, html: String?, inReplyToEventID: String?, intentionalMentions: IntentionalMentions)? + private nonisolated(unsafe) var sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingReceivedArguments: (message: String, html: String?, inReplyToEventID: String?, intentionalMentions: IntentionalMentions)? var sendMessageHtmlInReplyToEventIDIntentionalMentionsReceivedArguments: (message: String, html: String?, inReplyToEventID: String?, intentionalMentions: IntentionalMentions)? { get { sendMessageHtmlInReplyToEventIDIntentionalMentionsReceivedArgumentsLock.withLock { sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingReceivedArguments } } set { sendMessageHtmlInReplyToEventIDIntentionalMentionsReceivedArgumentsLock.withLock { sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingReceivedArguments = newValue } } } private let sendMessageHtmlInReplyToEventIDIntentionalMentionsReceivedInvocationsLock = NSLock() - private var sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingReceivedInvocations: [(message: String, html: String?, inReplyToEventID: String?, intentionalMentions: IntentionalMentions)] = [] + private nonisolated(unsafe) var sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingReceivedInvocations: [(message: String, html: String?, inReplyToEventID: String?, intentionalMentions: IntentionalMentions)] = [] var sendMessageHtmlInReplyToEventIDIntentionalMentionsReceivedInvocations: [(message: String, html: String?, inReplyToEventID: String?, intentionalMentions: IntentionalMentions)] { get { sendMessageHtmlInReplyToEventIDIntentionalMentionsReceivedInvocationsLock.withLock { sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingReceivedInvocations } } set { sendMessageHtmlInReplyToEventIDIntentionalMentionsReceivedInvocationsLock.withLock { sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingReceivedInvocations = newValue } } } - var sendMessageHtmlInReplyToEventIDIntentionalMentionsClosure: ((String, String?, String?, IntentionalMentions) async -> Void)? + nonisolated(unsafe) var sendMessageHtmlInReplyToEventIDIntentionalMentionsClosure: ((String, String?, String?, IntentionalMentions) async -> Void)? - func sendMessage(_ message: String, html: String?, inReplyToEventID: String?, intentionalMentions: IntentionalMentions) async { + @concurrent func sendMessage(_ message: String, html: String?, inReplyToEventID: String?, intentionalMentions: IntentionalMentions) async { sendMessageHtmlInReplyToEventIDIntentionalMentionsCallsCountLock.withLock { sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingCallsCount += 1 } sendMessageHtmlInReplyToEventIDIntentionalMentionsReceivedArguments = (message: message, html: html, inReplyToEventID: inReplyToEventID, intentionalMentions: intentionalMentions) sendMessageHtmlInReplyToEventIDIntentionalMentionsReceivedInvocationsLock.withLock { sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingReceivedInvocations.append((message: message, html: html, inReplyToEventID: inReplyToEventID, intentionalMentions: intentionalMentions)) } @@ -12591,7 +12591,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - sendAudio private let sendAudioUrlAudioInfoCaptionRequestHandleCallsCountLock = NSLock() - private var sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingCallsCount = 0 + private nonisolated(unsafe) var sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingCallsCount = 0 var sendAudioUrlAudioInfoCaptionRequestHandleCallsCount: Int { get { sendAudioUrlAudioInfoCaptionRequestHandleCallsCountLock.withLock { sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingCallsCount } } set { sendAudioUrlAudioInfoCaptionRequestHandleCallsCountLock.withLock { sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingCallsCount = newValue } } @@ -12601,14 +12601,14 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { } private let sendAudioUrlAudioInfoCaptionRequestHandleReturnValueLock = NSLock() - private var sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingReturnValue: Result! + private nonisolated(unsafe) var sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingReturnValue: Result! var sendAudioUrlAudioInfoCaptionRequestHandleReturnValue: Result! { get { sendAudioUrlAudioInfoCaptionRequestHandleReturnValueLock.withLock { sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingReturnValue } } set { sendAudioUrlAudioInfoCaptionRequestHandleReturnValueLock.withLock { sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingReturnValue = newValue } } } - var sendAudioUrlAudioInfoCaptionRequestHandleClosure: ((URL, AudioInfo, String?, @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? + nonisolated(unsafe) var sendAudioUrlAudioInfoCaptionRequestHandleClosure: ((URL, AudioInfo, String?, @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? - func sendAudio(url: URL, audioInfo: AudioInfo, caption: String?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { + @concurrent func sendAudio(url: URL, audioInfo: AudioInfo, caption: String?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { sendAudioUrlAudioInfoCaptionRequestHandleCallsCountLock.withLock { sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingCallsCount += 1 } if let sendAudioUrlAudioInfoCaptionRequestHandleClosure = sendAudioUrlAudioInfoCaptionRequestHandleClosure { return await sendAudioUrlAudioInfoCaptionRequestHandleClosure(url, audioInfo, caption, requestHandle) @@ -12619,7 +12619,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - sendFile private let sendFileUrlFileInfoCaptionRequestHandleCallsCountLock = NSLock() - private var sendFileUrlFileInfoCaptionRequestHandleUnderlyingCallsCount = 0 + private nonisolated(unsafe) var sendFileUrlFileInfoCaptionRequestHandleUnderlyingCallsCount = 0 var sendFileUrlFileInfoCaptionRequestHandleCallsCount: Int { get { sendFileUrlFileInfoCaptionRequestHandleCallsCountLock.withLock { sendFileUrlFileInfoCaptionRequestHandleUnderlyingCallsCount } } set { sendFileUrlFileInfoCaptionRequestHandleCallsCountLock.withLock { sendFileUrlFileInfoCaptionRequestHandleUnderlyingCallsCount = newValue } } @@ -12629,14 +12629,14 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { } private let sendFileUrlFileInfoCaptionRequestHandleReturnValueLock = NSLock() - private var sendFileUrlFileInfoCaptionRequestHandleUnderlyingReturnValue: Result! + private nonisolated(unsafe) var sendFileUrlFileInfoCaptionRequestHandleUnderlyingReturnValue: Result! var sendFileUrlFileInfoCaptionRequestHandleReturnValue: Result! { get { sendFileUrlFileInfoCaptionRequestHandleReturnValueLock.withLock { sendFileUrlFileInfoCaptionRequestHandleUnderlyingReturnValue } } set { sendFileUrlFileInfoCaptionRequestHandleReturnValueLock.withLock { sendFileUrlFileInfoCaptionRequestHandleUnderlyingReturnValue = newValue } } } - var sendFileUrlFileInfoCaptionRequestHandleClosure: ((URL, FileInfo, String?, @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? + nonisolated(unsafe) var sendFileUrlFileInfoCaptionRequestHandleClosure: ((URL, FileInfo, String?, @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? - func sendFile(url: URL, fileInfo: FileInfo, caption: String?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { + @concurrent func sendFile(url: URL, fileInfo: FileInfo, caption: String?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { sendFileUrlFileInfoCaptionRequestHandleCallsCountLock.withLock { sendFileUrlFileInfoCaptionRequestHandleUnderlyingCallsCount += 1 } if let sendFileUrlFileInfoCaptionRequestHandleClosure = sendFileUrlFileInfoCaptionRequestHandleClosure { return await sendFileUrlFileInfoCaptionRequestHandleClosure(url, fileInfo, caption, requestHandle) @@ -12647,7 +12647,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - sendImage private let sendImageUrlThumbnailURLImageInfoCaptionRequestHandleCallsCountLock = NSLock() - private var sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingCallsCount = 0 + private nonisolated(unsafe) var sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingCallsCount = 0 var sendImageUrlThumbnailURLImageInfoCaptionRequestHandleCallsCount: Int { get { sendImageUrlThumbnailURLImageInfoCaptionRequestHandleCallsCountLock.withLock { sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingCallsCount } } set { sendImageUrlThumbnailURLImageInfoCaptionRequestHandleCallsCountLock.withLock { sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingCallsCount = newValue } } @@ -12657,14 +12657,14 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { } private let sendImageUrlThumbnailURLImageInfoCaptionRequestHandleReturnValueLock = NSLock() - private var sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingReturnValue: Result! + private nonisolated(unsafe) var sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingReturnValue: Result! var sendImageUrlThumbnailURLImageInfoCaptionRequestHandleReturnValue: Result! { get { sendImageUrlThumbnailURLImageInfoCaptionRequestHandleReturnValueLock.withLock { sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingReturnValue } } set { sendImageUrlThumbnailURLImageInfoCaptionRequestHandleReturnValueLock.withLock { sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingReturnValue = newValue } } } - var sendImageUrlThumbnailURLImageInfoCaptionRequestHandleClosure: ((URL, URL, ImageInfo, String?, @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? + nonisolated(unsafe) var sendImageUrlThumbnailURLImageInfoCaptionRequestHandleClosure: ((URL, URL, ImageInfo, String?, @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? - func sendImage(url: URL, thumbnailURL: URL, imageInfo: ImageInfo, caption: String?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { + @concurrent func sendImage(url: URL, thumbnailURL: URL, imageInfo: ImageInfo, caption: String?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { sendImageUrlThumbnailURLImageInfoCaptionRequestHandleCallsCountLock.withLock { sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingCallsCount += 1 } if let sendImageUrlThumbnailURLImageInfoCaptionRequestHandleClosure = sendImageUrlThumbnailURLImageInfoCaptionRequestHandleClosure { return await sendImageUrlThumbnailURLImageInfoCaptionRequestHandleClosure(url, thumbnailURL, imageInfo, caption, requestHandle) @@ -12675,7 +12675,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - sendLocation private let sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeCallsCountLock = NSLock() - private var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingCallsCount = 0 + private nonisolated(unsafe) var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingCallsCount = 0 var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeCallsCount: Int { get { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeCallsCountLock.withLock { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingCallsCount } } set { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeCallsCountLock.withLock { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingCallsCount = newValue } } @@ -12684,27 +12684,27 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { return sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeCallsCount > 0 } private let sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReceivedArgumentsLock = NSLock() - private var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReceivedArguments: (body: String, geoURI: GeoURI, description: String?, zoomLevel: UInt8?, assetType: AssetType?)? + private nonisolated(unsafe) var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReceivedArguments: (body: String, geoURI: GeoURI, description: String?, zoomLevel: UInt8?, assetType: AssetType?)? var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReceivedArguments: (body: String, geoURI: GeoURI, description: String?, zoomLevel: UInt8?, assetType: AssetType?)? { get { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReceivedArgumentsLock.withLock { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReceivedArguments } } set { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReceivedArgumentsLock.withLock { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReceivedArguments = newValue } } } private let sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReceivedInvocationsLock = NSLock() - private var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReceivedInvocations: [(body: String, geoURI: GeoURI, description: String?, zoomLevel: UInt8?, assetType: AssetType?)] = [] + private nonisolated(unsafe) var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReceivedInvocations: [(body: String, geoURI: GeoURI, description: String?, zoomLevel: UInt8?, assetType: AssetType?)] = [] var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReceivedInvocations: [(body: String, geoURI: GeoURI, description: String?, zoomLevel: UInt8?, assetType: AssetType?)] { get { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReceivedInvocationsLock.withLock { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReceivedInvocations } } set { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReceivedInvocationsLock.withLock { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReceivedInvocations = newValue } } } private let sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReturnValueLock = NSLock() - private var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReturnValue: Result! + private nonisolated(unsafe) var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReturnValue: Result! var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReturnValue: Result! { get { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReturnValueLock.withLock { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReturnValue } } set { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReturnValueLock.withLock { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReturnValue = newValue } } } - var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeClosure: ((String, GeoURI, String?, UInt8?, AssetType?) async -> Result)? + nonisolated(unsafe) var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeClosure: ((String, GeoURI, String?, UInt8?, AssetType?) async -> Result)? - func sendLocation(body: String, geoURI: GeoURI, description: String?, zoomLevel: UInt8?, assetType: AssetType?) async -> Result { + @concurrent func sendLocation(body: String, geoURI: GeoURI, description: String?, zoomLevel: UInt8?, assetType: AssetType?) async -> Result { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeCallsCountLock.withLock { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingCallsCount += 1 } sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReceivedArguments = (body: body, geoURI: geoURI, description: description, zoomLevel: zoomLevel, assetType: assetType) sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReceivedInvocationsLock.withLock { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReceivedInvocations.append((body: body, geoURI: geoURI, description: description, zoomLevel: zoomLevel, assetType: assetType)) } @@ -12717,7 +12717,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - sendVideo private let sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleCallsCountLock = NSLock() - private var sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingCallsCount = 0 + private nonisolated(unsafe) var sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingCallsCount = 0 var sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleCallsCount: Int { get { sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleCallsCountLock.withLock { sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingCallsCount } } set { sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleCallsCountLock.withLock { sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingCallsCount = newValue } } @@ -12727,14 +12727,14 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { } private let sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleReturnValueLock = NSLock() - private var sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingReturnValue: Result! + private nonisolated(unsafe) var sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingReturnValue: Result! var sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleReturnValue: Result! { get { sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleReturnValueLock.withLock { sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingReturnValue } } set { sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleReturnValueLock.withLock { sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingReturnValue = newValue } } } - var sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleClosure: ((URL, URL, VideoInfo, String?, @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? + nonisolated(unsafe) var sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleClosure: ((URL, URL, VideoInfo, String?, @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? - func sendVideo(url: URL, thumbnailURL: URL, videoInfo: VideoInfo, caption: String?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { + @concurrent func sendVideo(url: URL, thumbnailURL: URL, videoInfo: VideoInfo, caption: String?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleCallsCountLock.withLock { sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingCallsCount += 1 } if let sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleClosure = sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleClosure { return await sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleClosure(url, thumbnailURL, videoInfo, caption, requestHandle) @@ -12745,7 +12745,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - sendVoiceMessage private let sendVoiceMessageUrlAudioInfoWaveformRequestHandleCallsCountLock = NSLock() - private var sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingCallsCount = 0 + private nonisolated(unsafe) var sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingCallsCount = 0 var sendVoiceMessageUrlAudioInfoWaveformRequestHandleCallsCount: Int { get { sendVoiceMessageUrlAudioInfoWaveformRequestHandleCallsCountLock.withLock { sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingCallsCount } } set { sendVoiceMessageUrlAudioInfoWaveformRequestHandleCallsCountLock.withLock { sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingCallsCount = newValue } } @@ -12755,14 +12755,14 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { } private let sendVoiceMessageUrlAudioInfoWaveformRequestHandleReturnValueLock = NSLock() - private var sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingReturnValue: Result! + private nonisolated(unsafe) var sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingReturnValue: Result! var sendVoiceMessageUrlAudioInfoWaveformRequestHandleReturnValue: Result! { get { sendVoiceMessageUrlAudioInfoWaveformRequestHandleReturnValueLock.withLock { sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingReturnValue } } set { sendVoiceMessageUrlAudioInfoWaveformRequestHandleReturnValueLock.withLock { sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingReturnValue = newValue } } } - var sendVoiceMessageUrlAudioInfoWaveformRequestHandleClosure: ((URL, AudioInfo, [Float], @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? + nonisolated(unsafe) var sendVoiceMessageUrlAudioInfoWaveformRequestHandleClosure: ((URL, AudioInfo, [Float], @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? - func sendVoiceMessage(url: URL, audioInfo: AudioInfo, waveform: [Float], requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { + @concurrent func sendVoiceMessage(url: URL, audioInfo: AudioInfo, waveform: [Float], requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { sendVoiceMessageUrlAudioInfoWaveformRequestHandleCallsCountLock.withLock { sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingCallsCount += 1 } if let sendVoiceMessageUrlAudioInfoWaveformRequestHandleClosure = sendVoiceMessageUrlAudioInfoWaveformRequestHandleClosure { return await sendVoiceMessageUrlAudioInfoWaveformRequestHandleClosure(url, audioInfo, waveform, requestHandle) @@ -12773,7 +12773,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - createPoll private let createPollQuestionAnswersPollKindCallsCountLock = NSLock() - private var createPollQuestionAnswersPollKindUnderlyingCallsCount = 0 + private nonisolated(unsafe) var createPollQuestionAnswersPollKindUnderlyingCallsCount = 0 var createPollQuestionAnswersPollKindCallsCount: Int { get { createPollQuestionAnswersPollKindCallsCountLock.withLock { createPollQuestionAnswersPollKindUnderlyingCallsCount } } set { createPollQuestionAnswersPollKindCallsCountLock.withLock { createPollQuestionAnswersPollKindUnderlyingCallsCount = newValue } } @@ -12782,27 +12782,27 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { return createPollQuestionAnswersPollKindCallsCount > 0 } private let createPollQuestionAnswersPollKindReceivedArgumentsLock = NSLock() - private var createPollQuestionAnswersPollKindUnderlyingReceivedArguments: (question: String, answers: [String], pollKind: Poll.Kind)? + private nonisolated(unsafe) var createPollQuestionAnswersPollKindUnderlyingReceivedArguments: (question: String, answers: [String], pollKind: Poll.Kind)? var createPollQuestionAnswersPollKindReceivedArguments: (question: String, answers: [String], pollKind: Poll.Kind)? { get { createPollQuestionAnswersPollKindReceivedArgumentsLock.withLock { createPollQuestionAnswersPollKindUnderlyingReceivedArguments } } set { createPollQuestionAnswersPollKindReceivedArgumentsLock.withLock { createPollQuestionAnswersPollKindUnderlyingReceivedArguments = newValue } } } private let createPollQuestionAnswersPollKindReceivedInvocationsLock = NSLock() - private var createPollQuestionAnswersPollKindUnderlyingReceivedInvocations: [(question: String, answers: [String], pollKind: Poll.Kind)] = [] + private nonisolated(unsafe) var createPollQuestionAnswersPollKindUnderlyingReceivedInvocations: [(question: String, answers: [String], pollKind: Poll.Kind)] = [] var createPollQuestionAnswersPollKindReceivedInvocations: [(question: String, answers: [String], pollKind: Poll.Kind)] { get { createPollQuestionAnswersPollKindReceivedInvocationsLock.withLock { createPollQuestionAnswersPollKindUnderlyingReceivedInvocations } } set { createPollQuestionAnswersPollKindReceivedInvocationsLock.withLock { createPollQuestionAnswersPollKindUnderlyingReceivedInvocations = newValue } } } private let createPollQuestionAnswersPollKindReturnValueLock = NSLock() - private var createPollQuestionAnswersPollKindUnderlyingReturnValue: Result! + private nonisolated(unsafe) var createPollQuestionAnswersPollKindUnderlyingReturnValue: Result! var createPollQuestionAnswersPollKindReturnValue: Result! { get { createPollQuestionAnswersPollKindReturnValueLock.withLock { createPollQuestionAnswersPollKindUnderlyingReturnValue } } set { createPollQuestionAnswersPollKindReturnValueLock.withLock { createPollQuestionAnswersPollKindUnderlyingReturnValue = newValue } } } - var createPollQuestionAnswersPollKindClosure: ((String, [String], Poll.Kind) async -> Result)? + nonisolated(unsafe) var createPollQuestionAnswersPollKindClosure: ((String, [String], Poll.Kind) async -> Result)? - func createPoll(question: String, answers: [String], pollKind: Poll.Kind) async -> Result { + @concurrent func createPoll(question: String, answers: [String], pollKind: Poll.Kind) async -> Result { createPollQuestionAnswersPollKindCallsCountLock.withLock { createPollQuestionAnswersPollKindUnderlyingCallsCount += 1 } createPollQuestionAnswersPollKindReceivedArguments = (question: question, answers: answers, pollKind: pollKind) createPollQuestionAnswersPollKindReceivedInvocationsLock.withLock { createPollQuestionAnswersPollKindUnderlyingReceivedInvocations.append((question: question, answers: answers, pollKind: pollKind)) } @@ -12815,7 +12815,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - editPoll private let editPollOriginalQuestionAnswersPollKindCallsCountLock = NSLock() - private var editPollOriginalQuestionAnswersPollKindUnderlyingCallsCount = 0 + private nonisolated(unsafe) var editPollOriginalQuestionAnswersPollKindUnderlyingCallsCount = 0 var editPollOriginalQuestionAnswersPollKindCallsCount: Int { get { editPollOriginalQuestionAnswersPollKindCallsCountLock.withLock { editPollOriginalQuestionAnswersPollKindUnderlyingCallsCount } } set { editPollOriginalQuestionAnswersPollKindCallsCountLock.withLock { editPollOriginalQuestionAnswersPollKindUnderlyingCallsCount = newValue } } @@ -12824,27 +12824,27 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { return editPollOriginalQuestionAnswersPollKindCallsCount > 0 } private let editPollOriginalQuestionAnswersPollKindReceivedArgumentsLock = NSLock() - private var editPollOriginalQuestionAnswersPollKindUnderlyingReceivedArguments: (eventID: String, question: String, answers: [String], pollKind: Poll.Kind)? + private nonisolated(unsafe) var editPollOriginalQuestionAnswersPollKindUnderlyingReceivedArguments: (eventID: String, question: String, answers: [String], pollKind: Poll.Kind)? var editPollOriginalQuestionAnswersPollKindReceivedArguments: (eventID: String, question: String, answers: [String], pollKind: Poll.Kind)? { get { editPollOriginalQuestionAnswersPollKindReceivedArgumentsLock.withLock { editPollOriginalQuestionAnswersPollKindUnderlyingReceivedArguments } } set { editPollOriginalQuestionAnswersPollKindReceivedArgumentsLock.withLock { editPollOriginalQuestionAnswersPollKindUnderlyingReceivedArguments = newValue } } } private let editPollOriginalQuestionAnswersPollKindReceivedInvocationsLock = NSLock() - private var editPollOriginalQuestionAnswersPollKindUnderlyingReceivedInvocations: [(eventID: String, question: String, answers: [String], pollKind: Poll.Kind)] = [] + private nonisolated(unsafe) var editPollOriginalQuestionAnswersPollKindUnderlyingReceivedInvocations: [(eventID: String, question: String, answers: [String], pollKind: Poll.Kind)] = [] var editPollOriginalQuestionAnswersPollKindReceivedInvocations: [(eventID: String, question: String, answers: [String], pollKind: Poll.Kind)] { get { editPollOriginalQuestionAnswersPollKindReceivedInvocationsLock.withLock { editPollOriginalQuestionAnswersPollKindUnderlyingReceivedInvocations } } set { editPollOriginalQuestionAnswersPollKindReceivedInvocationsLock.withLock { editPollOriginalQuestionAnswersPollKindUnderlyingReceivedInvocations = newValue } } } private let editPollOriginalQuestionAnswersPollKindReturnValueLock = NSLock() - private var editPollOriginalQuestionAnswersPollKindUnderlyingReturnValue: Result! + private nonisolated(unsafe) var editPollOriginalQuestionAnswersPollKindUnderlyingReturnValue: Result! var editPollOriginalQuestionAnswersPollKindReturnValue: Result! { get { editPollOriginalQuestionAnswersPollKindReturnValueLock.withLock { editPollOriginalQuestionAnswersPollKindUnderlyingReturnValue } } set { editPollOriginalQuestionAnswersPollKindReturnValueLock.withLock { editPollOriginalQuestionAnswersPollKindUnderlyingReturnValue = newValue } } } - var editPollOriginalQuestionAnswersPollKindClosure: ((String, String, [String], Poll.Kind) async -> Result)? + nonisolated(unsafe) var editPollOriginalQuestionAnswersPollKindClosure: ((String, String, [String], Poll.Kind) async -> Result)? - func editPoll(original eventID: String, question: String, answers: [String], pollKind: Poll.Kind) async -> Result { + @concurrent func editPoll(original eventID: String, question: String, answers: [String], pollKind: Poll.Kind) async -> Result { editPollOriginalQuestionAnswersPollKindCallsCountLock.withLock { editPollOriginalQuestionAnswersPollKindUnderlyingCallsCount += 1 } editPollOriginalQuestionAnswersPollKindReceivedArguments = (eventID: eventID, question: question, answers: answers, pollKind: pollKind) editPollOriginalQuestionAnswersPollKindReceivedInvocationsLock.withLock { editPollOriginalQuestionAnswersPollKindUnderlyingReceivedInvocations.append((eventID: eventID, question: question, answers: answers, pollKind: pollKind)) } @@ -12857,7 +12857,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - sendPollResponse private let sendPollResponsePollStartIDAnswersCallsCountLock = NSLock() - private var sendPollResponsePollStartIDAnswersUnderlyingCallsCount = 0 + private nonisolated(unsafe) var sendPollResponsePollStartIDAnswersUnderlyingCallsCount = 0 var sendPollResponsePollStartIDAnswersCallsCount: Int { get { sendPollResponsePollStartIDAnswersCallsCountLock.withLock { sendPollResponsePollStartIDAnswersUnderlyingCallsCount } } set { sendPollResponsePollStartIDAnswersCallsCountLock.withLock { sendPollResponsePollStartIDAnswersUnderlyingCallsCount = newValue } } @@ -12866,27 +12866,27 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { return sendPollResponsePollStartIDAnswersCallsCount > 0 } private let sendPollResponsePollStartIDAnswersReceivedArgumentsLock = NSLock() - private var sendPollResponsePollStartIDAnswersUnderlyingReceivedArguments: (pollStartID: String, answers: [String])? + private nonisolated(unsafe) var sendPollResponsePollStartIDAnswersUnderlyingReceivedArguments: (pollStartID: String, answers: [String])? var sendPollResponsePollStartIDAnswersReceivedArguments: (pollStartID: String, answers: [String])? { get { sendPollResponsePollStartIDAnswersReceivedArgumentsLock.withLock { sendPollResponsePollStartIDAnswersUnderlyingReceivedArguments } } set { sendPollResponsePollStartIDAnswersReceivedArgumentsLock.withLock { sendPollResponsePollStartIDAnswersUnderlyingReceivedArguments = newValue } } } private let sendPollResponsePollStartIDAnswersReceivedInvocationsLock = NSLock() - private var sendPollResponsePollStartIDAnswersUnderlyingReceivedInvocations: [(pollStartID: String, answers: [String])] = [] + private nonisolated(unsafe) var sendPollResponsePollStartIDAnswersUnderlyingReceivedInvocations: [(pollStartID: String, answers: [String])] = [] var sendPollResponsePollStartIDAnswersReceivedInvocations: [(pollStartID: String, answers: [String])] { get { sendPollResponsePollStartIDAnswersReceivedInvocationsLock.withLock { sendPollResponsePollStartIDAnswersUnderlyingReceivedInvocations } } set { sendPollResponsePollStartIDAnswersReceivedInvocationsLock.withLock { sendPollResponsePollStartIDAnswersUnderlyingReceivedInvocations = newValue } } } private let sendPollResponsePollStartIDAnswersReturnValueLock = NSLock() - private var sendPollResponsePollStartIDAnswersUnderlyingReturnValue: Result! + private nonisolated(unsafe) var sendPollResponsePollStartIDAnswersUnderlyingReturnValue: Result! var sendPollResponsePollStartIDAnswersReturnValue: Result! { get { sendPollResponsePollStartIDAnswersReturnValueLock.withLock { sendPollResponsePollStartIDAnswersUnderlyingReturnValue } } set { sendPollResponsePollStartIDAnswersReturnValueLock.withLock { sendPollResponsePollStartIDAnswersUnderlyingReturnValue = newValue } } } - var sendPollResponsePollStartIDAnswersClosure: ((String, [String]) async -> Result)? + nonisolated(unsafe) var sendPollResponsePollStartIDAnswersClosure: ((String, [String]) async -> Result)? - func sendPollResponse(pollStartID: String, answers: [String]) async -> Result { + @concurrent func sendPollResponse(pollStartID: String, answers: [String]) async -> Result { sendPollResponsePollStartIDAnswersCallsCountLock.withLock { sendPollResponsePollStartIDAnswersUnderlyingCallsCount += 1 } sendPollResponsePollStartIDAnswersReceivedArguments = (pollStartID: pollStartID, answers: answers) sendPollResponsePollStartIDAnswersReceivedInvocationsLock.withLock { sendPollResponsePollStartIDAnswersUnderlyingReceivedInvocations.append((pollStartID: pollStartID, answers: answers)) } @@ -12899,7 +12899,7 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { //MARK: - endPoll private let endPollPollStartIDTextCallsCountLock = NSLock() - private var endPollPollStartIDTextUnderlyingCallsCount = 0 + private nonisolated(unsafe) var endPollPollStartIDTextUnderlyingCallsCount = 0 var endPollPollStartIDTextCallsCount: Int { get { endPollPollStartIDTextCallsCountLock.withLock { endPollPollStartIDTextUnderlyingCallsCount } } set { endPollPollStartIDTextCallsCountLock.withLock { endPollPollStartIDTextUnderlyingCallsCount = newValue } } @@ -12908,27 +12908,27 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { return endPollPollStartIDTextCallsCount > 0 } private let endPollPollStartIDTextReceivedArgumentsLock = NSLock() - private var endPollPollStartIDTextUnderlyingReceivedArguments: (pollStartID: String, text: String)? + private nonisolated(unsafe) var endPollPollStartIDTextUnderlyingReceivedArguments: (pollStartID: String, text: String)? var endPollPollStartIDTextReceivedArguments: (pollStartID: String, text: String)? { get { endPollPollStartIDTextReceivedArgumentsLock.withLock { endPollPollStartIDTextUnderlyingReceivedArguments } } set { endPollPollStartIDTextReceivedArgumentsLock.withLock { endPollPollStartIDTextUnderlyingReceivedArguments = newValue } } } private let endPollPollStartIDTextReceivedInvocationsLock = NSLock() - private var endPollPollStartIDTextUnderlyingReceivedInvocations: [(pollStartID: String, text: String)] = [] + private nonisolated(unsafe) var endPollPollStartIDTextUnderlyingReceivedInvocations: [(pollStartID: String, text: String)] = [] var endPollPollStartIDTextReceivedInvocations: [(pollStartID: String, text: String)] { get { endPollPollStartIDTextReceivedInvocationsLock.withLock { endPollPollStartIDTextUnderlyingReceivedInvocations } } set { endPollPollStartIDTextReceivedInvocationsLock.withLock { endPollPollStartIDTextUnderlyingReceivedInvocations = newValue } } } private let endPollPollStartIDTextReturnValueLock = NSLock() - private var endPollPollStartIDTextUnderlyingReturnValue: Result! + private nonisolated(unsafe) var endPollPollStartIDTextUnderlyingReturnValue: Result! var endPollPollStartIDTextReturnValue: Result! { get { endPollPollStartIDTextReturnValueLock.withLock { endPollPollStartIDTextUnderlyingReturnValue } } set { endPollPollStartIDTextReturnValueLock.withLock { endPollPollStartIDTextUnderlyingReturnValue = newValue } } } - var endPollPollStartIDTextClosure: ((String, String) async -> Result)? + nonisolated(unsafe) var endPollPollStartIDTextClosure: ((String, String) async -> Result)? - func endPoll(pollStartID: String, text: String) async -> Result { + @concurrent func endPoll(pollStartID: String, text: String) async -> Result { endPollPollStartIDTextCallsCountLock.withLock { endPollPollStartIDTextUnderlyingCallsCount += 1 } endPollPollStartIDTextReceivedArguments = (pollStartID: pollStartID, text: text) endPollPollStartIDTextReceivedInvocationsLock.withLock { endPollPollStartIDTextUnderlyingReceivedInvocations.append((pollStartID: pollStartID, text: text)) } @@ -12939,41 +12939,41 @@ class TimelineControllerMock: TimelineControllerProtocol, @unchecked Sendable { } } } -class TimelineItemProviderMock: TimelineItemProviderProtocol, @unchecked Sendable { +nonisolated class TimelineItemProviderMock: TimelineItemProviderProtocol, @unchecked Sendable { var updatePublisher: AnyPublisher<([TimelineItemProxy], TimelinePaginationState), Never> { get { return underlyingUpdatePublisher } set(value) { underlyingUpdatePublisher = value } } - var underlyingUpdatePublisher: AnyPublisher<([TimelineItemProxy], TimelinePaginationState), Never>! - var itemProxies: [TimelineItemProxy] = [] + nonisolated(unsafe) var underlyingUpdatePublisher: AnyPublisher<([TimelineItemProxy], TimelinePaginationState), Never>! + nonisolated(unsafe) var itemProxies: [TimelineItemProxy] = [] var paginationState: TimelinePaginationState { get { return underlyingPaginationState } set(value) { underlyingPaginationState = value } } - var underlyingPaginationState: TimelinePaginationState! + nonisolated(unsafe) var underlyingPaginationState: TimelinePaginationState! var kind: TimelineKind { get { return underlyingKind } set(value) { underlyingKind = value } } - var underlyingKind: TimelineKind! + nonisolated(unsafe) var underlyingKind: TimelineKind! var membershipChangePublisher: AnyPublisher { get { return underlyingMembershipChangePublisher } set(value) { underlyingMembershipChangePublisher = value } } - var underlyingMembershipChangePublisher: AnyPublisher! + nonisolated(unsafe) var underlyingMembershipChangePublisher: AnyPublisher! } -class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { +nonisolated class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { var timelineItemProvider: TimelineItemProviderProtocol { get { return underlyingTimelineItemProvider } set(value) { underlyingTimelineItemProvider = value } } - var underlyingTimelineItemProvider: TimelineItemProviderProtocol! + nonisolated(unsafe) var underlyingTimelineItemProvider: TimelineItemProviderProtocol! //MARK: - subscribeForUpdates private let subscribeForUpdatesCallsCountLock = NSLock() - private var subscribeForUpdatesUnderlyingCallsCount = 0 + private nonisolated(unsafe) var subscribeForUpdatesUnderlyingCallsCount = 0 var subscribeForUpdatesCallsCount: Int { get { subscribeForUpdatesCallsCountLock.withLock { subscribeForUpdatesUnderlyingCallsCount } } set { subscribeForUpdatesCallsCountLock.withLock { subscribeForUpdatesUnderlyingCallsCount = newValue } } @@ -12981,16 +12981,16 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { var subscribeForUpdatesCalled: Bool { return subscribeForUpdatesCallsCount > 0 } - var subscribeForUpdatesClosure: (() async -> Void)? + nonisolated(unsafe) var subscribeForUpdatesClosure: (() async -> Void)? - func subscribeForUpdates() async { + @concurrent func subscribeForUpdates() async { subscribeForUpdatesCallsCountLock.withLock { subscribeForUpdatesUnderlyingCallsCount += 1 } await subscribeForUpdatesClosure?() } //MARK: - fetchDetails private let fetchDetailsForCallsCountLock = NSLock() - private var fetchDetailsForUnderlyingCallsCount = 0 + private nonisolated(unsafe) var fetchDetailsForUnderlyingCallsCount = 0 var fetchDetailsForCallsCount: Int { get { fetchDetailsForCallsCountLock.withLock { fetchDetailsForUnderlyingCallsCount } } set { fetchDetailsForCallsCountLock.withLock { fetchDetailsForUnderlyingCallsCount = newValue } } @@ -12999,18 +12999,18 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { return fetchDetailsForCallsCount > 0 } private let fetchDetailsForReceivedEventIDLock = NSLock() - private var fetchDetailsForUnderlyingReceivedEventID: String? + private nonisolated(unsafe) var fetchDetailsForUnderlyingReceivedEventID: String? var fetchDetailsForReceivedEventID: String? { get { fetchDetailsForReceivedEventIDLock.withLock { fetchDetailsForUnderlyingReceivedEventID } } set { fetchDetailsForReceivedEventIDLock.withLock { fetchDetailsForUnderlyingReceivedEventID = newValue } } } private let fetchDetailsForReceivedInvocationsLock = NSLock() - private var fetchDetailsForUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var fetchDetailsForUnderlyingReceivedInvocations: [String] = [] var fetchDetailsForReceivedInvocations: [String] { get { fetchDetailsForReceivedInvocationsLock.withLock { fetchDetailsForUnderlyingReceivedInvocations } } set { fetchDetailsForReceivedInvocationsLock.withLock { fetchDetailsForUnderlyingReceivedInvocations = newValue } } } - var fetchDetailsForClosure: ((String) -> Void)? + nonisolated(unsafe) var fetchDetailsForClosure: ((String) -> Void)? func fetchDetails(for eventID: String) { fetchDetailsForCallsCountLock.withLock { fetchDetailsForUnderlyingCallsCount += 1 } @@ -13021,7 +13021,7 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { //MARK: - messageEventContent private let messageEventContentForCallsCountLock = NSLock() - private var messageEventContentForUnderlyingCallsCount = 0 + private nonisolated(unsafe) var messageEventContentForUnderlyingCallsCount = 0 var messageEventContentForCallsCount: Int { get { messageEventContentForCallsCountLock.withLock { messageEventContentForUnderlyingCallsCount } } set { messageEventContentForCallsCountLock.withLock { messageEventContentForUnderlyingCallsCount = newValue } } @@ -13030,27 +13030,27 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { return messageEventContentForCallsCount > 0 } private let messageEventContentForReceivedTimelineItemIDLock = NSLock() - private var messageEventContentForUnderlyingReceivedTimelineItemID: TimelineItemIdentifier? + private nonisolated(unsafe) var messageEventContentForUnderlyingReceivedTimelineItemID: TimelineItemIdentifier? var messageEventContentForReceivedTimelineItemID: TimelineItemIdentifier? { get { messageEventContentForReceivedTimelineItemIDLock.withLock { messageEventContentForUnderlyingReceivedTimelineItemID } } set { messageEventContentForReceivedTimelineItemIDLock.withLock { messageEventContentForUnderlyingReceivedTimelineItemID = newValue } } } private let messageEventContentForReceivedInvocationsLock = NSLock() - private var messageEventContentForUnderlyingReceivedInvocations: [TimelineItemIdentifier] = [] + private nonisolated(unsafe) var messageEventContentForUnderlyingReceivedInvocations: [TimelineItemIdentifier] = [] var messageEventContentForReceivedInvocations: [TimelineItemIdentifier] { get { messageEventContentForReceivedInvocationsLock.withLock { messageEventContentForUnderlyingReceivedInvocations } } set { messageEventContentForReceivedInvocationsLock.withLock { messageEventContentForUnderlyingReceivedInvocations = newValue } } } private let messageEventContentForReturnValueLock = NSLock() - private var messageEventContentForUnderlyingReturnValue: RoomMessageEventContentWithoutRelation? + private nonisolated(unsafe) var messageEventContentForUnderlyingReturnValue: RoomMessageEventContentWithoutRelation? var messageEventContentForReturnValue: RoomMessageEventContentWithoutRelation? { get { messageEventContentForReturnValueLock.withLock { messageEventContentForUnderlyingReturnValue } } set { messageEventContentForReturnValueLock.withLock { messageEventContentForUnderlyingReturnValue = newValue } } } - var messageEventContentForClosure: ((TimelineItemIdentifier) async -> RoomMessageEventContentWithoutRelation?)? + nonisolated(unsafe) var messageEventContentForClosure: ((TimelineItemIdentifier) async -> RoomMessageEventContentWithoutRelation?)? - func messageEventContent(for timelineItemID: TimelineItemIdentifier) async -> RoomMessageEventContentWithoutRelation? { + @concurrent func messageEventContent(for timelineItemID: TimelineItemIdentifier) async -> RoomMessageEventContentWithoutRelation? { messageEventContentForCallsCountLock.withLock { messageEventContentForUnderlyingCallsCount += 1 } messageEventContentForReceivedTimelineItemID = timelineItemID messageEventContentForReceivedInvocationsLock.withLock { messageEventContentForUnderlyingReceivedInvocations.append(timelineItemID) } @@ -13063,7 +13063,7 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { //MARK: - retryDecryption private let retryDecryptionSessionIDsCallsCountLock = NSLock() - private var retryDecryptionSessionIDsUnderlyingCallsCount = 0 + private nonisolated(unsafe) var retryDecryptionSessionIDsUnderlyingCallsCount = 0 var retryDecryptionSessionIDsCallsCount: Int { get { retryDecryptionSessionIDsCallsCountLock.withLock { retryDecryptionSessionIDsUnderlyingCallsCount } } set { retryDecryptionSessionIDsCallsCountLock.withLock { retryDecryptionSessionIDsUnderlyingCallsCount = newValue } } @@ -13072,18 +13072,18 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { return retryDecryptionSessionIDsCallsCount > 0 } private let retryDecryptionSessionIDsReceivedSessionIDsLock = NSLock() - private var retryDecryptionSessionIDsUnderlyingReceivedSessionIDs: [String]? + private nonisolated(unsafe) var retryDecryptionSessionIDsUnderlyingReceivedSessionIDs: [String]? var retryDecryptionSessionIDsReceivedSessionIDs: [String]? { get { retryDecryptionSessionIDsReceivedSessionIDsLock.withLock { retryDecryptionSessionIDsUnderlyingReceivedSessionIDs } } set { retryDecryptionSessionIDsReceivedSessionIDsLock.withLock { retryDecryptionSessionIDsUnderlyingReceivedSessionIDs = newValue } } } private let retryDecryptionSessionIDsReceivedInvocationsLock = NSLock() - private var retryDecryptionSessionIDsUnderlyingReceivedInvocations: [[String]?] = [] + private nonisolated(unsafe) var retryDecryptionSessionIDsUnderlyingReceivedInvocations: [[String]?] = [] var retryDecryptionSessionIDsReceivedInvocations: [[String]?] { get { retryDecryptionSessionIDsReceivedInvocationsLock.withLock { retryDecryptionSessionIDsUnderlyingReceivedInvocations } } set { retryDecryptionSessionIDsReceivedInvocationsLock.withLock { retryDecryptionSessionIDsUnderlyingReceivedInvocations = newValue } } } - var retryDecryptionSessionIDsClosure: (([String]?) -> Void)? + nonisolated(unsafe) var retryDecryptionSessionIDsClosure: (([String]?) -> Void)? func retryDecryption(sessionIDs: [String]?) { retryDecryptionSessionIDsCallsCountLock.withLock { retryDecryptionSessionIDsUnderlyingCallsCount += 1 } @@ -13094,7 +13094,7 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { //MARK: - paginateBackwards private let paginateBackwardsRequestSizeCallsCountLock = NSLock() - private var paginateBackwardsRequestSizeUnderlyingCallsCount = 0 + private nonisolated(unsafe) var paginateBackwardsRequestSizeUnderlyingCallsCount = 0 var paginateBackwardsRequestSizeCallsCount: Int { get { paginateBackwardsRequestSizeCallsCountLock.withLock { paginateBackwardsRequestSizeUnderlyingCallsCount } } set { paginateBackwardsRequestSizeCallsCountLock.withLock { paginateBackwardsRequestSizeUnderlyingCallsCount = newValue } } @@ -13103,27 +13103,27 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { return paginateBackwardsRequestSizeCallsCount > 0 } private let paginateBackwardsRequestSizeReceivedRequestSizeLock = NSLock() - private var paginateBackwardsRequestSizeUnderlyingReceivedRequestSize: UInt16? + private nonisolated(unsafe) var paginateBackwardsRequestSizeUnderlyingReceivedRequestSize: UInt16? var paginateBackwardsRequestSizeReceivedRequestSize: UInt16? { get { paginateBackwardsRequestSizeReceivedRequestSizeLock.withLock { paginateBackwardsRequestSizeUnderlyingReceivedRequestSize } } set { paginateBackwardsRequestSizeReceivedRequestSizeLock.withLock { paginateBackwardsRequestSizeUnderlyingReceivedRequestSize = newValue } } } private let paginateBackwardsRequestSizeReceivedInvocationsLock = NSLock() - private var paginateBackwardsRequestSizeUnderlyingReceivedInvocations: [UInt16] = [] + private nonisolated(unsafe) var paginateBackwardsRequestSizeUnderlyingReceivedInvocations: [UInt16] = [] var paginateBackwardsRequestSizeReceivedInvocations: [UInt16] { get { paginateBackwardsRequestSizeReceivedInvocationsLock.withLock { paginateBackwardsRequestSizeUnderlyingReceivedInvocations } } set { paginateBackwardsRequestSizeReceivedInvocationsLock.withLock { paginateBackwardsRequestSizeUnderlyingReceivedInvocations = newValue } } } private let paginateBackwardsRequestSizeReturnValueLock = NSLock() - private var paginateBackwardsRequestSizeUnderlyingReturnValue: Result! + private nonisolated(unsafe) var paginateBackwardsRequestSizeUnderlyingReturnValue: Result! var paginateBackwardsRequestSizeReturnValue: Result! { get { paginateBackwardsRequestSizeReturnValueLock.withLock { paginateBackwardsRequestSizeUnderlyingReturnValue } } set { paginateBackwardsRequestSizeReturnValueLock.withLock { paginateBackwardsRequestSizeUnderlyingReturnValue = newValue } } } - var paginateBackwardsRequestSizeClosure: ((UInt16) async -> Result)? + nonisolated(unsafe) var paginateBackwardsRequestSizeClosure: ((UInt16) async -> Result)? - func paginateBackwards(requestSize: UInt16) async -> Result { + @concurrent func paginateBackwards(requestSize: UInt16) async -> Result { paginateBackwardsRequestSizeCallsCountLock.withLock { paginateBackwardsRequestSizeUnderlyingCallsCount += 1 } paginateBackwardsRequestSizeReceivedRequestSize = requestSize paginateBackwardsRequestSizeReceivedInvocationsLock.withLock { paginateBackwardsRequestSizeUnderlyingReceivedInvocations.append(requestSize) } @@ -13136,7 +13136,7 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { //MARK: - paginateForwards private let paginateForwardsRequestSizeCallsCountLock = NSLock() - private var paginateForwardsRequestSizeUnderlyingCallsCount = 0 + private nonisolated(unsafe) var paginateForwardsRequestSizeUnderlyingCallsCount = 0 var paginateForwardsRequestSizeCallsCount: Int { get { paginateForwardsRequestSizeCallsCountLock.withLock { paginateForwardsRequestSizeUnderlyingCallsCount } } set { paginateForwardsRequestSizeCallsCountLock.withLock { paginateForwardsRequestSizeUnderlyingCallsCount = newValue } } @@ -13145,27 +13145,27 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { return paginateForwardsRequestSizeCallsCount > 0 } private let paginateForwardsRequestSizeReceivedRequestSizeLock = NSLock() - private var paginateForwardsRequestSizeUnderlyingReceivedRequestSize: UInt16? + private nonisolated(unsafe) var paginateForwardsRequestSizeUnderlyingReceivedRequestSize: UInt16? var paginateForwardsRequestSizeReceivedRequestSize: UInt16? { get { paginateForwardsRequestSizeReceivedRequestSizeLock.withLock { paginateForwardsRequestSizeUnderlyingReceivedRequestSize } } set { paginateForwardsRequestSizeReceivedRequestSizeLock.withLock { paginateForwardsRequestSizeUnderlyingReceivedRequestSize = newValue } } } private let paginateForwardsRequestSizeReceivedInvocationsLock = NSLock() - private var paginateForwardsRequestSizeUnderlyingReceivedInvocations: [UInt16] = [] + private nonisolated(unsafe) var paginateForwardsRequestSizeUnderlyingReceivedInvocations: [UInt16] = [] var paginateForwardsRequestSizeReceivedInvocations: [UInt16] { get { paginateForwardsRequestSizeReceivedInvocationsLock.withLock { paginateForwardsRequestSizeUnderlyingReceivedInvocations } } set { paginateForwardsRequestSizeReceivedInvocationsLock.withLock { paginateForwardsRequestSizeUnderlyingReceivedInvocations = newValue } } } private let paginateForwardsRequestSizeReturnValueLock = NSLock() - private var paginateForwardsRequestSizeUnderlyingReturnValue: Result! + private nonisolated(unsafe) var paginateForwardsRequestSizeUnderlyingReturnValue: Result! var paginateForwardsRequestSizeReturnValue: Result! { get { paginateForwardsRequestSizeReturnValueLock.withLock { paginateForwardsRequestSizeUnderlyingReturnValue } } set { paginateForwardsRequestSizeReturnValueLock.withLock { paginateForwardsRequestSizeUnderlyingReturnValue = newValue } } } - var paginateForwardsRequestSizeClosure: ((UInt16) async -> Result)? + nonisolated(unsafe) var paginateForwardsRequestSizeClosure: ((UInt16) async -> Result)? - func paginateForwards(requestSize: UInt16) async -> Result { + @concurrent func paginateForwards(requestSize: UInt16) async -> Result { paginateForwardsRequestSizeCallsCountLock.withLock { paginateForwardsRequestSizeUnderlyingCallsCount += 1 } paginateForwardsRequestSizeReceivedRequestSize = requestSize paginateForwardsRequestSizeReceivedInvocationsLock.withLock { paginateForwardsRequestSizeUnderlyingReceivedInvocations.append(requestSize) } @@ -13178,7 +13178,7 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { //MARK: - edit private let editNewContentCallsCountLock = NSLock() - private var editNewContentUnderlyingCallsCount = 0 + private nonisolated(unsafe) var editNewContentUnderlyingCallsCount = 0 var editNewContentCallsCount: Int { get { editNewContentCallsCountLock.withLock { editNewContentUnderlyingCallsCount } } set { editNewContentCallsCountLock.withLock { editNewContentUnderlyingCallsCount = newValue } } @@ -13187,27 +13187,27 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { return editNewContentCallsCount > 0 } private let editNewContentReceivedArgumentsLock = NSLock() - private var editNewContentUnderlyingReceivedArguments: (eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, newContent: EditedContent)? + private nonisolated(unsafe) var editNewContentUnderlyingReceivedArguments: (eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, newContent: EditedContent)? var editNewContentReceivedArguments: (eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, newContent: EditedContent)? { get { editNewContentReceivedArgumentsLock.withLock { editNewContentUnderlyingReceivedArguments } } set { editNewContentReceivedArgumentsLock.withLock { editNewContentUnderlyingReceivedArguments = newValue } } } private let editNewContentReceivedInvocationsLock = NSLock() - private var editNewContentUnderlyingReceivedInvocations: [(eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, newContent: EditedContent)] = [] + private nonisolated(unsafe) var editNewContentUnderlyingReceivedInvocations: [(eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, newContent: EditedContent)] = [] var editNewContentReceivedInvocations: [(eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, newContent: EditedContent)] { get { editNewContentReceivedInvocationsLock.withLock { editNewContentUnderlyingReceivedInvocations } } set { editNewContentReceivedInvocationsLock.withLock { editNewContentUnderlyingReceivedInvocations = newValue } } } private let editNewContentReturnValueLock = NSLock() - private var editNewContentUnderlyingReturnValue: Result! + private nonisolated(unsafe) var editNewContentUnderlyingReturnValue: Result! var editNewContentReturnValue: Result! { get { editNewContentReturnValueLock.withLock { editNewContentUnderlyingReturnValue } } set { editNewContentReturnValueLock.withLock { editNewContentUnderlyingReturnValue = newValue } } } - var editNewContentClosure: ((TimelineItemIdentifier.EventOrTransactionID, EditedContent) async -> Result)? + nonisolated(unsafe) var editNewContentClosure: ((TimelineItemIdentifier.EventOrTransactionID, EditedContent) async -> Result)? - func edit(_ eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, newContent: EditedContent) async -> Result { + @concurrent func edit(_ eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, newContent: EditedContent) async -> Result { editNewContentCallsCountLock.withLock { editNewContentUnderlyingCallsCount += 1 } editNewContentReceivedArguments = (eventOrTransactionID: eventOrTransactionID, newContent: newContent) editNewContentReceivedInvocationsLock.withLock { editNewContentUnderlyingReceivedInvocations.append((eventOrTransactionID: eventOrTransactionID, newContent: newContent)) } @@ -13220,7 +13220,7 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { //MARK: - redact private let redactReasonCallsCountLock = NSLock() - private var redactReasonUnderlyingCallsCount = 0 + private nonisolated(unsafe) var redactReasonUnderlyingCallsCount = 0 var redactReasonCallsCount: Int { get { redactReasonCallsCountLock.withLock { redactReasonUnderlyingCallsCount } } set { redactReasonCallsCountLock.withLock { redactReasonUnderlyingCallsCount = newValue } } @@ -13229,27 +13229,27 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { return redactReasonCallsCount > 0 } private let redactReasonReceivedArgumentsLock = NSLock() - private var redactReasonUnderlyingReceivedArguments: (eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, reason: String?)? + private nonisolated(unsafe) var redactReasonUnderlyingReceivedArguments: (eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, reason: String?)? var redactReasonReceivedArguments: (eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, reason: String?)? { get { redactReasonReceivedArgumentsLock.withLock { redactReasonUnderlyingReceivedArguments } } set { redactReasonReceivedArgumentsLock.withLock { redactReasonUnderlyingReceivedArguments = newValue } } } private let redactReasonReceivedInvocationsLock = NSLock() - private var redactReasonUnderlyingReceivedInvocations: [(eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, reason: String?)] = [] + private nonisolated(unsafe) var redactReasonUnderlyingReceivedInvocations: [(eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, reason: String?)] = [] var redactReasonReceivedInvocations: [(eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, reason: String?)] { get { redactReasonReceivedInvocationsLock.withLock { redactReasonUnderlyingReceivedInvocations } } set { redactReasonReceivedInvocationsLock.withLock { redactReasonUnderlyingReceivedInvocations = newValue } } } private let redactReasonReturnValueLock = NSLock() - private var redactReasonUnderlyingReturnValue: Result! + private nonisolated(unsafe) var redactReasonUnderlyingReturnValue: Result! var redactReasonReturnValue: Result! { get { redactReasonReturnValueLock.withLock { redactReasonUnderlyingReturnValue } } set { redactReasonReturnValueLock.withLock { redactReasonUnderlyingReturnValue = newValue } } } - var redactReasonClosure: ((TimelineItemIdentifier.EventOrTransactionID, String?) async -> Result)? + nonisolated(unsafe) var redactReasonClosure: ((TimelineItemIdentifier.EventOrTransactionID, String?) async -> Result)? - func redact(_ eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, reason: String?) async -> Result { + @concurrent func redact(_ eventOrTransactionID: TimelineItemIdentifier.EventOrTransactionID, reason: String?) async -> Result { redactReasonCallsCountLock.withLock { redactReasonUnderlyingCallsCount += 1 } redactReasonReceivedArguments = (eventOrTransactionID: eventOrTransactionID, reason: reason) redactReasonReceivedInvocationsLock.withLock { redactReasonUnderlyingReceivedInvocations.append((eventOrTransactionID: eventOrTransactionID, reason: reason)) } @@ -13262,7 +13262,7 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { //MARK: - pin private let pinEventIDCallsCountLock = NSLock() - private var pinEventIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var pinEventIDUnderlyingCallsCount = 0 var pinEventIDCallsCount: Int { get { pinEventIDCallsCountLock.withLock { pinEventIDUnderlyingCallsCount } } set { pinEventIDCallsCountLock.withLock { pinEventIDUnderlyingCallsCount = newValue } } @@ -13271,27 +13271,27 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { return pinEventIDCallsCount > 0 } private let pinEventIDReceivedEventIDLock = NSLock() - private var pinEventIDUnderlyingReceivedEventID: String? + private nonisolated(unsafe) var pinEventIDUnderlyingReceivedEventID: String? var pinEventIDReceivedEventID: String? { get { pinEventIDReceivedEventIDLock.withLock { pinEventIDUnderlyingReceivedEventID } } set { pinEventIDReceivedEventIDLock.withLock { pinEventIDUnderlyingReceivedEventID = newValue } } } private let pinEventIDReceivedInvocationsLock = NSLock() - private var pinEventIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var pinEventIDUnderlyingReceivedInvocations: [String] = [] var pinEventIDReceivedInvocations: [String] { get { pinEventIDReceivedInvocationsLock.withLock { pinEventIDUnderlyingReceivedInvocations } } set { pinEventIDReceivedInvocationsLock.withLock { pinEventIDUnderlyingReceivedInvocations = newValue } } } private let pinEventIDReturnValueLock = NSLock() - private var pinEventIDUnderlyingReturnValue: Result! + private nonisolated(unsafe) var pinEventIDUnderlyingReturnValue: Result! var pinEventIDReturnValue: Result! { get { pinEventIDReturnValueLock.withLock { pinEventIDUnderlyingReturnValue } } set { pinEventIDReturnValueLock.withLock { pinEventIDUnderlyingReturnValue = newValue } } } - var pinEventIDClosure: ((String) async -> Result)? + nonisolated(unsafe) var pinEventIDClosure: ((String) async -> Result)? - func pin(eventID: String) async -> Result { + @concurrent func pin(eventID: String) async -> Result { pinEventIDCallsCountLock.withLock { pinEventIDUnderlyingCallsCount += 1 } pinEventIDReceivedEventID = eventID pinEventIDReceivedInvocationsLock.withLock { pinEventIDUnderlyingReceivedInvocations.append(eventID) } @@ -13304,7 +13304,7 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { //MARK: - unpin private let unpinEventIDCallsCountLock = NSLock() - private var unpinEventIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var unpinEventIDUnderlyingCallsCount = 0 var unpinEventIDCallsCount: Int { get { unpinEventIDCallsCountLock.withLock { unpinEventIDUnderlyingCallsCount } } set { unpinEventIDCallsCountLock.withLock { unpinEventIDUnderlyingCallsCount = newValue } } @@ -13313,27 +13313,27 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { return unpinEventIDCallsCount > 0 } private let unpinEventIDReceivedEventIDLock = NSLock() - private var unpinEventIDUnderlyingReceivedEventID: String? + private nonisolated(unsafe) var unpinEventIDUnderlyingReceivedEventID: String? var unpinEventIDReceivedEventID: String? { get { unpinEventIDReceivedEventIDLock.withLock { unpinEventIDUnderlyingReceivedEventID } } set { unpinEventIDReceivedEventIDLock.withLock { unpinEventIDUnderlyingReceivedEventID = newValue } } } private let unpinEventIDReceivedInvocationsLock = NSLock() - private var unpinEventIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var unpinEventIDUnderlyingReceivedInvocations: [String] = [] var unpinEventIDReceivedInvocations: [String] { get { unpinEventIDReceivedInvocationsLock.withLock { unpinEventIDUnderlyingReceivedInvocations } } set { unpinEventIDReceivedInvocationsLock.withLock { unpinEventIDUnderlyingReceivedInvocations = newValue } } } private let unpinEventIDReturnValueLock = NSLock() - private var unpinEventIDUnderlyingReturnValue: Result! + private nonisolated(unsafe) var unpinEventIDUnderlyingReturnValue: Result! var unpinEventIDReturnValue: Result! { get { unpinEventIDReturnValueLock.withLock { unpinEventIDUnderlyingReturnValue } } set { unpinEventIDReturnValueLock.withLock { unpinEventIDUnderlyingReturnValue = newValue } } } - var unpinEventIDClosure: ((String) async -> Result)? + nonisolated(unsafe) var unpinEventIDClosure: ((String) async -> Result)? - func unpin(eventID: String) async -> Result { + @concurrent func unpin(eventID: String) async -> Result { unpinEventIDCallsCountLock.withLock { unpinEventIDUnderlyingCallsCount += 1 } unpinEventIDReceivedEventID = eventID unpinEventIDReceivedInvocationsLock.withLock { unpinEventIDUnderlyingReceivedInvocations.append(eventID) } @@ -13346,7 +13346,7 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { //MARK: - sendAudio private let sendAudioUrlAudioInfoCaptionRequestHandleCallsCountLock = NSLock() - private var sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingCallsCount = 0 + private nonisolated(unsafe) var sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingCallsCount = 0 var sendAudioUrlAudioInfoCaptionRequestHandleCallsCount: Int { get { sendAudioUrlAudioInfoCaptionRequestHandleCallsCountLock.withLock { sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingCallsCount } } set { sendAudioUrlAudioInfoCaptionRequestHandleCallsCountLock.withLock { sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingCallsCount = newValue } } @@ -13356,14 +13356,14 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { } private let sendAudioUrlAudioInfoCaptionRequestHandleReturnValueLock = NSLock() - private var sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingReturnValue: Result! + private nonisolated(unsafe) var sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingReturnValue: Result! var sendAudioUrlAudioInfoCaptionRequestHandleReturnValue: Result! { get { sendAudioUrlAudioInfoCaptionRequestHandleReturnValueLock.withLock { sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingReturnValue } } set { sendAudioUrlAudioInfoCaptionRequestHandleReturnValueLock.withLock { sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingReturnValue = newValue } } } - var sendAudioUrlAudioInfoCaptionRequestHandleClosure: ((URL, AudioInfo, String?, @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? + nonisolated(unsafe) var sendAudioUrlAudioInfoCaptionRequestHandleClosure: ((URL, AudioInfo, String?, @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? - func sendAudio(url: URL, audioInfo: AudioInfo, caption: String?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { + @concurrent func sendAudio(url: URL, audioInfo: AudioInfo, caption: String?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { sendAudioUrlAudioInfoCaptionRequestHandleCallsCountLock.withLock { sendAudioUrlAudioInfoCaptionRequestHandleUnderlyingCallsCount += 1 } if let sendAudioUrlAudioInfoCaptionRequestHandleClosure = sendAudioUrlAudioInfoCaptionRequestHandleClosure { return await sendAudioUrlAudioInfoCaptionRequestHandleClosure(url, audioInfo, caption, requestHandle) @@ -13374,7 +13374,7 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { //MARK: - sendFile private let sendFileUrlFileInfoCaptionRequestHandleCallsCountLock = NSLock() - private var sendFileUrlFileInfoCaptionRequestHandleUnderlyingCallsCount = 0 + private nonisolated(unsafe) var sendFileUrlFileInfoCaptionRequestHandleUnderlyingCallsCount = 0 var sendFileUrlFileInfoCaptionRequestHandleCallsCount: Int { get { sendFileUrlFileInfoCaptionRequestHandleCallsCountLock.withLock { sendFileUrlFileInfoCaptionRequestHandleUnderlyingCallsCount } } set { sendFileUrlFileInfoCaptionRequestHandleCallsCountLock.withLock { sendFileUrlFileInfoCaptionRequestHandleUnderlyingCallsCount = newValue } } @@ -13384,14 +13384,14 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { } private let sendFileUrlFileInfoCaptionRequestHandleReturnValueLock = NSLock() - private var sendFileUrlFileInfoCaptionRequestHandleUnderlyingReturnValue: Result! + private nonisolated(unsafe) var sendFileUrlFileInfoCaptionRequestHandleUnderlyingReturnValue: Result! var sendFileUrlFileInfoCaptionRequestHandleReturnValue: Result! { get { sendFileUrlFileInfoCaptionRequestHandleReturnValueLock.withLock { sendFileUrlFileInfoCaptionRequestHandleUnderlyingReturnValue } } set { sendFileUrlFileInfoCaptionRequestHandleReturnValueLock.withLock { sendFileUrlFileInfoCaptionRequestHandleUnderlyingReturnValue = newValue } } } - var sendFileUrlFileInfoCaptionRequestHandleClosure: ((URL, FileInfo, String?, @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? + nonisolated(unsafe) var sendFileUrlFileInfoCaptionRequestHandleClosure: ((URL, FileInfo, String?, @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? - func sendFile(url: URL, fileInfo: FileInfo, caption: String?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { + @concurrent func sendFile(url: URL, fileInfo: FileInfo, caption: String?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { sendFileUrlFileInfoCaptionRequestHandleCallsCountLock.withLock { sendFileUrlFileInfoCaptionRequestHandleUnderlyingCallsCount += 1 } if let sendFileUrlFileInfoCaptionRequestHandleClosure = sendFileUrlFileInfoCaptionRequestHandleClosure { return await sendFileUrlFileInfoCaptionRequestHandleClosure(url, fileInfo, caption, requestHandle) @@ -13402,7 +13402,7 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { //MARK: - sendImage private let sendImageUrlThumbnailURLImageInfoCaptionRequestHandleCallsCountLock = NSLock() - private var sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingCallsCount = 0 + private nonisolated(unsafe) var sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingCallsCount = 0 var sendImageUrlThumbnailURLImageInfoCaptionRequestHandleCallsCount: Int { get { sendImageUrlThumbnailURLImageInfoCaptionRequestHandleCallsCountLock.withLock { sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingCallsCount } } set { sendImageUrlThumbnailURLImageInfoCaptionRequestHandleCallsCountLock.withLock { sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingCallsCount = newValue } } @@ -13412,14 +13412,14 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { } private let sendImageUrlThumbnailURLImageInfoCaptionRequestHandleReturnValueLock = NSLock() - private var sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingReturnValue: Result! + private nonisolated(unsafe) var sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingReturnValue: Result! var sendImageUrlThumbnailURLImageInfoCaptionRequestHandleReturnValue: Result! { get { sendImageUrlThumbnailURLImageInfoCaptionRequestHandleReturnValueLock.withLock { sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingReturnValue } } set { sendImageUrlThumbnailURLImageInfoCaptionRequestHandleReturnValueLock.withLock { sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingReturnValue = newValue } } } - var sendImageUrlThumbnailURLImageInfoCaptionRequestHandleClosure: ((URL, URL, ImageInfo, String?, @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? + nonisolated(unsafe) var sendImageUrlThumbnailURLImageInfoCaptionRequestHandleClosure: ((URL, URL, ImageInfo, String?, @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? - func sendImage(url: URL, thumbnailURL: URL, imageInfo: ImageInfo, caption: String?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { + @concurrent func sendImage(url: URL, thumbnailURL: URL, imageInfo: ImageInfo, caption: String?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { sendImageUrlThumbnailURLImageInfoCaptionRequestHandleCallsCountLock.withLock { sendImageUrlThumbnailURLImageInfoCaptionRequestHandleUnderlyingCallsCount += 1 } if let sendImageUrlThumbnailURLImageInfoCaptionRequestHandleClosure = sendImageUrlThumbnailURLImageInfoCaptionRequestHandleClosure { return await sendImageUrlThumbnailURLImageInfoCaptionRequestHandleClosure(url, thumbnailURL, imageInfo, caption, requestHandle) @@ -13430,7 +13430,7 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { //MARK: - sendLocation private let sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeCallsCountLock = NSLock() - private var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingCallsCount = 0 + private nonisolated(unsafe) var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingCallsCount = 0 var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeCallsCount: Int { get { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeCallsCountLock.withLock { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingCallsCount } } set { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeCallsCountLock.withLock { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingCallsCount = newValue } } @@ -13439,27 +13439,27 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { return sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeCallsCount > 0 } private let sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReceivedArgumentsLock = NSLock() - private var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReceivedArguments: (body: String, geoURI: GeoURI, description: String?, zoomLevel: UInt8?, assetType: AssetType?)? + private nonisolated(unsafe) var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReceivedArguments: (body: String, geoURI: GeoURI, description: String?, zoomLevel: UInt8?, assetType: AssetType?)? var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReceivedArguments: (body: String, geoURI: GeoURI, description: String?, zoomLevel: UInt8?, assetType: AssetType?)? { get { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReceivedArgumentsLock.withLock { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReceivedArguments } } set { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReceivedArgumentsLock.withLock { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReceivedArguments = newValue } } } private let sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReceivedInvocationsLock = NSLock() - private var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReceivedInvocations: [(body: String, geoURI: GeoURI, description: String?, zoomLevel: UInt8?, assetType: AssetType?)] = [] + private nonisolated(unsafe) var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReceivedInvocations: [(body: String, geoURI: GeoURI, description: String?, zoomLevel: UInt8?, assetType: AssetType?)] = [] var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReceivedInvocations: [(body: String, geoURI: GeoURI, description: String?, zoomLevel: UInt8?, assetType: AssetType?)] { get { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReceivedInvocationsLock.withLock { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReceivedInvocations } } set { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReceivedInvocationsLock.withLock { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReceivedInvocations = newValue } } } private let sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReturnValueLock = NSLock() - private var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReturnValue: Result! + private nonisolated(unsafe) var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReturnValue: Result! var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReturnValue: Result! { get { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReturnValueLock.withLock { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReturnValue } } set { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReturnValueLock.withLock { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReturnValue = newValue } } } - var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeClosure: ((String, GeoURI, String?, UInt8?, AssetType?) async -> Result)? + nonisolated(unsafe) var sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeClosure: ((String, GeoURI, String?, UInt8?, AssetType?) async -> Result)? - func sendLocation(body: String, geoURI: GeoURI, description: String?, zoomLevel: UInt8?, assetType: AssetType?) async -> Result { + @concurrent func sendLocation(body: String, geoURI: GeoURI, description: String?, zoomLevel: UInt8?, assetType: AssetType?) async -> Result { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeCallsCountLock.withLock { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingCallsCount += 1 } sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReceivedArguments = (body: body, geoURI: geoURI, description: description, zoomLevel: zoomLevel, assetType: assetType) sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeReceivedInvocationsLock.withLock { sendLocationBodyGeoURIDescriptionZoomLevelAssetTypeUnderlyingReceivedInvocations.append((body: body, geoURI: geoURI, description: description, zoomLevel: zoomLevel, assetType: assetType)) } @@ -13472,7 +13472,7 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { //MARK: - sendVideo private let sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleCallsCountLock = NSLock() - private var sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingCallsCount = 0 + private nonisolated(unsafe) var sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingCallsCount = 0 var sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleCallsCount: Int { get { sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleCallsCountLock.withLock { sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingCallsCount } } set { sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleCallsCountLock.withLock { sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingCallsCount = newValue } } @@ -13482,14 +13482,14 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { } private let sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleReturnValueLock = NSLock() - private var sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingReturnValue: Result! + private nonisolated(unsafe) var sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingReturnValue: Result! var sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleReturnValue: Result! { get { sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleReturnValueLock.withLock { sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingReturnValue } } set { sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleReturnValueLock.withLock { sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingReturnValue = newValue } } } - var sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleClosure: ((URL, URL, VideoInfo, String?, @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? + nonisolated(unsafe) var sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleClosure: ((URL, URL, VideoInfo, String?, @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? - func sendVideo(url: URL, thumbnailURL: URL, videoInfo: VideoInfo, caption: String?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { + @concurrent func sendVideo(url: URL, thumbnailURL: URL, videoInfo: VideoInfo, caption: String?, requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleCallsCountLock.withLock { sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleUnderlyingCallsCount += 1 } if let sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleClosure = sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleClosure { return await sendVideoUrlThumbnailURLVideoInfoCaptionRequestHandleClosure(url, thumbnailURL, videoInfo, caption, requestHandle) @@ -13500,7 +13500,7 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { //MARK: - sendVoiceMessage private let sendVoiceMessageUrlAudioInfoWaveformRequestHandleCallsCountLock = NSLock() - private var sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingCallsCount = 0 + private nonisolated(unsafe) var sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingCallsCount = 0 var sendVoiceMessageUrlAudioInfoWaveformRequestHandleCallsCount: Int { get { sendVoiceMessageUrlAudioInfoWaveformRequestHandleCallsCountLock.withLock { sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingCallsCount } } set { sendVoiceMessageUrlAudioInfoWaveformRequestHandleCallsCountLock.withLock { sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingCallsCount = newValue } } @@ -13510,14 +13510,14 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { } private let sendVoiceMessageUrlAudioInfoWaveformRequestHandleReturnValueLock = NSLock() - private var sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingReturnValue: Result! + private nonisolated(unsafe) var sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingReturnValue: Result! var sendVoiceMessageUrlAudioInfoWaveformRequestHandleReturnValue: Result! { get { sendVoiceMessageUrlAudioInfoWaveformRequestHandleReturnValueLock.withLock { sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingReturnValue } } set { sendVoiceMessageUrlAudioInfoWaveformRequestHandleReturnValueLock.withLock { sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingReturnValue = newValue } } } - var sendVoiceMessageUrlAudioInfoWaveformRequestHandleClosure: ((URL, AudioInfo, [Float], @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? + nonisolated(unsafe) var sendVoiceMessageUrlAudioInfoWaveformRequestHandleClosure: ((URL, AudioInfo, [Float], @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result)? - func sendVoiceMessage(url: URL, audioInfo: AudioInfo, waveform: [Float], requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { + @concurrent func sendVoiceMessage(url: URL, audioInfo: AudioInfo, waveform: [Float], requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { sendVoiceMessageUrlAudioInfoWaveformRequestHandleCallsCountLock.withLock { sendVoiceMessageUrlAudioInfoWaveformRequestHandleUnderlyingCallsCount += 1 } if let sendVoiceMessageUrlAudioInfoWaveformRequestHandleClosure = sendVoiceMessageUrlAudioInfoWaveformRequestHandleClosure { return await sendVoiceMessageUrlAudioInfoWaveformRequestHandleClosure(url, audioInfo, waveform, requestHandle) @@ -13528,7 +13528,7 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { //MARK: - sendReadReceipt private let sendReadReceiptForTypeCallsCountLock = NSLock() - private var sendReadReceiptForTypeUnderlyingCallsCount = 0 + private nonisolated(unsafe) var sendReadReceiptForTypeUnderlyingCallsCount = 0 var sendReadReceiptForTypeCallsCount: Int { get { sendReadReceiptForTypeCallsCountLock.withLock { sendReadReceiptForTypeUnderlyingCallsCount } } set { sendReadReceiptForTypeCallsCountLock.withLock { sendReadReceiptForTypeUnderlyingCallsCount = newValue } } @@ -13537,27 +13537,27 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { return sendReadReceiptForTypeCallsCount > 0 } private let sendReadReceiptForTypeReceivedArgumentsLock = NSLock() - private var sendReadReceiptForTypeUnderlyingReceivedArguments: (eventID: String, type: ReceiptType)? + private nonisolated(unsafe) var sendReadReceiptForTypeUnderlyingReceivedArguments: (eventID: String, type: ReceiptType)? var sendReadReceiptForTypeReceivedArguments: (eventID: String, type: ReceiptType)? { get { sendReadReceiptForTypeReceivedArgumentsLock.withLock { sendReadReceiptForTypeUnderlyingReceivedArguments } } set { sendReadReceiptForTypeReceivedArgumentsLock.withLock { sendReadReceiptForTypeUnderlyingReceivedArguments = newValue } } } private let sendReadReceiptForTypeReceivedInvocationsLock = NSLock() - private var sendReadReceiptForTypeUnderlyingReceivedInvocations: [(eventID: String, type: ReceiptType)] = [] + private nonisolated(unsafe) var sendReadReceiptForTypeUnderlyingReceivedInvocations: [(eventID: String, type: ReceiptType)] = [] var sendReadReceiptForTypeReceivedInvocations: [(eventID: String, type: ReceiptType)] { get { sendReadReceiptForTypeReceivedInvocationsLock.withLock { sendReadReceiptForTypeUnderlyingReceivedInvocations } } set { sendReadReceiptForTypeReceivedInvocationsLock.withLock { sendReadReceiptForTypeUnderlyingReceivedInvocations = newValue } } } private let sendReadReceiptForTypeReturnValueLock = NSLock() - private var sendReadReceiptForTypeUnderlyingReturnValue: Result! + private nonisolated(unsafe) var sendReadReceiptForTypeUnderlyingReturnValue: Result! var sendReadReceiptForTypeReturnValue: Result! { get { sendReadReceiptForTypeReturnValueLock.withLock { sendReadReceiptForTypeUnderlyingReturnValue } } set { sendReadReceiptForTypeReturnValueLock.withLock { sendReadReceiptForTypeUnderlyingReturnValue = newValue } } } - var sendReadReceiptForTypeClosure: ((String, ReceiptType) async -> Result)? + nonisolated(unsafe) var sendReadReceiptForTypeClosure: ((String, ReceiptType) async -> Result)? - func sendReadReceipt(for eventID: String, type: ReceiptType) async -> Result { + @concurrent func sendReadReceipt(for eventID: String, type: ReceiptType) async -> Result { sendReadReceiptForTypeCallsCountLock.withLock { sendReadReceiptForTypeUnderlyingCallsCount += 1 } sendReadReceiptForTypeReceivedArguments = (eventID: eventID, type: type) sendReadReceiptForTypeReceivedInvocationsLock.withLock { sendReadReceiptForTypeUnderlyingReceivedInvocations.append((eventID: eventID, type: type)) } @@ -13570,7 +13570,7 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { //MARK: - markAsRead private let markAsReadReceiptTypeCallsCountLock = NSLock() - private var markAsReadReceiptTypeUnderlyingCallsCount = 0 + private nonisolated(unsafe) var markAsReadReceiptTypeUnderlyingCallsCount = 0 var markAsReadReceiptTypeCallsCount: Int { get { markAsReadReceiptTypeCallsCountLock.withLock { markAsReadReceiptTypeUnderlyingCallsCount } } set { markAsReadReceiptTypeCallsCountLock.withLock { markAsReadReceiptTypeUnderlyingCallsCount = newValue } } @@ -13579,27 +13579,27 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { return markAsReadReceiptTypeCallsCount > 0 } private let markAsReadReceiptTypeReceivedReceiptTypeLock = NSLock() - private var markAsReadReceiptTypeUnderlyingReceivedReceiptType: ReceiptType? + private nonisolated(unsafe) var markAsReadReceiptTypeUnderlyingReceivedReceiptType: ReceiptType? var markAsReadReceiptTypeReceivedReceiptType: ReceiptType? { get { markAsReadReceiptTypeReceivedReceiptTypeLock.withLock { markAsReadReceiptTypeUnderlyingReceivedReceiptType } } set { markAsReadReceiptTypeReceivedReceiptTypeLock.withLock { markAsReadReceiptTypeUnderlyingReceivedReceiptType = newValue } } } private let markAsReadReceiptTypeReceivedInvocationsLock = NSLock() - private var markAsReadReceiptTypeUnderlyingReceivedInvocations: [ReceiptType] = [] + private nonisolated(unsafe) var markAsReadReceiptTypeUnderlyingReceivedInvocations: [ReceiptType] = [] var markAsReadReceiptTypeReceivedInvocations: [ReceiptType] { get { markAsReadReceiptTypeReceivedInvocationsLock.withLock { markAsReadReceiptTypeUnderlyingReceivedInvocations } } set { markAsReadReceiptTypeReceivedInvocationsLock.withLock { markAsReadReceiptTypeUnderlyingReceivedInvocations = newValue } } } private let markAsReadReceiptTypeReturnValueLock = NSLock() - private var markAsReadReceiptTypeUnderlyingReturnValue: Result! + private nonisolated(unsafe) var markAsReadReceiptTypeUnderlyingReturnValue: Result! var markAsReadReceiptTypeReturnValue: Result! { get { markAsReadReceiptTypeReturnValueLock.withLock { markAsReadReceiptTypeUnderlyingReturnValue } } set { markAsReadReceiptTypeReturnValueLock.withLock { markAsReadReceiptTypeUnderlyingReturnValue = newValue } } } - var markAsReadReceiptTypeClosure: ((ReceiptType) async -> Result)? + nonisolated(unsafe) var markAsReadReceiptTypeClosure: ((ReceiptType) async -> Result)? - func markAsRead(receiptType: ReceiptType) async -> Result { + @concurrent func markAsRead(receiptType: ReceiptType) async -> Result { markAsReadReceiptTypeCallsCountLock.withLock { markAsReadReceiptTypeUnderlyingCallsCount += 1 } markAsReadReceiptTypeReceivedReceiptType = receiptType markAsReadReceiptTypeReceivedInvocationsLock.withLock { markAsReadReceiptTypeUnderlyingReceivedInvocations.append(receiptType) } @@ -13612,7 +13612,7 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { //MARK: - sendMessageEventContent private let sendMessageEventContentCallsCountLock = NSLock() - private var sendMessageEventContentUnderlyingCallsCount = 0 + private nonisolated(unsafe) var sendMessageEventContentUnderlyingCallsCount = 0 var sendMessageEventContentCallsCount: Int { get { sendMessageEventContentCallsCountLock.withLock { sendMessageEventContentUnderlyingCallsCount } } set { sendMessageEventContentCallsCountLock.withLock { sendMessageEventContentUnderlyingCallsCount = newValue } } @@ -13621,27 +13621,27 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { return sendMessageEventContentCallsCount > 0 } private let sendMessageEventContentReceivedMessageContentLock = NSLock() - private var sendMessageEventContentUnderlyingReceivedMessageContent: RoomMessageEventContentWithoutRelation? + private nonisolated(unsafe) var sendMessageEventContentUnderlyingReceivedMessageContent: RoomMessageEventContentWithoutRelation? var sendMessageEventContentReceivedMessageContent: RoomMessageEventContentWithoutRelation? { get { sendMessageEventContentReceivedMessageContentLock.withLock { sendMessageEventContentUnderlyingReceivedMessageContent } } set { sendMessageEventContentReceivedMessageContentLock.withLock { sendMessageEventContentUnderlyingReceivedMessageContent = newValue } } } private let sendMessageEventContentReceivedInvocationsLock = NSLock() - private var sendMessageEventContentUnderlyingReceivedInvocations: [RoomMessageEventContentWithoutRelation] = [] + private nonisolated(unsafe) var sendMessageEventContentUnderlyingReceivedInvocations: [RoomMessageEventContentWithoutRelation] = [] var sendMessageEventContentReceivedInvocations: [RoomMessageEventContentWithoutRelation] { get { sendMessageEventContentReceivedInvocationsLock.withLock { sendMessageEventContentUnderlyingReceivedInvocations } } set { sendMessageEventContentReceivedInvocationsLock.withLock { sendMessageEventContentUnderlyingReceivedInvocations = newValue } } } private let sendMessageEventContentReturnValueLock = NSLock() - private var sendMessageEventContentUnderlyingReturnValue: Result! + private nonisolated(unsafe) var sendMessageEventContentUnderlyingReturnValue: Result! var sendMessageEventContentReturnValue: Result! { get { sendMessageEventContentReturnValueLock.withLock { sendMessageEventContentUnderlyingReturnValue } } set { sendMessageEventContentReturnValueLock.withLock { sendMessageEventContentUnderlyingReturnValue = newValue } } } - var sendMessageEventContentClosure: ((RoomMessageEventContentWithoutRelation) async -> Result)? + nonisolated(unsafe) var sendMessageEventContentClosure: ((RoomMessageEventContentWithoutRelation) async -> Result)? - func sendMessageEventContent(_ messageContent: RoomMessageEventContentWithoutRelation) async -> Result { + @concurrent func sendMessageEventContent(_ messageContent: RoomMessageEventContentWithoutRelation) async -> Result { sendMessageEventContentCallsCountLock.withLock { sendMessageEventContentUnderlyingCallsCount += 1 } sendMessageEventContentReceivedMessageContent = messageContent sendMessageEventContentReceivedInvocationsLock.withLock { sendMessageEventContentUnderlyingReceivedInvocations.append(messageContent) } @@ -13654,7 +13654,7 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { //MARK: - sendMessage private let sendMessageHtmlInReplyToEventIDIntentionalMentionsCallsCountLock = NSLock() - private var sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingCallsCount = 0 + private nonisolated(unsafe) var sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingCallsCount = 0 var sendMessageHtmlInReplyToEventIDIntentionalMentionsCallsCount: Int { get { sendMessageHtmlInReplyToEventIDIntentionalMentionsCallsCountLock.withLock { sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingCallsCount } } set { sendMessageHtmlInReplyToEventIDIntentionalMentionsCallsCountLock.withLock { sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingCallsCount = newValue } } @@ -13663,27 +13663,27 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { return sendMessageHtmlInReplyToEventIDIntentionalMentionsCallsCount > 0 } private let sendMessageHtmlInReplyToEventIDIntentionalMentionsReceivedArgumentsLock = NSLock() - private var sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingReceivedArguments: (message: String, html: String?, inReplyToEventID: String?, intentionalMentions: IntentionalMentions)? + private nonisolated(unsafe) var sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingReceivedArguments: (message: String, html: String?, inReplyToEventID: String?, intentionalMentions: IntentionalMentions)? var sendMessageHtmlInReplyToEventIDIntentionalMentionsReceivedArguments: (message: String, html: String?, inReplyToEventID: String?, intentionalMentions: IntentionalMentions)? { get { sendMessageHtmlInReplyToEventIDIntentionalMentionsReceivedArgumentsLock.withLock { sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingReceivedArguments } } set { sendMessageHtmlInReplyToEventIDIntentionalMentionsReceivedArgumentsLock.withLock { sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingReceivedArguments = newValue } } } private let sendMessageHtmlInReplyToEventIDIntentionalMentionsReceivedInvocationsLock = NSLock() - private var sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingReceivedInvocations: [(message: String, html: String?, inReplyToEventID: String?, intentionalMentions: IntentionalMentions)] = [] + private nonisolated(unsafe) var sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingReceivedInvocations: [(message: String, html: String?, inReplyToEventID: String?, intentionalMentions: IntentionalMentions)] = [] var sendMessageHtmlInReplyToEventIDIntentionalMentionsReceivedInvocations: [(message: String, html: String?, inReplyToEventID: String?, intentionalMentions: IntentionalMentions)] { get { sendMessageHtmlInReplyToEventIDIntentionalMentionsReceivedInvocationsLock.withLock { sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingReceivedInvocations } } set { sendMessageHtmlInReplyToEventIDIntentionalMentionsReceivedInvocationsLock.withLock { sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingReceivedInvocations = newValue } } } private let sendMessageHtmlInReplyToEventIDIntentionalMentionsReturnValueLock = NSLock() - private var sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingReturnValue: Result! + private nonisolated(unsafe) var sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingReturnValue: Result! var sendMessageHtmlInReplyToEventIDIntentionalMentionsReturnValue: Result! { get { sendMessageHtmlInReplyToEventIDIntentionalMentionsReturnValueLock.withLock { sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingReturnValue } } set { sendMessageHtmlInReplyToEventIDIntentionalMentionsReturnValueLock.withLock { sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingReturnValue = newValue } } } - var sendMessageHtmlInReplyToEventIDIntentionalMentionsClosure: ((String, String?, String?, IntentionalMentions) async -> Result)? + nonisolated(unsafe) var sendMessageHtmlInReplyToEventIDIntentionalMentionsClosure: ((String, String?, String?, IntentionalMentions) async -> Result)? - func sendMessage(_ message: String, html: String?, inReplyToEventID: String?, intentionalMentions: IntentionalMentions) async -> Result { + @concurrent func sendMessage(_ message: String, html: String?, inReplyToEventID: String?, intentionalMentions: IntentionalMentions) async -> Result { sendMessageHtmlInReplyToEventIDIntentionalMentionsCallsCountLock.withLock { sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingCallsCount += 1 } sendMessageHtmlInReplyToEventIDIntentionalMentionsReceivedArguments = (message: message, html: html, inReplyToEventID: inReplyToEventID, intentionalMentions: intentionalMentions) sendMessageHtmlInReplyToEventIDIntentionalMentionsReceivedInvocationsLock.withLock { sendMessageHtmlInReplyToEventIDIntentionalMentionsUnderlyingReceivedInvocations.append((message: message, html: html, inReplyToEventID: inReplyToEventID, intentionalMentions: intentionalMentions)) } @@ -13696,7 +13696,7 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { //MARK: - toggleReaction private let toggleReactionToCallsCountLock = NSLock() - private var toggleReactionToUnderlyingCallsCount = 0 + private nonisolated(unsafe) var toggleReactionToUnderlyingCallsCount = 0 var toggleReactionToCallsCount: Int { get { toggleReactionToCallsCountLock.withLock { toggleReactionToUnderlyingCallsCount } } set { toggleReactionToCallsCountLock.withLock { toggleReactionToUnderlyingCallsCount = newValue } } @@ -13705,27 +13705,27 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { return toggleReactionToCallsCount > 0 } private let toggleReactionToReceivedArgumentsLock = NSLock() - private var toggleReactionToUnderlyingReceivedArguments: (reaction: String, eventID: TimelineItemIdentifier.EventOrTransactionID)? + private nonisolated(unsafe) var toggleReactionToUnderlyingReceivedArguments: (reaction: String, eventID: TimelineItemIdentifier.EventOrTransactionID)? var toggleReactionToReceivedArguments: (reaction: String, eventID: TimelineItemIdentifier.EventOrTransactionID)? { get { toggleReactionToReceivedArgumentsLock.withLock { toggleReactionToUnderlyingReceivedArguments } } set { toggleReactionToReceivedArgumentsLock.withLock { toggleReactionToUnderlyingReceivedArguments = newValue } } } private let toggleReactionToReceivedInvocationsLock = NSLock() - private var toggleReactionToUnderlyingReceivedInvocations: [(reaction: String, eventID: TimelineItemIdentifier.EventOrTransactionID)] = [] + private nonisolated(unsafe) var toggleReactionToUnderlyingReceivedInvocations: [(reaction: String, eventID: TimelineItemIdentifier.EventOrTransactionID)] = [] var toggleReactionToReceivedInvocations: [(reaction: String, eventID: TimelineItemIdentifier.EventOrTransactionID)] { get { toggleReactionToReceivedInvocationsLock.withLock { toggleReactionToUnderlyingReceivedInvocations } } set { toggleReactionToReceivedInvocationsLock.withLock { toggleReactionToUnderlyingReceivedInvocations = newValue } } } private let toggleReactionToReturnValueLock = NSLock() - private var toggleReactionToUnderlyingReturnValue: Result! + private nonisolated(unsafe) var toggleReactionToUnderlyingReturnValue: Result! var toggleReactionToReturnValue: Result! { get { toggleReactionToReturnValueLock.withLock { toggleReactionToUnderlyingReturnValue } } set { toggleReactionToReturnValueLock.withLock { toggleReactionToUnderlyingReturnValue = newValue } } } - var toggleReactionToClosure: ((String, TimelineItemIdentifier.EventOrTransactionID) async -> Result)? + nonisolated(unsafe) var toggleReactionToClosure: ((String, TimelineItemIdentifier.EventOrTransactionID) async -> Result)? - func toggleReaction(_ reaction: String, to eventID: TimelineItemIdentifier.EventOrTransactionID) async -> Result { + @concurrent func toggleReaction(_ reaction: String, to eventID: TimelineItemIdentifier.EventOrTransactionID) async -> Result { toggleReactionToCallsCountLock.withLock { toggleReactionToUnderlyingCallsCount += 1 } toggleReactionToReceivedArguments = (reaction: reaction, eventID: eventID) toggleReactionToReceivedInvocationsLock.withLock { toggleReactionToUnderlyingReceivedInvocations.append((reaction: reaction, eventID: eventID)) } @@ -13738,7 +13738,7 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { //MARK: - createPoll private let createPollQuestionAnswersPollKindCallsCountLock = NSLock() - private var createPollQuestionAnswersPollKindUnderlyingCallsCount = 0 + private nonisolated(unsafe) var createPollQuestionAnswersPollKindUnderlyingCallsCount = 0 var createPollQuestionAnswersPollKindCallsCount: Int { get { createPollQuestionAnswersPollKindCallsCountLock.withLock { createPollQuestionAnswersPollKindUnderlyingCallsCount } } set { createPollQuestionAnswersPollKindCallsCountLock.withLock { createPollQuestionAnswersPollKindUnderlyingCallsCount = newValue } } @@ -13747,27 +13747,27 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { return createPollQuestionAnswersPollKindCallsCount > 0 } private let createPollQuestionAnswersPollKindReceivedArgumentsLock = NSLock() - private var createPollQuestionAnswersPollKindUnderlyingReceivedArguments: (question: String, answers: [String], pollKind: Poll.Kind)? + private nonisolated(unsafe) var createPollQuestionAnswersPollKindUnderlyingReceivedArguments: (question: String, answers: [String], pollKind: Poll.Kind)? var createPollQuestionAnswersPollKindReceivedArguments: (question: String, answers: [String], pollKind: Poll.Kind)? { get { createPollQuestionAnswersPollKindReceivedArgumentsLock.withLock { createPollQuestionAnswersPollKindUnderlyingReceivedArguments } } set { createPollQuestionAnswersPollKindReceivedArgumentsLock.withLock { createPollQuestionAnswersPollKindUnderlyingReceivedArguments = newValue } } } private let createPollQuestionAnswersPollKindReceivedInvocationsLock = NSLock() - private var createPollQuestionAnswersPollKindUnderlyingReceivedInvocations: [(question: String, answers: [String], pollKind: Poll.Kind)] = [] + private nonisolated(unsafe) var createPollQuestionAnswersPollKindUnderlyingReceivedInvocations: [(question: String, answers: [String], pollKind: Poll.Kind)] = [] var createPollQuestionAnswersPollKindReceivedInvocations: [(question: String, answers: [String], pollKind: Poll.Kind)] { get { createPollQuestionAnswersPollKindReceivedInvocationsLock.withLock { createPollQuestionAnswersPollKindUnderlyingReceivedInvocations } } set { createPollQuestionAnswersPollKindReceivedInvocationsLock.withLock { createPollQuestionAnswersPollKindUnderlyingReceivedInvocations = newValue } } } private let createPollQuestionAnswersPollKindReturnValueLock = NSLock() - private var createPollQuestionAnswersPollKindUnderlyingReturnValue: Result! + private nonisolated(unsafe) var createPollQuestionAnswersPollKindUnderlyingReturnValue: Result! var createPollQuestionAnswersPollKindReturnValue: Result! { get { createPollQuestionAnswersPollKindReturnValueLock.withLock { createPollQuestionAnswersPollKindUnderlyingReturnValue } } set { createPollQuestionAnswersPollKindReturnValueLock.withLock { createPollQuestionAnswersPollKindUnderlyingReturnValue = newValue } } } - var createPollQuestionAnswersPollKindClosure: ((String, [String], Poll.Kind) async -> Result)? + nonisolated(unsafe) var createPollQuestionAnswersPollKindClosure: ((String, [String], Poll.Kind) async -> Result)? - func createPoll(question: String, answers: [String], pollKind: Poll.Kind) async -> Result { + @concurrent func createPoll(question: String, answers: [String], pollKind: Poll.Kind) async -> Result { createPollQuestionAnswersPollKindCallsCountLock.withLock { createPollQuestionAnswersPollKindUnderlyingCallsCount += 1 } createPollQuestionAnswersPollKindReceivedArguments = (question: question, answers: answers, pollKind: pollKind) createPollQuestionAnswersPollKindReceivedInvocationsLock.withLock { createPollQuestionAnswersPollKindUnderlyingReceivedInvocations.append((question: question, answers: answers, pollKind: pollKind)) } @@ -13780,7 +13780,7 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { //MARK: - editPoll private let editPollOriginalQuestionAnswersPollKindCallsCountLock = NSLock() - private var editPollOriginalQuestionAnswersPollKindUnderlyingCallsCount = 0 + private nonisolated(unsafe) var editPollOriginalQuestionAnswersPollKindUnderlyingCallsCount = 0 var editPollOriginalQuestionAnswersPollKindCallsCount: Int { get { editPollOriginalQuestionAnswersPollKindCallsCountLock.withLock { editPollOriginalQuestionAnswersPollKindUnderlyingCallsCount } } set { editPollOriginalQuestionAnswersPollKindCallsCountLock.withLock { editPollOriginalQuestionAnswersPollKindUnderlyingCallsCount = newValue } } @@ -13789,27 +13789,27 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { return editPollOriginalQuestionAnswersPollKindCallsCount > 0 } private let editPollOriginalQuestionAnswersPollKindReceivedArgumentsLock = NSLock() - private var editPollOriginalQuestionAnswersPollKindUnderlyingReceivedArguments: (eventID: String, question: String, answers: [String], pollKind: Poll.Kind)? + private nonisolated(unsafe) var editPollOriginalQuestionAnswersPollKindUnderlyingReceivedArguments: (eventID: String, question: String, answers: [String], pollKind: Poll.Kind)? var editPollOriginalQuestionAnswersPollKindReceivedArguments: (eventID: String, question: String, answers: [String], pollKind: Poll.Kind)? { get { editPollOriginalQuestionAnswersPollKindReceivedArgumentsLock.withLock { editPollOriginalQuestionAnswersPollKindUnderlyingReceivedArguments } } set { editPollOriginalQuestionAnswersPollKindReceivedArgumentsLock.withLock { editPollOriginalQuestionAnswersPollKindUnderlyingReceivedArguments = newValue } } } private let editPollOriginalQuestionAnswersPollKindReceivedInvocationsLock = NSLock() - private var editPollOriginalQuestionAnswersPollKindUnderlyingReceivedInvocations: [(eventID: String, question: String, answers: [String], pollKind: Poll.Kind)] = [] + private nonisolated(unsafe) var editPollOriginalQuestionAnswersPollKindUnderlyingReceivedInvocations: [(eventID: String, question: String, answers: [String], pollKind: Poll.Kind)] = [] var editPollOriginalQuestionAnswersPollKindReceivedInvocations: [(eventID: String, question: String, answers: [String], pollKind: Poll.Kind)] { get { editPollOriginalQuestionAnswersPollKindReceivedInvocationsLock.withLock { editPollOriginalQuestionAnswersPollKindUnderlyingReceivedInvocations } } set { editPollOriginalQuestionAnswersPollKindReceivedInvocationsLock.withLock { editPollOriginalQuestionAnswersPollKindUnderlyingReceivedInvocations = newValue } } } private let editPollOriginalQuestionAnswersPollKindReturnValueLock = NSLock() - private var editPollOriginalQuestionAnswersPollKindUnderlyingReturnValue: Result! + private nonisolated(unsafe) var editPollOriginalQuestionAnswersPollKindUnderlyingReturnValue: Result! var editPollOriginalQuestionAnswersPollKindReturnValue: Result! { get { editPollOriginalQuestionAnswersPollKindReturnValueLock.withLock { editPollOriginalQuestionAnswersPollKindUnderlyingReturnValue } } set { editPollOriginalQuestionAnswersPollKindReturnValueLock.withLock { editPollOriginalQuestionAnswersPollKindUnderlyingReturnValue = newValue } } } - var editPollOriginalQuestionAnswersPollKindClosure: ((String, String, [String], Poll.Kind) async -> Result)? + nonisolated(unsafe) var editPollOriginalQuestionAnswersPollKindClosure: ((String, String, [String], Poll.Kind) async -> Result)? - func editPoll(original eventID: String, question: String, answers: [String], pollKind: Poll.Kind) async -> Result { + @concurrent func editPoll(original eventID: String, question: String, answers: [String], pollKind: Poll.Kind) async -> Result { editPollOriginalQuestionAnswersPollKindCallsCountLock.withLock { editPollOriginalQuestionAnswersPollKindUnderlyingCallsCount += 1 } editPollOriginalQuestionAnswersPollKindReceivedArguments = (eventID: eventID, question: question, answers: answers, pollKind: pollKind) editPollOriginalQuestionAnswersPollKindReceivedInvocationsLock.withLock { editPollOriginalQuestionAnswersPollKindUnderlyingReceivedInvocations.append((eventID: eventID, question: question, answers: answers, pollKind: pollKind)) } @@ -13822,7 +13822,7 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { //MARK: - sendPollResponse private let sendPollResponsePollStartIDAnswersCallsCountLock = NSLock() - private var sendPollResponsePollStartIDAnswersUnderlyingCallsCount = 0 + private nonisolated(unsafe) var sendPollResponsePollStartIDAnswersUnderlyingCallsCount = 0 var sendPollResponsePollStartIDAnswersCallsCount: Int { get { sendPollResponsePollStartIDAnswersCallsCountLock.withLock { sendPollResponsePollStartIDAnswersUnderlyingCallsCount } } set { sendPollResponsePollStartIDAnswersCallsCountLock.withLock { sendPollResponsePollStartIDAnswersUnderlyingCallsCount = newValue } } @@ -13831,27 +13831,27 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { return sendPollResponsePollStartIDAnswersCallsCount > 0 } private let sendPollResponsePollStartIDAnswersReceivedArgumentsLock = NSLock() - private var sendPollResponsePollStartIDAnswersUnderlyingReceivedArguments: (pollStartID: String, answers: [String])? + private nonisolated(unsafe) var sendPollResponsePollStartIDAnswersUnderlyingReceivedArguments: (pollStartID: String, answers: [String])? var sendPollResponsePollStartIDAnswersReceivedArguments: (pollStartID: String, answers: [String])? { get { sendPollResponsePollStartIDAnswersReceivedArgumentsLock.withLock { sendPollResponsePollStartIDAnswersUnderlyingReceivedArguments } } set { sendPollResponsePollStartIDAnswersReceivedArgumentsLock.withLock { sendPollResponsePollStartIDAnswersUnderlyingReceivedArguments = newValue } } } private let sendPollResponsePollStartIDAnswersReceivedInvocationsLock = NSLock() - private var sendPollResponsePollStartIDAnswersUnderlyingReceivedInvocations: [(pollStartID: String, answers: [String])] = [] + private nonisolated(unsafe) var sendPollResponsePollStartIDAnswersUnderlyingReceivedInvocations: [(pollStartID: String, answers: [String])] = [] var sendPollResponsePollStartIDAnswersReceivedInvocations: [(pollStartID: String, answers: [String])] { get { sendPollResponsePollStartIDAnswersReceivedInvocationsLock.withLock { sendPollResponsePollStartIDAnswersUnderlyingReceivedInvocations } } set { sendPollResponsePollStartIDAnswersReceivedInvocationsLock.withLock { sendPollResponsePollStartIDAnswersUnderlyingReceivedInvocations = newValue } } } private let sendPollResponsePollStartIDAnswersReturnValueLock = NSLock() - private var sendPollResponsePollStartIDAnswersUnderlyingReturnValue: Result! + private nonisolated(unsafe) var sendPollResponsePollStartIDAnswersUnderlyingReturnValue: Result! var sendPollResponsePollStartIDAnswersReturnValue: Result! { get { sendPollResponsePollStartIDAnswersReturnValueLock.withLock { sendPollResponsePollStartIDAnswersUnderlyingReturnValue } } set { sendPollResponsePollStartIDAnswersReturnValueLock.withLock { sendPollResponsePollStartIDAnswersUnderlyingReturnValue = newValue } } } - var sendPollResponsePollStartIDAnswersClosure: ((String, [String]) async -> Result)? + nonisolated(unsafe) var sendPollResponsePollStartIDAnswersClosure: ((String, [String]) async -> Result)? - func sendPollResponse(pollStartID: String, answers: [String]) async -> Result { + @concurrent func sendPollResponse(pollStartID: String, answers: [String]) async -> Result { sendPollResponsePollStartIDAnswersCallsCountLock.withLock { sendPollResponsePollStartIDAnswersUnderlyingCallsCount += 1 } sendPollResponsePollStartIDAnswersReceivedArguments = (pollStartID: pollStartID, answers: answers) sendPollResponsePollStartIDAnswersReceivedInvocationsLock.withLock { sendPollResponsePollStartIDAnswersUnderlyingReceivedInvocations.append((pollStartID: pollStartID, answers: answers)) } @@ -13864,7 +13864,7 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { //MARK: - endPoll private let endPollPollStartIDTextCallsCountLock = NSLock() - private var endPollPollStartIDTextUnderlyingCallsCount = 0 + private nonisolated(unsafe) var endPollPollStartIDTextUnderlyingCallsCount = 0 var endPollPollStartIDTextCallsCount: Int { get { endPollPollStartIDTextCallsCountLock.withLock { endPollPollStartIDTextUnderlyingCallsCount } } set { endPollPollStartIDTextCallsCountLock.withLock { endPollPollStartIDTextUnderlyingCallsCount = newValue } } @@ -13873,27 +13873,27 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { return endPollPollStartIDTextCallsCount > 0 } private let endPollPollStartIDTextReceivedArgumentsLock = NSLock() - private var endPollPollStartIDTextUnderlyingReceivedArguments: (pollStartID: String, text: String)? + private nonisolated(unsafe) var endPollPollStartIDTextUnderlyingReceivedArguments: (pollStartID: String, text: String)? var endPollPollStartIDTextReceivedArguments: (pollStartID: String, text: String)? { get { endPollPollStartIDTextReceivedArgumentsLock.withLock { endPollPollStartIDTextUnderlyingReceivedArguments } } set { endPollPollStartIDTextReceivedArgumentsLock.withLock { endPollPollStartIDTextUnderlyingReceivedArguments = newValue } } } private let endPollPollStartIDTextReceivedInvocationsLock = NSLock() - private var endPollPollStartIDTextUnderlyingReceivedInvocations: [(pollStartID: String, text: String)] = [] + private nonisolated(unsafe) var endPollPollStartIDTextUnderlyingReceivedInvocations: [(pollStartID: String, text: String)] = [] var endPollPollStartIDTextReceivedInvocations: [(pollStartID: String, text: String)] { get { endPollPollStartIDTextReceivedInvocationsLock.withLock { endPollPollStartIDTextUnderlyingReceivedInvocations } } set { endPollPollStartIDTextReceivedInvocationsLock.withLock { endPollPollStartIDTextUnderlyingReceivedInvocations = newValue } } } private let endPollPollStartIDTextReturnValueLock = NSLock() - private var endPollPollStartIDTextUnderlyingReturnValue: Result! + private nonisolated(unsafe) var endPollPollStartIDTextUnderlyingReturnValue: Result! var endPollPollStartIDTextReturnValue: Result! { get { endPollPollStartIDTextReturnValueLock.withLock { endPollPollStartIDTextUnderlyingReturnValue } } set { endPollPollStartIDTextReturnValueLock.withLock { endPollPollStartIDTextUnderlyingReturnValue = newValue } } } - var endPollPollStartIDTextClosure: ((String, String) async -> Result)? + nonisolated(unsafe) var endPollPollStartIDTextClosure: ((String, String) async -> Result)? - func endPoll(pollStartID: String, text: String) async -> Result { + @concurrent func endPoll(pollStartID: String, text: String) async -> Result { endPollPollStartIDTextCallsCountLock.withLock { endPollPollStartIDTextUnderlyingCallsCount += 1 } endPollPollStartIDTextReceivedArguments = (pollStartID: pollStartID, text: text) endPollPollStartIDTextReceivedInvocationsLock.withLock { endPollPollStartIDTextUnderlyingReceivedInvocations.append((pollStartID: pollStartID, text: text)) } @@ -13906,7 +13906,7 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { //MARK: - getLoadedReplyDetails private let getLoadedReplyDetailsEventIDCallsCountLock = NSLock() - private var getLoadedReplyDetailsEventIDUnderlyingCallsCount = 0 + private nonisolated(unsafe) var getLoadedReplyDetailsEventIDUnderlyingCallsCount = 0 var getLoadedReplyDetailsEventIDCallsCount: Int { get { getLoadedReplyDetailsEventIDCallsCountLock.withLock { getLoadedReplyDetailsEventIDUnderlyingCallsCount } } set { getLoadedReplyDetailsEventIDCallsCountLock.withLock { getLoadedReplyDetailsEventIDUnderlyingCallsCount = newValue } } @@ -13915,27 +13915,27 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { return getLoadedReplyDetailsEventIDCallsCount > 0 } private let getLoadedReplyDetailsEventIDReceivedEventIDLock = NSLock() - private var getLoadedReplyDetailsEventIDUnderlyingReceivedEventID: String? + private nonisolated(unsafe) var getLoadedReplyDetailsEventIDUnderlyingReceivedEventID: String? var getLoadedReplyDetailsEventIDReceivedEventID: String? { get { getLoadedReplyDetailsEventIDReceivedEventIDLock.withLock { getLoadedReplyDetailsEventIDUnderlyingReceivedEventID } } set { getLoadedReplyDetailsEventIDReceivedEventIDLock.withLock { getLoadedReplyDetailsEventIDUnderlyingReceivedEventID = newValue } } } private let getLoadedReplyDetailsEventIDReceivedInvocationsLock = NSLock() - private var getLoadedReplyDetailsEventIDUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var getLoadedReplyDetailsEventIDUnderlyingReceivedInvocations: [String] = [] var getLoadedReplyDetailsEventIDReceivedInvocations: [String] { get { getLoadedReplyDetailsEventIDReceivedInvocationsLock.withLock { getLoadedReplyDetailsEventIDUnderlyingReceivedInvocations } } set { getLoadedReplyDetailsEventIDReceivedInvocationsLock.withLock { getLoadedReplyDetailsEventIDUnderlyingReceivedInvocations = newValue } } } private let getLoadedReplyDetailsEventIDReturnValueLock = NSLock() - private var getLoadedReplyDetailsEventIDUnderlyingReturnValue: Result! + private nonisolated(unsafe) var getLoadedReplyDetailsEventIDUnderlyingReturnValue: Result! var getLoadedReplyDetailsEventIDReturnValue: Result! { get { getLoadedReplyDetailsEventIDReturnValueLock.withLock { getLoadedReplyDetailsEventIDUnderlyingReturnValue } } set { getLoadedReplyDetailsEventIDReturnValueLock.withLock { getLoadedReplyDetailsEventIDUnderlyingReturnValue = newValue } } } - var getLoadedReplyDetailsEventIDClosure: ((String) async -> Result)? + nonisolated(unsafe) var getLoadedReplyDetailsEventIDClosure: ((String) async -> Result)? - func getLoadedReplyDetails(eventID: String) async -> Result { + @concurrent func getLoadedReplyDetails(eventID: String) async -> Result { getLoadedReplyDetailsEventIDCallsCountLock.withLock { getLoadedReplyDetailsEventIDUnderlyingCallsCount += 1 } getLoadedReplyDetailsEventIDReceivedEventID = eventID getLoadedReplyDetailsEventIDReceivedInvocationsLock.withLock { getLoadedReplyDetailsEventIDUnderlyingReceivedInvocations.append(eventID) } @@ -13948,7 +13948,7 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { //MARK: - buildMessageContentFor private let buildMessageContentForHtmlIntentionalMentionsCallsCountLock = NSLock() - private var buildMessageContentForHtmlIntentionalMentionsUnderlyingCallsCount = 0 + private nonisolated(unsafe) var buildMessageContentForHtmlIntentionalMentionsUnderlyingCallsCount = 0 var buildMessageContentForHtmlIntentionalMentionsCallsCount: Int { get { buildMessageContentForHtmlIntentionalMentionsCallsCountLock.withLock { buildMessageContentForHtmlIntentionalMentionsUnderlyingCallsCount } } set { buildMessageContentForHtmlIntentionalMentionsCallsCountLock.withLock { buildMessageContentForHtmlIntentionalMentionsUnderlyingCallsCount = newValue } } @@ -13957,25 +13957,25 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { return buildMessageContentForHtmlIntentionalMentionsCallsCount > 0 } private let buildMessageContentForHtmlIntentionalMentionsReceivedArgumentsLock = NSLock() - private var buildMessageContentForHtmlIntentionalMentionsUnderlyingReceivedArguments: (message: String, html: String?, intentionalMentions: Mentions)? + private nonisolated(unsafe) var buildMessageContentForHtmlIntentionalMentionsUnderlyingReceivedArguments: (message: String, html: String?, intentionalMentions: Mentions)? var buildMessageContentForHtmlIntentionalMentionsReceivedArguments: (message: String, html: String?, intentionalMentions: Mentions)? { get { buildMessageContentForHtmlIntentionalMentionsReceivedArgumentsLock.withLock { buildMessageContentForHtmlIntentionalMentionsUnderlyingReceivedArguments } } set { buildMessageContentForHtmlIntentionalMentionsReceivedArgumentsLock.withLock { buildMessageContentForHtmlIntentionalMentionsUnderlyingReceivedArguments = newValue } } } private let buildMessageContentForHtmlIntentionalMentionsReceivedInvocationsLock = NSLock() - private var buildMessageContentForHtmlIntentionalMentionsUnderlyingReceivedInvocations: [(message: String, html: String?, intentionalMentions: Mentions)] = [] + private nonisolated(unsafe) var buildMessageContentForHtmlIntentionalMentionsUnderlyingReceivedInvocations: [(message: String, html: String?, intentionalMentions: Mentions)] = [] var buildMessageContentForHtmlIntentionalMentionsReceivedInvocations: [(message: String, html: String?, intentionalMentions: Mentions)] { get { buildMessageContentForHtmlIntentionalMentionsReceivedInvocationsLock.withLock { buildMessageContentForHtmlIntentionalMentionsUnderlyingReceivedInvocations } } set { buildMessageContentForHtmlIntentionalMentionsReceivedInvocationsLock.withLock { buildMessageContentForHtmlIntentionalMentionsUnderlyingReceivedInvocations = newValue } } } private let buildMessageContentForHtmlIntentionalMentionsReturnValueLock = NSLock() - private var buildMessageContentForHtmlIntentionalMentionsUnderlyingReturnValue: RoomMessageEventContentWithoutRelation! + private nonisolated(unsafe) var buildMessageContentForHtmlIntentionalMentionsUnderlyingReturnValue: RoomMessageEventContentWithoutRelation! var buildMessageContentForHtmlIntentionalMentionsReturnValue: RoomMessageEventContentWithoutRelation! { get { buildMessageContentForHtmlIntentionalMentionsReturnValueLock.withLock { buildMessageContentForHtmlIntentionalMentionsUnderlyingReturnValue } } set { buildMessageContentForHtmlIntentionalMentionsReturnValueLock.withLock { buildMessageContentForHtmlIntentionalMentionsUnderlyingReturnValue = newValue } } } - var buildMessageContentForHtmlIntentionalMentionsClosure: ((String, String?, Mentions) -> RoomMessageEventContentWithoutRelation)? + nonisolated(unsafe) var buildMessageContentForHtmlIntentionalMentionsClosure: ((String, String?, Mentions) -> RoomMessageEventContentWithoutRelation)? func buildMessageContentFor(_ message: String, html: String?, intentionalMentions: Mentions) -> RoomMessageEventContentWithoutRelation { buildMessageContentForHtmlIntentionalMentionsCallsCountLock.withLock { buildMessageContentForHtmlIntentionalMentionsUnderlyingCallsCount += 1 } @@ -13988,12 +13988,12 @@ class TimelineProxyMock: TimelineProxyProtocol, @unchecked Sendable { } } } -class UserDiscoveryServiceMock: UserDiscoveryServiceProtocol, @unchecked Sendable { +nonisolated class UserDiscoveryServiceMock: UserDiscoveryServiceProtocol, @unchecked Sendable { //MARK: - searchProfiles private let searchProfilesWithCallsCountLock = NSLock() - private var searchProfilesWithUnderlyingCallsCount = 0 + private nonisolated(unsafe) var searchProfilesWithUnderlyingCallsCount = 0 var searchProfilesWithCallsCount: Int { get { searchProfilesWithCallsCountLock.withLock { searchProfilesWithUnderlyingCallsCount } } set { searchProfilesWithCallsCountLock.withLock { searchProfilesWithUnderlyingCallsCount = newValue } } @@ -14002,27 +14002,27 @@ class UserDiscoveryServiceMock: UserDiscoveryServiceProtocol, @unchecked Sendabl return searchProfilesWithCallsCount > 0 } private let searchProfilesWithReceivedSearchQueryLock = NSLock() - private var searchProfilesWithUnderlyingReceivedSearchQuery: String? + private nonisolated(unsafe) var searchProfilesWithUnderlyingReceivedSearchQuery: String? var searchProfilesWithReceivedSearchQuery: String? { get { searchProfilesWithReceivedSearchQueryLock.withLock { searchProfilesWithUnderlyingReceivedSearchQuery } } set { searchProfilesWithReceivedSearchQueryLock.withLock { searchProfilesWithUnderlyingReceivedSearchQuery = newValue } } } private let searchProfilesWithReceivedInvocationsLock = NSLock() - private var searchProfilesWithUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var searchProfilesWithUnderlyingReceivedInvocations: [String] = [] var searchProfilesWithReceivedInvocations: [String] { get { searchProfilesWithReceivedInvocationsLock.withLock { searchProfilesWithUnderlyingReceivedInvocations } } set { searchProfilesWithReceivedInvocationsLock.withLock { searchProfilesWithUnderlyingReceivedInvocations = newValue } } } private let searchProfilesWithReturnValueLock = NSLock() - private var searchProfilesWithUnderlyingReturnValue: Result<[UserProfileProxy], UserDiscoveryErrorType>! + private nonisolated(unsafe) var searchProfilesWithUnderlyingReturnValue: Result<[UserProfileProxy], UserDiscoveryErrorType>! var searchProfilesWithReturnValue: Result<[UserProfileProxy], UserDiscoveryErrorType>! { get { searchProfilesWithReturnValueLock.withLock { searchProfilesWithUnderlyingReturnValue } } set { searchProfilesWithReturnValueLock.withLock { searchProfilesWithUnderlyingReturnValue = newValue } } } - var searchProfilesWithClosure: ((String) async -> Result<[UserProfileProxy], UserDiscoveryErrorType>)? + nonisolated(unsafe) var searchProfilesWithClosure: ((String) async -> Result<[UserProfileProxy], UserDiscoveryErrorType>)? - func searchProfiles(with searchQuery: String) async -> Result<[UserProfileProxy], UserDiscoveryErrorType> { + @concurrent func searchProfiles(with searchQuery: String) async -> Result<[UserProfileProxy], UserDiscoveryErrorType> { searchProfilesWithCallsCountLock.withLock { searchProfilesWithUnderlyingCallsCount += 1 } searchProfilesWithReceivedSearchQuery = searchQuery searchProfilesWithReceivedInvocationsLock.withLock { searchProfilesWithUnderlyingReceivedInvocations.append(searchQuery) } @@ -14033,21 +14033,21 @@ class UserDiscoveryServiceMock: UserDiscoveryServiceProtocol, @unchecked Sendabl } } } -class UserIdentityProxyMock: UserIdentityProxyProtocol, @unchecked Sendable { +nonisolated class UserIdentityProxyMock: UserIdentityProxyProtocol, @unchecked Sendable { var verificationState: UserIdentityVerificationState { get { return underlyingVerificationState } set(value) { underlyingVerificationState = value } } - var underlyingVerificationState: UserIdentityVerificationState! + nonisolated(unsafe) var underlyingVerificationState: UserIdentityVerificationState! } -class UserIndicatorControllerMock: UserIndicatorControllerProtocol, @unchecked Sendable { - var window: UIWindow? +nonisolated class UserIndicatorControllerMock: UserIndicatorControllerProtocol, @unchecked Sendable { + nonisolated(unsafe) var window: UIWindow? //MARK: - submitIndicator private let submitIndicatorDelayCallsCountLock = NSLock() - private var submitIndicatorDelayUnderlyingCallsCount = 0 + private nonisolated(unsafe) var submitIndicatorDelayUnderlyingCallsCount = 0 var submitIndicatorDelayCallsCount: Int { get { submitIndicatorDelayCallsCountLock.withLock { submitIndicatorDelayUnderlyingCallsCount } } set { submitIndicatorDelayCallsCountLock.withLock { submitIndicatorDelayUnderlyingCallsCount = newValue } } @@ -14056,18 +14056,18 @@ class UserIndicatorControllerMock: UserIndicatorControllerProtocol, @unchecked S return submitIndicatorDelayCallsCount > 0 } private let submitIndicatorDelayReceivedArgumentsLock = NSLock() - private var submitIndicatorDelayUnderlyingReceivedArguments: (indicator: UserIndicator, delay: Duration?)? + private nonisolated(unsafe) var submitIndicatorDelayUnderlyingReceivedArguments: (indicator: UserIndicator, delay: Duration?)? var submitIndicatorDelayReceivedArguments: (indicator: UserIndicator, delay: Duration?)? { get { submitIndicatorDelayReceivedArgumentsLock.withLock { submitIndicatorDelayUnderlyingReceivedArguments } } set { submitIndicatorDelayReceivedArgumentsLock.withLock { submitIndicatorDelayUnderlyingReceivedArguments = newValue } } } private let submitIndicatorDelayReceivedInvocationsLock = NSLock() - private var submitIndicatorDelayUnderlyingReceivedInvocations: [(indicator: UserIndicator, delay: Duration?)] = [] + private nonisolated(unsafe) var submitIndicatorDelayUnderlyingReceivedInvocations: [(indicator: UserIndicator, delay: Duration?)] = [] var submitIndicatorDelayReceivedInvocations: [(indicator: UserIndicator, delay: Duration?)] { get { submitIndicatorDelayReceivedInvocationsLock.withLock { submitIndicatorDelayUnderlyingReceivedInvocations } } set { submitIndicatorDelayReceivedInvocationsLock.withLock { submitIndicatorDelayUnderlyingReceivedInvocations = newValue } } } - var submitIndicatorDelayClosure: ((UserIndicator, Duration?) -> Void)? + nonisolated(unsafe) var submitIndicatorDelayClosure: ((UserIndicator, Duration?) -> Void)? func submitIndicator(_ indicator: UserIndicator, delay: Duration?) { submitIndicatorDelayCallsCountLock.withLock { submitIndicatorDelayUnderlyingCallsCount += 1 } @@ -14078,7 +14078,7 @@ class UserIndicatorControllerMock: UserIndicatorControllerProtocol, @unchecked S //MARK: - retractIndicatorWithId private let retractIndicatorWithIdCallsCountLock = NSLock() - private var retractIndicatorWithIdUnderlyingCallsCount = 0 + private nonisolated(unsafe) var retractIndicatorWithIdUnderlyingCallsCount = 0 var retractIndicatorWithIdCallsCount: Int { get { retractIndicatorWithIdCallsCountLock.withLock { retractIndicatorWithIdUnderlyingCallsCount } } set { retractIndicatorWithIdCallsCountLock.withLock { retractIndicatorWithIdUnderlyingCallsCount = newValue } } @@ -14087,18 +14087,18 @@ class UserIndicatorControllerMock: UserIndicatorControllerProtocol, @unchecked S return retractIndicatorWithIdCallsCount > 0 } private let retractIndicatorWithIdReceivedIdLock = NSLock() - private var retractIndicatorWithIdUnderlyingReceivedId: String? + private nonisolated(unsafe) var retractIndicatorWithIdUnderlyingReceivedId: String? var retractIndicatorWithIdReceivedId: String? { get { retractIndicatorWithIdReceivedIdLock.withLock { retractIndicatorWithIdUnderlyingReceivedId } } set { retractIndicatorWithIdReceivedIdLock.withLock { retractIndicatorWithIdUnderlyingReceivedId = newValue } } } private let retractIndicatorWithIdReceivedInvocationsLock = NSLock() - private var retractIndicatorWithIdUnderlyingReceivedInvocations: [String] = [] + private nonisolated(unsafe) var retractIndicatorWithIdUnderlyingReceivedInvocations: [String] = [] var retractIndicatorWithIdReceivedInvocations: [String] { get { retractIndicatorWithIdReceivedInvocationsLock.withLock { retractIndicatorWithIdUnderlyingReceivedInvocations } } set { retractIndicatorWithIdReceivedInvocationsLock.withLock { retractIndicatorWithIdUnderlyingReceivedInvocations = newValue } } } - var retractIndicatorWithIdClosure: ((String) -> Void)? + nonisolated(unsafe) var retractIndicatorWithIdClosure: ((String) -> Void)? func retractIndicatorWithId(_ id: String) { retractIndicatorWithIdCallsCountLock.withLock { retractIndicatorWithIdUnderlyingCallsCount += 1 } @@ -14109,7 +14109,7 @@ class UserIndicatorControllerMock: UserIndicatorControllerProtocol, @unchecked S //MARK: - retractAllIndicators private let retractAllIndicatorsCallsCountLock = NSLock() - private var retractAllIndicatorsUnderlyingCallsCount = 0 + private nonisolated(unsafe) var retractAllIndicatorsUnderlyingCallsCount = 0 var retractAllIndicatorsCallsCount: Int { get { retractAllIndicatorsCallsCountLock.withLock { retractAllIndicatorsUnderlyingCallsCount } } set { retractAllIndicatorsCallsCountLock.withLock { retractAllIndicatorsUnderlyingCallsCount = newValue } } @@ -14117,7 +14117,7 @@ class UserIndicatorControllerMock: UserIndicatorControllerProtocol, @unchecked S var retractAllIndicatorsCalled: Bool { return retractAllIndicatorsCallsCount > 0 } - var retractAllIndicatorsClosure: (() -> Void)? + nonisolated(unsafe) var retractAllIndicatorsClosure: (() -> Void)? func retractAllIndicators() { retractAllIndicatorsCallsCountLock.withLock { retractAllIndicatorsUnderlyingCallsCount += 1 } @@ -14126,7 +14126,7 @@ class UserIndicatorControllerMock: UserIndicatorControllerProtocol, @unchecked S //MARK: - start private let startCallsCountLock = NSLock() - private var startUnderlyingCallsCount = 0 + private nonisolated(unsafe) var startUnderlyingCallsCount = 0 var startCallsCount: Int { get { startCallsCountLock.withLock { startUnderlyingCallsCount } } set { startCallsCountLock.withLock { startUnderlyingCallsCount = newValue } } @@ -14134,7 +14134,7 @@ class UserIndicatorControllerMock: UserIndicatorControllerProtocol, @unchecked S var startCalled: Bool { return startCallsCount > 0 } - var startClosure: (() -> Void)? + nonisolated(unsafe) var startClosure: (() -> Void)? func start() { startCallsCountLock.withLock { startUnderlyingCallsCount += 1 } @@ -14143,7 +14143,7 @@ class UserIndicatorControllerMock: UserIndicatorControllerProtocol, @unchecked S //MARK: - stop private let stopCallsCountLock = NSLock() - private var stopUnderlyingCallsCount = 0 + private nonisolated(unsafe) var stopUnderlyingCallsCount = 0 var stopCallsCount: Int { get { stopCallsCountLock.withLock { stopUnderlyingCallsCount } } set { stopCallsCountLock.withLock { stopUnderlyingCallsCount = newValue } } @@ -14151,7 +14151,7 @@ class UserIndicatorControllerMock: UserIndicatorControllerProtocol, @unchecked S var stopCalled: Bool { return stopCallsCount > 0 } - var stopClosure: (() -> Void)? + nonisolated(unsafe) var stopClosure: (() -> Void)? func stop() { stopCallsCountLock.withLock { stopUnderlyingCallsCount += 1 } @@ -14160,7 +14160,7 @@ class UserIndicatorControllerMock: UserIndicatorControllerProtocol, @unchecked S //MARK: - toPresentable private let toPresentableCallsCountLock = NSLock() - private var toPresentableUnderlyingCallsCount = 0 + private nonisolated(unsafe) var toPresentableUnderlyingCallsCount = 0 var toPresentableCallsCount: Int { get { toPresentableCallsCountLock.withLock { toPresentableUnderlyingCallsCount } } set { toPresentableCallsCountLock.withLock { toPresentableUnderlyingCallsCount = newValue } } @@ -14170,12 +14170,12 @@ class UserIndicatorControllerMock: UserIndicatorControllerProtocol, @unchecked S } private let toPresentableReturnValueLock = NSLock() - private var toPresentableUnderlyingReturnValue: AnyView! + private nonisolated(unsafe) var toPresentableUnderlyingReturnValue: AnyView! var toPresentableReturnValue: AnyView! { get { toPresentableReturnValueLock.withLock { toPresentableUnderlyingReturnValue } } set { toPresentableReturnValueLock.withLock { toPresentableUnderlyingReturnValue = newValue } } } - var toPresentableClosure: (() -> AnyView)? + nonisolated(unsafe) var toPresentableClosure: (() -> AnyView)? func toPresentable() -> AnyView { toPresentableCallsCountLock.withLock { toPresentableUnderlyingCallsCount += 1 } @@ -14186,14 +14186,14 @@ class UserIndicatorControllerMock: UserIndicatorControllerProtocol, @unchecked S } } } -class UserNotificationCenterMock: UserNotificationCenterProtocol, @unchecked Sendable { - weak var delegate: UNUserNotificationCenterDelegate? +nonisolated class UserNotificationCenterMock: UserNotificationCenterProtocol, @unchecked Sendable { + weak nonisolated(unsafe) var delegate: UNUserNotificationCenterDelegate? //MARK: - add - var addThrowableError: Error? + nonisolated(unsafe) var addThrowableError: Error? private let addCallsCountLock = NSLock() - private var addUnderlyingCallsCount = 0 + private nonisolated(unsafe) var addUnderlyingCallsCount = 0 var addCallsCount: Int { get { addCallsCountLock.withLock { addUnderlyingCallsCount } } set { addCallsCountLock.withLock { addUnderlyingCallsCount = newValue } } @@ -14202,20 +14202,20 @@ class UserNotificationCenterMock: UserNotificationCenterProtocol, @unchecked Sen return addCallsCount > 0 } private let addReceivedRequestLock = NSLock() - private var addUnderlyingReceivedRequest: UNNotificationRequest? + private nonisolated(unsafe) var addUnderlyingReceivedRequest: UNNotificationRequest? var addReceivedRequest: UNNotificationRequest? { get { addReceivedRequestLock.withLock { addUnderlyingReceivedRequest } } set { addReceivedRequestLock.withLock { addUnderlyingReceivedRequest = newValue } } } private let addReceivedInvocationsLock = NSLock() - private var addUnderlyingReceivedInvocations: [UNNotificationRequest] = [] + private nonisolated(unsafe) var addUnderlyingReceivedInvocations: [UNNotificationRequest] = [] var addReceivedInvocations: [UNNotificationRequest] { get { addReceivedInvocationsLock.withLock { addUnderlyingReceivedInvocations } } set { addReceivedInvocationsLock.withLock { addUnderlyingReceivedInvocations = newValue } } } - var addClosure: ((UNNotificationRequest) async throws -> Void)? + nonisolated(unsafe) var addClosure: ((UNNotificationRequest) async throws -> Void)? - func add(_ request: UNNotificationRequest) async throws { + @concurrent func add(_ request: UNNotificationRequest) async throws { if let error = addThrowableError { throw error } @@ -14226,9 +14226,9 @@ class UserNotificationCenterMock: UserNotificationCenterProtocol, @unchecked Sen } //MARK: - requestAuthorization - var requestAuthorizationOptionsThrowableError: Error? + nonisolated(unsafe) var requestAuthorizationOptionsThrowableError: Error? private let requestAuthorizationOptionsCallsCountLock = NSLock() - private var requestAuthorizationOptionsUnderlyingCallsCount = 0 + private nonisolated(unsafe) var requestAuthorizationOptionsUnderlyingCallsCount = 0 var requestAuthorizationOptionsCallsCount: Int { get { requestAuthorizationOptionsCallsCountLock.withLock { requestAuthorizationOptionsUnderlyingCallsCount } } set { requestAuthorizationOptionsCallsCountLock.withLock { requestAuthorizationOptionsUnderlyingCallsCount = newValue } } @@ -14237,27 +14237,27 @@ class UserNotificationCenterMock: UserNotificationCenterProtocol, @unchecked Sen return requestAuthorizationOptionsCallsCount > 0 } private let requestAuthorizationOptionsReceivedOptionsLock = NSLock() - private var requestAuthorizationOptionsUnderlyingReceivedOptions: UNAuthorizationOptions? + private nonisolated(unsafe) var requestAuthorizationOptionsUnderlyingReceivedOptions: UNAuthorizationOptions? var requestAuthorizationOptionsReceivedOptions: UNAuthorizationOptions? { get { requestAuthorizationOptionsReceivedOptionsLock.withLock { requestAuthorizationOptionsUnderlyingReceivedOptions } } set { requestAuthorizationOptionsReceivedOptionsLock.withLock { requestAuthorizationOptionsUnderlyingReceivedOptions = newValue } } } private let requestAuthorizationOptionsReceivedInvocationsLock = NSLock() - private var requestAuthorizationOptionsUnderlyingReceivedInvocations: [UNAuthorizationOptions] = [] + private nonisolated(unsafe) var requestAuthorizationOptionsUnderlyingReceivedInvocations: [UNAuthorizationOptions] = [] var requestAuthorizationOptionsReceivedInvocations: [UNAuthorizationOptions] { get { requestAuthorizationOptionsReceivedInvocationsLock.withLock { requestAuthorizationOptionsUnderlyingReceivedInvocations } } set { requestAuthorizationOptionsReceivedInvocationsLock.withLock { requestAuthorizationOptionsUnderlyingReceivedInvocations = newValue } } } private let requestAuthorizationOptionsReturnValueLock = NSLock() - private var requestAuthorizationOptionsUnderlyingReturnValue: Bool! + private nonisolated(unsafe) var requestAuthorizationOptionsUnderlyingReturnValue: Bool! var requestAuthorizationOptionsReturnValue: Bool! { get { requestAuthorizationOptionsReturnValueLock.withLock { requestAuthorizationOptionsUnderlyingReturnValue } } set { requestAuthorizationOptionsReturnValueLock.withLock { requestAuthorizationOptionsUnderlyingReturnValue = newValue } } } - var requestAuthorizationOptionsClosure: ((UNAuthorizationOptions) async throws -> Bool)? + nonisolated(unsafe) var requestAuthorizationOptionsClosure: ((UNAuthorizationOptions) async throws -> Bool)? - func requestAuthorization(options: UNAuthorizationOptions) async throws -> Bool { + @concurrent func requestAuthorization(options: UNAuthorizationOptions) async throws -> Bool { if let error = requestAuthorizationOptionsThrowableError { throw error } @@ -14273,7 +14273,7 @@ class UserNotificationCenterMock: UserNotificationCenterProtocol, @unchecked Sen //MARK: - deliveredNotifications private let deliveredNotificationsCallsCountLock = NSLock() - private var deliveredNotificationsUnderlyingCallsCount = 0 + private nonisolated(unsafe) var deliveredNotificationsUnderlyingCallsCount = 0 var deliveredNotificationsCallsCount: Int { get { deliveredNotificationsCallsCountLock.withLock { deliveredNotificationsUnderlyingCallsCount } } set { deliveredNotificationsCallsCountLock.withLock { deliveredNotificationsUnderlyingCallsCount = newValue } } @@ -14283,14 +14283,14 @@ class UserNotificationCenterMock: UserNotificationCenterProtocol, @unchecked Sen } private let deliveredNotificationsReturnValueLock = NSLock() - private var deliveredNotificationsUnderlyingReturnValue: [UNNotification]! + private nonisolated(unsafe) var deliveredNotificationsUnderlyingReturnValue: [UNNotification]! var deliveredNotificationsReturnValue: [UNNotification]! { get { deliveredNotificationsReturnValueLock.withLock { deliveredNotificationsUnderlyingReturnValue } } set { deliveredNotificationsReturnValueLock.withLock { deliveredNotificationsUnderlyingReturnValue = newValue } } } - var deliveredNotificationsClosure: (() async -> [UNNotification])? + nonisolated(unsafe) var deliveredNotificationsClosure: (() async -> [UNNotification])? - func deliveredNotifications() async -> [UNNotification] { + @concurrent func deliveredNotifications() async -> [UNNotification] { deliveredNotificationsCallsCountLock.withLock { deliveredNotificationsUnderlyingCallsCount += 1 } if let deliveredNotificationsClosure = deliveredNotificationsClosure { return await deliveredNotificationsClosure() @@ -14301,7 +14301,7 @@ class UserNotificationCenterMock: UserNotificationCenterProtocol, @unchecked Sen //MARK: - removeDeliveredNotifications private let removeDeliveredNotificationsWithIdentifiersCallsCountLock = NSLock() - private var removeDeliveredNotificationsWithIdentifiersUnderlyingCallsCount = 0 + private nonisolated(unsafe) var removeDeliveredNotificationsWithIdentifiersUnderlyingCallsCount = 0 var removeDeliveredNotificationsWithIdentifiersCallsCount: Int { get { removeDeliveredNotificationsWithIdentifiersCallsCountLock.withLock { removeDeliveredNotificationsWithIdentifiersUnderlyingCallsCount } } set { removeDeliveredNotificationsWithIdentifiersCallsCountLock.withLock { removeDeliveredNotificationsWithIdentifiersUnderlyingCallsCount = newValue } } @@ -14310,18 +14310,18 @@ class UserNotificationCenterMock: UserNotificationCenterProtocol, @unchecked Sen return removeDeliveredNotificationsWithIdentifiersCallsCount > 0 } private let removeDeliveredNotificationsWithIdentifiersReceivedIdentifiersLock = NSLock() - private var removeDeliveredNotificationsWithIdentifiersUnderlyingReceivedIdentifiers: [String]? + private nonisolated(unsafe) var removeDeliveredNotificationsWithIdentifiersUnderlyingReceivedIdentifiers: [String]? var removeDeliveredNotificationsWithIdentifiersReceivedIdentifiers: [String]? { get { removeDeliveredNotificationsWithIdentifiersReceivedIdentifiersLock.withLock { removeDeliveredNotificationsWithIdentifiersUnderlyingReceivedIdentifiers } } set { removeDeliveredNotificationsWithIdentifiersReceivedIdentifiersLock.withLock { removeDeliveredNotificationsWithIdentifiersUnderlyingReceivedIdentifiers = newValue } } } private let removeDeliveredNotificationsWithIdentifiersReceivedInvocationsLock = NSLock() - private var removeDeliveredNotificationsWithIdentifiersUnderlyingReceivedInvocations: [[String]] = [] + private nonisolated(unsafe) var removeDeliveredNotificationsWithIdentifiersUnderlyingReceivedInvocations: [[String]] = [] var removeDeliveredNotificationsWithIdentifiersReceivedInvocations: [[String]] { get { removeDeliveredNotificationsWithIdentifiersReceivedInvocationsLock.withLock { removeDeliveredNotificationsWithIdentifiersUnderlyingReceivedInvocations } } set { removeDeliveredNotificationsWithIdentifiersReceivedInvocationsLock.withLock { removeDeliveredNotificationsWithIdentifiersUnderlyingReceivedInvocations = newValue } } } - var removeDeliveredNotificationsWithIdentifiersClosure: (([String]) -> Void)? + nonisolated(unsafe) var removeDeliveredNotificationsWithIdentifiersClosure: (([String]) -> Void)? func removeDeliveredNotifications(withIdentifiers identifiers: [String]) { removeDeliveredNotificationsWithIdentifiersCallsCountLock.withLock { removeDeliveredNotificationsWithIdentifiersUnderlyingCallsCount += 1 } @@ -14332,7 +14332,7 @@ class UserNotificationCenterMock: UserNotificationCenterProtocol, @unchecked Sen //MARK: - setNotificationCategories private let setNotificationCategoriesCallsCountLock = NSLock() - private var setNotificationCategoriesUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setNotificationCategoriesUnderlyingCallsCount = 0 var setNotificationCategoriesCallsCount: Int { get { setNotificationCategoriesCallsCountLock.withLock { setNotificationCategoriesUnderlyingCallsCount } } set { setNotificationCategoriesCallsCountLock.withLock { setNotificationCategoriesUnderlyingCallsCount = newValue } } @@ -14341,18 +14341,18 @@ class UserNotificationCenterMock: UserNotificationCenterProtocol, @unchecked Sen return setNotificationCategoriesCallsCount > 0 } private let setNotificationCategoriesReceivedCategoriesLock = NSLock() - private var setNotificationCategoriesUnderlyingReceivedCategories: Set? + private nonisolated(unsafe) var setNotificationCategoriesUnderlyingReceivedCategories: Set? var setNotificationCategoriesReceivedCategories: Set? { get { setNotificationCategoriesReceivedCategoriesLock.withLock { setNotificationCategoriesUnderlyingReceivedCategories } } set { setNotificationCategoriesReceivedCategoriesLock.withLock { setNotificationCategoriesUnderlyingReceivedCategories = newValue } } } private let setNotificationCategoriesReceivedInvocationsLock = NSLock() - private var setNotificationCategoriesUnderlyingReceivedInvocations: [Set] = [] + private nonisolated(unsafe) var setNotificationCategoriesUnderlyingReceivedInvocations: [Set] = [] var setNotificationCategoriesReceivedInvocations: [Set] { get { setNotificationCategoriesReceivedInvocationsLock.withLock { setNotificationCategoriesUnderlyingReceivedInvocations } } set { setNotificationCategoriesReceivedInvocationsLock.withLock { setNotificationCategoriesUnderlyingReceivedInvocations = newValue } } } - var setNotificationCategoriesClosure: ((Set) -> Void)? + nonisolated(unsafe) var setNotificationCategoriesClosure: ((Set) -> Void)? func setNotificationCategories(_ categories: Set) { setNotificationCategoriesCallsCountLock.withLock { setNotificationCategoriesUnderlyingCallsCount += 1 } @@ -14363,7 +14363,7 @@ class UserNotificationCenterMock: UserNotificationCenterProtocol, @unchecked Sen //MARK: - authorizationStatus private let authorizationStatusCallsCountLock = NSLock() - private var authorizationStatusUnderlyingCallsCount = 0 + private nonisolated(unsafe) var authorizationStatusUnderlyingCallsCount = 0 var authorizationStatusCallsCount: Int { get { authorizationStatusCallsCountLock.withLock { authorizationStatusUnderlyingCallsCount } } set { authorizationStatusCallsCountLock.withLock { authorizationStatusUnderlyingCallsCount = newValue } } @@ -14373,14 +14373,14 @@ class UserNotificationCenterMock: UserNotificationCenterProtocol, @unchecked Sen } private let authorizationStatusReturnValueLock = NSLock() - private var authorizationStatusUnderlyingReturnValue: UNAuthorizationStatus! + private nonisolated(unsafe) var authorizationStatusUnderlyingReturnValue: UNAuthorizationStatus! var authorizationStatusReturnValue: UNAuthorizationStatus! { get { authorizationStatusReturnValueLock.withLock { authorizationStatusUnderlyingReturnValue } } set { authorizationStatusReturnValueLock.withLock { authorizationStatusUnderlyingReturnValue = newValue } } } - var authorizationStatusClosure: (() async -> UNAuthorizationStatus)? + nonisolated(unsafe) var authorizationStatusClosure: (() async -> UNAuthorizationStatus)? - func authorizationStatus() async -> UNAuthorizationStatus { + @concurrent func authorizationStatus() async -> UNAuthorizationStatus { authorizationStatusCallsCountLock.withLock { authorizationStatusUnderlyingCallsCount += 1 } if let authorizationStatusClosure = authorizationStatusClosure { return await authorizationStatusClosure() @@ -14391,7 +14391,7 @@ class UserNotificationCenterMock: UserNotificationCenterProtocol, @unchecked Sen //MARK: - notificationSettings private let notificationSettingsCallsCountLock = NSLock() - private var notificationSettingsUnderlyingCallsCount = 0 + private nonisolated(unsafe) var notificationSettingsUnderlyingCallsCount = 0 var notificationSettingsCallsCount: Int { get { notificationSettingsCallsCountLock.withLock { notificationSettingsUnderlyingCallsCount } } set { notificationSettingsCallsCountLock.withLock { notificationSettingsUnderlyingCallsCount = newValue } } @@ -14401,14 +14401,14 @@ class UserNotificationCenterMock: UserNotificationCenterProtocol, @unchecked Sen } private let notificationSettingsReturnValueLock = NSLock() - private var notificationSettingsUnderlyingReturnValue: UNNotificationSettings! + private nonisolated(unsafe) var notificationSettingsUnderlyingReturnValue: UNNotificationSettings! var notificationSettingsReturnValue: UNNotificationSettings! { get { notificationSettingsReturnValueLock.withLock { notificationSettingsUnderlyingReturnValue } } set { notificationSettingsReturnValueLock.withLock { notificationSettingsUnderlyingReturnValue = newValue } } } - var notificationSettingsClosure: (() async -> UNNotificationSettings)? + nonisolated(unsafe) var notificationSettingsClosure: (() async -> UNNotificationSettings)? - func notificationSettings() async -> UNNotificationSettings { + @concurrent func notificationSettings() async -> UNNotificationSettings { notificationSettingsCallsCountLock.withLock { notificationSettingsUnderlyingCallsCount += 1 } if let notificationSettingsClosure = notificationSettingsClosure { return await notificationSettingsClosure() @@ -14417,56 +14417,56 @@ class UserNotificationCenterMock: UserNotificationCenterProtocol, @unchecked Sen } } } -class UserSessionMock: UserSessionProtocol, @unchecked Sendable { +nonisolated class UserSessionMock: UserSessionProtocol, @unchecked Sendable { var clientProxy: ClientProxyProtocol { get { return underlyingClientProxy } set(value) { underlyingClientProxy = value } } - var underlyingClientProxy: ClientProxyProtocol! + nonisolated(unsafe) var underlyingClientProxy: ClientProxyProtocol! var mediaProvider: MediaProviderProtocol { get { return underlyingMediaProvider } set(value) { underlyingMediaProvider = value } } - var underlyingMediaProvider: MediaProviderProtocol! + nonisolated(unsafe) var underlyingMediaProvider: MediaProviderProtocol! var voiceMessageMediaManager: VoiceMessageMediaManagerProtocol { get { return underlyingVoiceMessageMediaManager } set(value) { underlyingVoiceMessageMediaManager = value } } - var underlyingVoiceMessageMediaManager: VoiceMessageMediaManagerProtocol! + nonisolated(unsafe) var underlyingVoiceMessageMediaManager: VoiceMessageMediaManagerProtocol! var liveLocationManager: LiveLocationManagerProtocol { get { return underlyingLiveLocationManager } set(value) { underlyingLiveLocationManager = value } } - var underlyingLiveLocationManager: LiveLocationManagerProtocol! + nonisolated(unsafe) var underlyingLiveLocationManager: LiveLocationManagerProtocol! var sessionSecurityStatePublisher: CurrentValuePublisher { get { return underlyingSessionSecurityStatePublisher } set(value) { underlyingSessionSecurityStatePublisher = value } } - var underlyingSessionSecurityStatePublisher: CurrentValuePublisher! + nonisolated(unsafe) var underlyingSessionSecurityStatePublisher: CurrentValuePublisher! var callbacks: PassthroughSubject { get { return underlyingCallbacks } set(value) { underlyingCallbacks = value } } - var underlyingCallbacks: PassthroughSubject! + nonisolated(unsafe) var underlyingCallbacks: PassthroughSubject! } -class UserSessionStoreMock: UserSessionStoreProtocol, @unchecked Sendable { +nonisolated class UserSessionStoreMock: UserSessionStoreProtocol, @unchecked Sendable { var hasSessions: Bool { get { return underlyingHasSessions } set(value) { underlyingHasSessions = value } } - var underlyingHasSessions: Bool! - var userIDs: [String] = [] + nonisolated(unsafe) var underlyingHasSessions: Bool! + nonisolated(unsafe) var userIDs: [String] = [] var clientSessionDelegate: ClientSessionDelegate { get { return underlyingClientSessionDelegate } set(value) { underlyingClientSessionDelegate = value } } - var underlyingClientSessionDelegate: ClientSessionDelegate! + nonisolated(unsafe) var underlyingClientSessionDelegate: ClientSessionDelegate! //MARK: - reset private let resetCallsCountLock = NSLock() - private var resetUnderlyingCallsCount = 0 + private nonisolated(unsafe) var resetUnderlyingCallsCount = 0 var resetCallsCount: Int { get { resetCallsCountLock.withLock { resetUnderlyingCallsCount } } set { resetCallsCountLock.withLock { resetUnderlyingCallsCount = newValue } } @@ -14474,7 +14474,7 @@ class UserSessionStoreMock: UserSessionStoreProtocol, @unchecked Sendable { var resetCalled: Bool { return resetCallsCount > 0 } - var resetClosure: (() -> Void)? + nonisolated(unsafe) var resetClosure: (() -> Void)? func reset() { resetCallsCountLock.withLock { resetUnderlyingCallsCount += 1 } @@ -14483,7 +14483,7 @@ class UserSessionStoreMock: UserSessionStoreProtocol, @unchecked Sendable { //MARK: - restoreUserSession private let restoreUserSessionCallsCountLock = NSLock() - private var restoreUserSessionUnderlyingCallsCount = 0 + private nonisolated(unsafe) var restoreUserSessionUnderlyingCallsCount = 0 var restoreUserSessionCallsCount: Int { get { restoreUserSessionCallsCountLock.withLock { restoreUserSessionUnderlyingCallsCount } } set { restoreUserSessionCallsCountLock.withLock { restoreUserSessionUnderlyingCallsCount = newValue } } @@ -14493,14 +14493,14 @@ class UserSessionStoreMock: UserSessionStoreProtocol, @unchecked Sendable { } private let restoreUserSessionReturnValueLock = NSLock() - private var restoreUserSessionUnderlyingReturnValue: Result! + private nonisolated(unsafe) var restoreUserSessionUnderlyingReturnValue: Result! var restoreUserSessionReturnValue: Result! { get { restoreUserSessionReturnValueLock.withLock { restoreUserSessionUnderlyingReturnValue } } set { restoreUserSessionReturnValueLock.withLock { restoreUserSessionUnderlyingReturnValue = newValue } } } - var restoreUserSessionClosure: (() async -> Result)? + nonisolated(unsafe) var restoreUserSessionClosure: (() async -> Result)? - func restoreUserSession() async -> Result { + @concurrent func restoreUserSession() async -> Result { restoreUserSessionCallsCountLock.withLock { restoreUserSessionUnderlyingCallsCount += 1 } if let restoreUserSessionClosure = restoreUserSessionClosure { return await restoreUserSessionClosure() @@ -14511,7 +14511,7 @@ class UserSessionStoreMock: UserSessionStoreProtocol, @unchecked Sendable { //MARK: - userSession private let userSessionForSessionDirectoriesPassphraseCallsCountLock = NSLock() - private var userSessionForSessionDirectoriesPassphraseUnderlyingCallsCount = 0 + private nonisolated(unsafe) var userSessionForSessionDirectoriesPassphraseUnderlyingCallsCount = 0 var userSessionForSessionDirectoriesPassphraseCallsCount: Int { get { userSessionForSessionDirectoriesPassphraseCallsCountLock.withLock { userSessionForSessionDirectoriesPassphraseUnderlyingCallsCount } } set { userSessionForSessionDirectoriesPassphraseCallsCountLock.withLock { userSessionForSessionDirectoriesPassphraseUnderlyingCallsCount = newValue } } @@ -14520,27 +14520,27 @@ class UserSessionStoreMock: UserSessionStoreProtocol, @unchecked Sendable { return userSessionForSessionDirectoriesPassphraseCallsCount > 0 } private let userSessionForSessionDirectoriesPassphraseReceivedArgumentsLock = NSLock() - private var userSessionForSessionDirectoriesPassphraseUnderlyingReceivedArguments: (client: ClientProtocol, sessionDirectories: SessionDirectories, passphrase: String)? + private nonisolated(unsafe) var userSessionForSessionDirectoriesPassphraseUnderlyingReceivedArguments: (client: ClientProtocol, sessionDirectories: SessionDirectories, passphrase: String)? var userSessionForSessionDirectoriesPassphraseReceivedArguments: (client: ClientProtocol, sessionDirectories: SessionDirectories, passphrase: String)? { get { userSessionForSessionDirectoriesPassphraseReceivedArgumentsLock.withLock { userSessionForSessionDirectoriesPassphraseUnderlyingReceivedArguments } } set { userSessionForSessionDirectoriesPassphraseReceivedArgumentsLock.withLock { userSessionForSessionDirectoriesPassphraseUnderlyingReceivedArguments = newValue } } } private let userSessionForSessionDirectoriesPassphraseReceivedInvocationsLock = NSLock() - private var userSessionForSessionDirectoriesPassphraseUnderlyingReceivedInvocations: [(client: ClientProtocol, sessionDirectories: SessionDirectories, passphrase: String)] = [] + private nonisolated(unsafe) var userSessionForSessionDirectoriesPassphraseUnderlyingReceivedInvocations: [(client: ClientProtocol, sessionDirectories: SessionDirectories, passphrase: String)] = [] var userSessionForSessionDirectoriesPassphraseReceivedInvocations: [(client: ClientProtocol, sessionDirectories: SessionDirectories, passphrase: String)] { get { userSessionForSessionDirectoriesPassphraseReceivedInvocationsLock.withLock { userSessionForSessionDirectoriesPassphraseUnderlyingReceivedInvocations } } set { userSessionForSessionDirectoriesPassphraseReceivedInvocationsLock.withLock { userSessionForSessionDirectoriesPassphraseUnderlyingReceivedInvocations = newValue } } } private let userSessionForSessionDirectoriesPassphraseReturnValueLock = NSLock() - private var userSessionForSessionDirectoriesPassphraseUnderlyingReturnValue: Result! + private nonisolated(unsafe) var userSessionForSessionDirectoriesPassphraseUnderlyingReturnValue: Result! var userSessionForSessionDirectoriesPassphraseReturnValue: Result! { get { userSessionForSessionDirectoriesPassphraseReturnValueLock.withLock { userSessionForSessionDirectoriesPassphraseUnderlyingReturnValue } } set { userSessionForSessionDirectoriesPassphraseReturnValueLock.withLock { userSessionForSessionDirectoriesPassphraseUnderlyingReturnValue = newValue } } } - var userSessionForSessionDirectoriesPassphraseClosure: ((ClientProtocol, SessionDirectories, String) async -> Result)? + nonisolated(unsafe) var userSessionForSessionDirectoriesPassphraseClosure: ((ClientProtocol, SessionDirectories, String) async -> Result)? - func userSession(for client: ClientProtocol, sessionDirectories: SessionDirectories, passphrase: String) async -> Result { + @concurrent func userSession(for client: ClientProtocol, sessionDirectories: SessionDirectories, passphrase: String) async -> Result { userSessionForSessionDirectoriesPassphraseCallsCountLock.withLock { userSessionForSessionDirectoriesPassphraseUnderlyingCallsCount += 1 } userSessionForSessionDirectoriesPassphraseReceivedArguments = (client: client, sessionDirectories: sessionDirectories, passphrase: passphrase) userSessionForSessionDirectoriesPassphraseReceivedInvocationsLock.withLock { userSessionForSessionDirectoriesPassphraseUnderlyingReceivedInvocations.append((client: client, sessionDirectories: sessionDirectories, passphrase: passphrase)) } @@ -14553,7 +14553,7 @@ class UserSessionStoreMock: UserSessionStoreProtocol, @unchecked Sendable { //MARK: - logout private let logoutUserSessionCallsCountLock = NSLock() - private var logoutUserSessionUnderlyingCallsCount = 0 + private nonisolated(unsafe) var logoutUserSessionUnderlyingCallsCount = 0 var logoutUserSessionCallsCount: Int { get { logoutUserSessionCallsCountLock.withLock { logoutUserSessionUnderlyingCallsCount } } set { logoutUserSessionCallsCountLock.withLock { logoutUserSessionUnderlyingCallsCount = newValue } } @@ -14562,18 +14562,18 @@ class UserSessionStoreMock: UserSessionStoreProtocol, @unchecked Sendable { return logoutUserSessionCallsCount > 0 } private let logoutUserSessionReceivedUserSessionLock = NSLock() - private var logoutUserSessionUnderlyingReceivedUserSession: UserSessionProtocol? + private nonisolated(unsafe) var logoutUserSessionUnderlyingReceivedUserSession: UserSessionProtocol? var logoutUserSessionReceivedUserSession: UserSessionProtocol? { get { logoutUserSessionReceivedUserSessionLock.withLock { logoutUserSessionUnderlyingReceivedUserSession } } set { logoutUserSessionReceivedUserSessionLock.withLock { logoutUserSessionUnderlyingReceivedUserSession = newValue } } } private let logoutUserSessionReceivedInvocationsLock = NSLock() - private var logoutUserSessionUnderlyingReceivedInvocations: [UserSessionProtocol] = [] + private nonisolated(unsafe) var logoutUserSessionUnderlyingReceivedInvocations: [UserSessionProtocol] = [] var logoutUserSessionReceivedInvocations: [UserSessionProtocol] { get { logoutUserSessionReceivedInvocationsLock.withLock { logoutUserSessionUnderlyingReceivedInvocations } } set { logoutUserSessionReceivedInvocationsLock.withLock { logoutUserSessionUnderlyingReceivedInvocations = newValue } } } - var logoutUserSessionClosure: ((UserSessionProtocol) -> Void)? + nonisolated(unsafe) var logoutUserSessionClosure: ((UserSessionProtocol) -> Void)? func logout(userSession: UserSessionProtocol) { logoutUserSessionCallsCountLock.withLock { logoutUserSessionUnderlyingCallsCount += 1 } @@ -14582,17 +14582,17 @@ class UserSessionStoreMock: UserSessionStoreProtocol, @unchecked Sendable { logoutUserSessionClosure?(userSession) } } -class VoiceMessageCacheMock: VoiceMessageCacheProtocol, @unchecked Sendable { +nonisolated class VoiceMessageCacheMock: VoiceMessageCacheProtocol, @unchecked Sendable { var urlForRecording: URL { get { return underlyingUrlForRecording } set(value) { underlyingUrlForRecording = value } } - var underlyingUrlForRecording: URL! + nonisolated(unsafe) var underlyingUrlForRecording: URL! //MARK: - fileURL private let fileURLForCallsCountLock = NSLock() - private var fileURLForUnderlyingCallsCount = 0 + private nonisolated(unsafe) var fileURLForUnderlyingCallsCount = 0 var fileURLForCallsCount: Int { get { fileURLForCallsCountLock.withLock { fileURLForUnderlyingCallsCount } } set { fileURLForCallsCountLock.withLock { fileURLForUnderlyingCallsCount = newValue } } @@ -14601,25 +14601,25 @@ class VoiceMessageCacheMock: VoiceMessageCacheProtocol, @unchecked Sendable { return fileURLForCallsCount > 0 } private let fileURLForReceivedMediaSourceLock = NSLock() - private var fileURLForUnderlyingReceivedMediaSource: MediaSourceProxy? + private nonisolated(unsafe) var fileURLForUnderlyingReceivedMediaSource: MediaSourceProxy? var fileURLForReceivedMediaSource: MediaSourceProxy? { get { fileURLForReceivedMediaSourceLock.withLock { fileURLForUnderlyingReceivedMediaSource } } set { fileURLForReceivedMediaSourceLock.withLock { fileURLForUnderlyingReceivedMediaSource = newValue } } } private let fileURLForReceivedInvocationsLock = NSLock() - private var fileURLForUnderlyingReceivedInvocations: [MediaSourceProxy] = [] + private nonisolated(unsafe) var fileURLForUnderlyingReceivedInvocations: [MediaSourceProxy] = [] var fileURLForReceivedInvocations: [MediaSourceProxy] { get { fileURLForReceivedInvocationsLock.withLock { fileURLForUnderlyingReceivedInvocations } } set { fileURLForReceivedInvocationsLock.withLock { fileURLForUnderlyingReceivedInvocations = newValue } } } private let fileURLForReturnValueLock = NSLock() - private var fileURLForUnderlyingReturnValue: URL? + private nonisolated(unsafe) var fileURLForUnderlyingReturnValue: URL? var fileURLForReturnValue: URL? { get { fileURLForReturnValueLock.withLock { fileURLForUnderlyingReturnValue } } set { fileURLForReturnValueLock.withLock { fileURLForUnderlyingReturnValue = newValue } } } - var fileURLForClosure: ((MediaSourceProxy) -> URL?)? + nonisolated(unsafe) var fileURLForClosure: ((MediaSourceProxy) -> URL?)? func fileURL(for mediaSource: MediaSourceProxy) -> URL? { fileURLForCallsCountLock.withLock { fileURLForUnderlyingCallsCount += 1 } @@ -14634,7 +14634,7 @@ class VoiceMessageCacheMock: VoiceMessageCacheProtocol, @unchecked Sendable { //MARK: - cache private let cacheMediaSourceUsingMoveCallsCountLock = NSLock() - private var cacheMediaSourceUsingMoveUnderlyingCallsCount = 0 + private nonisolated(unsafe) var cacheMediaSourceUsingMoveUnderlyingCallsCount = 0 var cacheMediaSourceUsingMoveCallsCount: Int { get { cacheMediaSourceUsingMoveCallsCountLock.withLock { cacheMediaSourceUsingMoveUnderlyingCallsCount } } set { cacheMediaSourceUsingMoveCallsCountLock.withLock { cacheMediaSourceUsingMoveUnderlyingCallsCount = newValue } } @@ -14643,25 +14643,25 @@ class VoiceMessageCacheMock: VoiceMessageCacheProtocol, @unchecked Sendable { return cacheMediaSourceUsingMoveCallsCount > 0 } private let cacheMediaSourceUsingMoveReceivedArgumentsLock = NSLock() - private var cacheMediaSourceUsingMoveUnderlyingReceivedArguments: (mediaSource: MediaSourceProxy, fileURL: URL, move: Bool)? + private nonisolated(unsafe) var cacheMediaSourceUsingMoveUnderlyingReceivedArguments: (mediaSource: MediaSourceProxy, fileURL: URL, move: Bool)? var cacheMediaSourceUsingMoveReceivedArguments: (mediaSource: MediaSourceProxy, fileURL: URL, move: Bool)? { get { cacheMediaSourceUsingMoveReceivedArgumentsLock.withLock { cacheMediaSourceUsingMoveUnderlyingReceivedArguments } } set { cacheMediaSourceUsingMoveReceivedArgumentsLock.withLock { cacheMediaSourceUsingMoveUnderlyingReceivedArguments = newValue } } } private let cacheMediaSourceUsingMoveReceivedInvocationsLock = NSLock() - private var cacheMediaSourceUsingMoveUnderlyingReceivedInvocations: [(mediaSource: MediaSourceProxy, fileURL: URL, move: Bool)] = [] + private nonisolated(unsafe) var cacheMediaSourceUsingMoveUnderlyingReceivedInvocations: [(mediaSource: MediaSourceProxy, fileURL: URL, move: Bool)] = [] var cacheMediaSourceUsingMoveReceivedInvocations: [(mediaSource: MediaSourceProxy, fileURL: URL, move: Bool)] { get { cacheMediaSourceUsingMoveReceivedInvocationsLock.withLock { cacheMediaSourceUsingMoveUnderlyingReceivedInvocations } } set { cacheMediaSourceUsingMoveReceivedInvocationsLock.withLock { cacheMediaSourceUsingMoveUnderlyingReceivedInvocations = newValue } } } private let cacheMediaSourceUsingMoveReturnValueLock = NSLock() - private var cacheMediaSourceUsingMoveUnderlyingReturnValue: Result! + private nonisolated(unsafe) var cacheMediaSourceUsingMoveUnderlyingReturnValue: Result! var cacheMediaSourceUsingMoveReturnValue: Result! { get { cacheMediaSourceUsingMoveReturnValueLock.withLock { cacheMediaSourceUsingMoveUnderlyingReturnValue } } set { cacheMediaSourceUsingMoveReturnValueLock.withLock { cacheMediaSourceUsingMoveUnderlyingReturnValue = newValue } } } - var cacheMediaSourceUsingMoveClosure: ((MediaSourceProxy, URL, Bool) -> Result)? + nonisolated(unsafe) var cacheMediaSourceUsingMoveClosure: ((MediaSourceProxy, URL, Bool) -> Result)? func cache(mediaSource: MediaSourceProxy, using fileURL: URL, move: Bool) -> Result { cacheMediaSourceUsingMoveCallsCountLock.withLock { cacheMediaSourceUsingMoveUnderlyingCallsCount += 1 } @@ -14676,7 +14676,7 @@ class VoiceMessageCacheMock: VoiceMessageCacheProtocol, @unchecked Sendable { //MARK: - clearCache private let clearCacheCallsCountLock = NSLock() - private var clearCacheUnderlyingCallsCount = 0 + private nonisolated(unsafe) var clearCacheUnderlyingCallsCount = 0 var clearCacheCallsCount: Int { get { clearCacheCallsCountLock.withLock { clearCacheUnderlyingCallsCount } } set { clearCacheCallsCountLock.withLock { clearCacheUnderlyingCallsCount = newValue } } @@ -14684,20 +14684,20 @@ class VoiceMessageCacheMock: VoiceMessageCacheProtocol, @unchecked Sendable { var clearCacheCalled: Bool { return clearCacheCallsCount > 0 } - var clearCacheClosure: (() -> Void)? + nonisolated(unsafe) var clearCacheClosure: (() -> Void)? func clearCache() { clearCacheCallsCountLock.withLock { clearCacheUnderlyingCallsCount += 1 } clearCacheClosure?() } } -class VoiceMessageMediaManagerMock: VoiceMessageMediaManagerProtocol, @unchecked Sendable { +nonisolated class VoiceMessageMediaManagerMock: VoiceMessageMediaManagerProtocol, @unchecked Sendable { //MARK: - loadVoiceMessageFromSource - var loadVoiceMessageFromSourceBodyThrowableError: Error? + nonisolated(unsafe) var loadVoiceMessageFromSourceBodyThrowableError: Error? private let loadVoiceMessageFromSourceBodyCallsCountLock = NSLock() - private var loadVoiceMessageFromSourceBodyUnderlyingCallsCount = 0 + private nonisolated(unsafe) var loadVoiceMessageFromSourceBodyUnderlyingCallsCount = 0 var loadVoiceMessageFromSourceBodyCallsCount: Int { get { loadVoiceMessageFromSourceBodyCallsCountLock.withLock { loadVoiceMessageFromSourceBodyUnderlyingCallsCount } } set { loadVoiceMessageFromSourceBodyCallsCountLock.withLock { loadVoiceMessageFromSourceBodyUnderlyingCallsCount = newValue } } @@ -14706,27 +14706,27 @@ class VoiceMessageMediaManagerMock: VoiceMessageMediaManagerProtocol, @unchecked return loadVoiceMessageFromSourceBodyCallsCount > 0 } private let loadVoiceMessageFromSourceBodyReceivedArgumentsLock = NSLock() - private var loadVoiceMessageFromSourceBodyUnderlyingReceivedArguments: (source: MediaSourceProxy, body: String?)? + private nonisolated(unsafe) var loadVoiceMessageFromSourceBodyUnderlyingReceivedArguments: (source: MediaSourceProxy, body: String?)? var loadVoiceMessageFromSourceBodyReceivedArguments: (source: MediaSourceProxy, body: String?)? { get { loadVoiceMessageFromSourceBodyReceivedArgumentsLock.withLock { loadVoiceMessageFromSourceBodyUnderlyingReceivedArguments } } set { loadVoiceMessageFromSourceBodyReceivedArgumentsLock.withLock { loadVoiceMessageFromSourceBodyUnderlyingReceivedArguments = newValue } } } private let loadVoiceMessageFromSourceBodyReceivedInvocationsLock = NSLock() - private var loadVoiceMessageFromSourceBodyUnderlyingReceivedInvocations: [(source: MediaSourceProxy, body: String?)] = [] + private nonisolated(unsafe) var loadVoiceMessageFromSourceBodyUnderlyingReceivedInvocations: [(source: MediaSourceProxy, body: String?)] = [] var loadVoiceMessageFromSourceBodyReceivedInvocations: [(source: MediaSourceProxy, body: String?)] { get { loadVoiceMessageFromSourceBodyReceivedInvocationsLock.withLock { loadVoiceMessageFromSourceBodyUnderlyingReceivedInvocations } } set { loadVoiceMessageFromSourceBodyReceivedInvocationsLock.withLock { loadVoiceMessageFromSourceBodyUnderlyingReceivedInvocations = newValue } } } private let loadVoiceMessageFromSourceBodyReturnValueLock = NSLock() - private var loadVoiceMessageFromSourceBodyUnderlyingReturnValue: URL! + private nonisolated(unsafe) var loadVoiceMessageFromSourceBodyUnderlyingReturnValue: URL! var loadVoiceMessageFromSourceBodyReturnValue: URL! { get { loadVoiceMessageFromSourceBodyReturnValueLock.withLock { loadVoiceMessageFromSourceBodyUnderlyingReturnValue } } set { loadVoiceMessageFromSourceBodyReturnValueLock.withLock { loadVoiceMessageFromSourceBodyUnderlyingReturnValue = newValue } } } - var loadVoiceMessageFromSourceBodyClosure: ((MediaSourceProxy, String?) async throws -> URL)? + nonisolated(unsafe) var loadVoiceMessageFromSourceBodyClosure: ((MediaSourceProxy, String?) async throws -> URL)? - func loadVoiceMessageFromSource(_ source: MediaSourceProxy, body: String?) async throws -> URL { + @concurrent func loadVoiceMessageFromSource(_ source: MediaSourceProxy, body: String?) async throws -> URL { if let error = loadVoiceMessageFromSourceBodyThrowableError { throw error } @@ -14740,24 +14740,24 @@ class VoiceMessageMediaManagerMock: VoiceMessageMediaManagerProtocol, @unchecked } } } -class VoiceMessageRecorderMock: VoiceMessageRecorderProtocol, @unchecked Sendable { - var previewAudioPlayerState: AudioPlayerState? +nonisolated class VoiceMessageRecorderMock: VoiceMessageRecorderProtocol, @unchecked Sendable { + nonisolated(unsafe) var previewAudioPlayerState: AudioPlayerState? var isRecording: Bool { get { return underlyingIsRecording } set(value) { underlyingIsRecording = value } } - var underlyingIsRecording: Bool! - var recordingURL: URL? + nonisolated(unsafe) var underlyingIsRecording: Bool! + nonisolated(unsafe) var recordingURL: URL? var actions: AnyPublisher { get { return underlyingActions } set(value) { underlyingActions = value } } - var underlyingActions: AnyPublisher! + nonisolated(unsafe) var underlyingActions: AnyPublisher! //MARK: - startRecording private let startRecordingCallsCountLock = NSLock() - private var startRecordingUnderlyingCallsCount = 0 + private nonisolated(unsafe) var startRecordingUnderlyingCallsCount = 0 var startRecordingCallsCount: Int { get { startRecordingCallsCountLock.withLock { startRecordingUnderlyingCallsCount } } set { startRecordingCallsCountLock.withLock { startRecordingUnderlyingCallsCount = newValue } } @@ -14765,16 +14765,16 @@ class VoiceMessageRecorderMock: VoiceMessageRecorderProtocol, @unchecked Sendabl var startRecordingCalled: Bool { return startRecordingCallsCount > 0 } - var startRecordingClosure: (() async -> Void)? + nonisolated(unsafe) var startRecordingClosure: (() async -> Void)? - func startRecording() async { + @concurrent func startRecording() async { startRecordingCallsCountLock.withLock { startRecordingUnderlyingCallsCount += 1 } await startRecordingClosure?() } //MARK: - stopRecording private let stopRecordingCallsCountLock = NSLock() - private var stopRecordingUnderlyingCallsCount = 0 + private nonisolated(unsafe) var stopRecordingUnderlyingCallsCount = 0 var stopRecordingCallsCount: Int { get { stopRecordingCallsCountLock.withLock { stopRecordingUnderlyingCallsCount } } set { stopRecordingCallsCountLock.withLock { stopRecordingUnderlyingCallsCount = newValue } } @@ -14782,16 +14782,16 @@ class VoiceMessageRecorderMock: VoiceMessageRecorderProtocol, @unchecked Sendabl var stopRecordingCalled: Bool { return stopRecordingCallsCount > 0 } - var stopRecordingClosure: (() async -> Void)? + nonisolated(unsafe) var stopRecordingClosure: (() async -> Void)? - func stopRecording() async { + @concurrent func stopRecording() async { stopRecordingCallsCountLock.withLock { stopRecordingUnderlyingCallsCount += 1 } await stopRecordingClosure?() } //MARK: - cancelRecording private let cancelRecordingCallsCountLock = NSLock() - private var cancelRecordingUnderlyingCallsCount = 0 + private nonisolated(unsafe) var cancelRecordingUnderlyingCallsCount = 0 var cancelRecordingCallsCount: Int { get { cancelRecordingCallsCountLock.withLock { cancelRecordingUnderlyingCallsCount } } set { cancelRecordingCallsCountLock.withLock { cancelRecordingUnderlyingCallsCount = newValue } } @@ -14799,16 +14799,16 @@ class VoiceMessageRecorderMock: VoiceMessageRecorderProtocol, @unchecked Sendabl var cancelRecordingCalled: Bool { return cancelRecordingCallsCount > 0 } - var cancelRecordingClosure: (() async -> Void)? + nonisolated(unsafe) var cancelRecordingClosure: (() async -> Void)? - func cancelRecording() async { + @concurrent func cancelRecording() async { cancelRecordingCallsCountLock.withLock { cancelRecordingUnderlyingCallsCount += 1 } await cancelRecordingClosure?() } //MARK: - startPlayback private let startPlaybackCallsCountLock = NSLock() - private var startPlaybackUnderlyingCallsCount = 0 + private nonisolated(unsafe) var startPlaybackUnderlyingCallsCount = 0 var startPlaybackCallsCount: Int { get { startPlaybackCallsCountLock.withLock { startPlaybackUnderlyingCallsCount } } set { startPlaybackCallsCountLock.withLock { startPlaybackUnderlyingCallsCount = newValue } } @@ -14818,14 +14818,14 @@ class VoiceMessageRecorderMock: VoiceMessageRecorderProtocol, @unchecked Sendabl } private let startPlaybackReturnValueLock = NSLock() - private var startPlaybackUnderlyingReturnValue: Result! + private nonisolated(unsafe) var startPlaybackUnderlyingReturnValue: Result! var startPlaybackReturnValue: Result! { get { startPlaybackReturnValueLock.withLock { startPlaybackUnderlyingReturnValue } } set { startPlaybackReturnValueLock.withLock { startPlaybackUnderlyingReturnValue = newValue } } } - var startPlaybackClosure: (() async -> Result)? + nonisolated(unsafe) var startPlaybackClosure: (() async -> Result)? - func startPlayback() async -> Result { + @concurrent func startPlayback() async -> Result { startPlaybackCallsCountLock.withLock { startPlaybackUnderlyingCallsCount += 1 } if let startPlaybackClosure = startPlaybackClosure { return await startPlaybackClosure() @@ -14836,7 +14836,7 @@ class VoiceMessageRecorderMock: VoiceMessageRecorderProtocol, @unchecked Sendabl //MARK: - pausePlayback private let pausePlaybackCallsCountLock = NSLock() - private var pausePlaybackUnderlyingCallsCount = 0 + private nonisolated(unsafe) var pausePlaybackUnderlyingCallsCount = 0 var pausePlaybackCallsCount: Int { get { pausePlaybackCallsCountLock.withLock { pausePlaybackUnderlyingCallsCount } } set { pausePlaybackCallsCountLock.withLock { pausePlaybackUnderlyingCallsCount = newValue } } @@ -14844,7 +14844,7 @@ class VoiceMessageRecorderMock: VoiceMessageRecorderProtocol, @unchecked Sendabl var pausePlaybackCalled: Bool { return pausePlaybackCallsCount > 0 } - var pausePlaybackClosure: (() -> Void)? + nonisolated(unsafe) var pausePlaybackClosure: (() -> Void)? func pausePlayback() { pausePlaybackCallsCountLock.withLock { pausePlaybackUnderlyingCallsCount += 1 } @@ -14853,7 +14853,7 @@ class VoiceMessageRecorderMock: VoiceMessageRecorderProtocol, @unchecked Sendabl //MARK: - stopPlayback private let stopPlaybackCallsCountLock = NSLock() - private var stopPlaybackUnderlyingCallsCount = 0 + private nonisolated(unsafe) var stopPlaybackUnderlyingCallsCount = 0 var stopPlaybackCallsCount: Int { get { stopPlaybackCallsCountLock.withLock { stopPlaybackUnderlyingCallsCount } } set { stopPlaybackCallsCountLock.withLock { stopPlaybackUnderlyingCallsCount = newValue } } @@ -14861,16 +14861,16 @@ class VoiceMessageRecorderMock: VoiceMessageRecorderProtocol, @unchecked Sendabl var stopPlaybackCalled: Bool { return stopPlaybackCallsCount > 0 } - var stopPlaybackClosure: (() async -> Void)? + nonisolated(unsafe) var stopPlaybackClosure: (() async -> Void)? - func stopPlayback() async { + @concurrent func stopPlayback() async { stopPlaybackCallsCountLock.withLock { stopPlaybackUnderlyingCallsCount += 1 } await stopPlaybackClosure?() } //MARK: - seekPlayback private let seekPlaybackToCallsCountLock = NSLock() - private var seekPlaybackToUnderlyingCallsCount = 0 + private nonisolated(unsafe) var seekPlaybackToUnderlyingCallsCount = 0 var seekPlaybackToCallsCount: Int { get { seekPlaybackToCallsCountLock.withLock { seekPlaybackToUnderlyingCallsCount } } set { seekPlaybackToCallsCountLock.withLock { seekPlaybackToUnderlyingCallsCount = newValue } } @@ -14879,20 +14879,20 @@ class VoiceMessageRecorderMock: VoiceMessageRecorderProtocol, @unchecked Sendabl return seekPlaybackToCallsCount > 0 } private let seekPlaybackToReceivedProgressLock = NSLock() - private var seekPlaybackToUnderlyingReceivedProgress: Double? + private nonisolated(unsafe) var seekPlaybackToUnderlyingReceivedProgress: Double? var seekPlaybackToReceivedProgress: Double? { get { seekPlaybackToReceivedProgressLock.withLock { seekPlaybackToUnderlyingReceivedProgress } } set { seekPlaybackToReceivedProgressLock.withLock { seekPlaybackToUnderlyingReceivedProgress = newValue } } } private let seekPlaybackToReceivedInvocationsLock = NSLock() - private var seekPlaybackToUnderlyingReceivedInvocations: [Double] = [] + private nonisolated(unsafe) var seekPlaybackToUnderlyingReceivedInvocations: [Double] = [] var seekPlaybackToReceivedInvocations: [Double] { get { seekPlaybackToReceivedInvocationsLock.withLock { seekPlaybackToUnderlyingReceivedInvocations } } set { seekPlaybackToReceivedInvocationsLock.withLock { seekPlaybackToUnderlyingReceivedInvocations = newValue } } } - var seekPlaybackToClosure: ((Double) async -> Void)? + nonisolated(unsafe) var seekPlaybackToClosure: ((Double) async -> Void)? - func seekPlayback(to progress: Double) async { + @concurrent func seekPlayback(to progress: Double) async { seekPlaybackToCallsCountLock.withLock { seekPlaybackToUnderlyingCallsCount += 1 } seekPlaybackToReceivedProgress = progress seekPlaybackToReceivedInvocationsLock.withLock { seekPlaybackToUnderlyingReceivedInvocations.append(progress) } @@ -14901,7 +14901,7 @@ class VoiceMessageRecorderMock: VoiceMessageRecorderProtocol, @unchecked Sendabl //MARK: - deleteRecording private let deleteRecordingCallsCountLock = NSLock() - private var deleteRecordingUnderlyingCallsCount = 0 + private nonisolated(unsafe) var deleteRecordingUnderlyingCallsCount = 0 var deleteRecordingCallsCount: Int { get { deleteRecordingCallsCountLock.withLock { deleteRecordingUnderlyingCallsCount } } set { deleteRecordingCallsCountLock.withLock { deleteRecordingUnderlyingCallsCount = newValue } } @@ -14909,16 +14909,16 @@ class VoiceMessageRecorderMock: VoiceMessageRecorderProtocol, @unchecked Sendabl var deleteRecordingCalled: Bool { return deleteRecordingCallsCount > 0 } - var deleteRecordingClosure: (() async -> Void)? + nonisolated(unsafe) var deleteRecordingClosure: (() async -> Void)? - func deleteRecording() async { + @concurrent func deleteRecording() async { deleteRecordingCallsCountLock.withLock { deleteRecordingUnderlyingCallsCount += 1 } await deleteRecordingClosure?() } //MARK: - sendVoiceMessage private let sendVoiceMessageTimelineControllerAudioConverterCallsCountLock = NSLock() - private var sendVoiceMessageTimelineControllerAudioConverterUnderlyingCallsCount = 0 + private nonisolated(unsafe) var sendVoiceMessageTimelineControllerAudioConverterUnderlyingCallsCount = 0 var sendVoiceMessageTimelineControllerAudioConverterCallsCount: Int { get { sendVoiceMessageTimelineControllerAudioConverterCallsCountLock.withLock { sendVoiceMessageTimelineControllerAudioConverterUnderlyingCallsCount } } set { sendVoiceMessageTimelineControllerAudioConverterCallsCountLock.withLock { sendVoiceMessageTimelineControllerAudioConverterUnderlyingCallsCount = newValue } } @@ -14927,27 +14927,27 @@ class VoiceMessageRecorderMock: VoiceMessageRecorderProtocol, @unchecked Sendabl return sendVoiceMessageTimelineControllerAudioConverterCallsCount > 0 } private let sendVoiceMessageTimelineControllerAudioConverterReceivedArgumentsLock = NSLock() - private var sendVoiceMessageTimelineControllerAudioConverterUnderlyingReceivedArguments: (timelineController: TimelineControllerProtocol, audioConverter: AudioConverterProtocol)? + private nonisolated(unsafe) var sendVoiceMessageTimelineControllerAudioConverterUnderlyingReceivedArguments: (timelineController: TimelineControllerProtocol, audioConverter: AudioConverterProtocol)? var sendVoiceMessageTimelineControllerAudioConverterReceivedArguments: (timelineController: TimelineControllerProtocol, audioConverter: AudioConverterProtocol)? { get { sendVoiceMessageTimelineControllerAudioConverterReceivedArgumentsLock.withLock { sendVoiceMessageTimelineControllerAudioConverterUnderlyingReceivedArguments } } set { sendVoiceMessageTimelineControllerAudioConverterReceivedArgumentsLock.withLock { sendVoiceMessageTimelineControllerAudioConverterUnderlyingReceivedArguments = newValue } } } private let sendVoiceMessageTimelineControllerAudioConverterReceivedInvocationsLock = NSLock() - private var sendVoiceMessageTimelineControllerAudioConverterUnderlyingReceivedInvocations: [(timelineController: TimelineControllerProtocol, audioConverter: AudioConverterProtocol)] = [] + private nonisolated(unsafe) var sendVoiceMessageTimelineControllerAudioConverterUnderlyingReceivedInvocations: [(timelineController: TimelineControllerProtocol, audioConverter: AudioConverterProtocol)] = [] var sendVoiceMessageTimelineControllerAudioConverterReceivedInvocations: [(timelineController: TimelineControllerProtocol, audioConverter: AudioConverterProtocol)] { get { sendVoiceMessageTimelineControllerAudioConverterReceivedInvocationsLock.withLock { sendVoiceMessageTimelineControllerAudioConverterUnderlyingReceivedInvocations } } set { sendVoiceMessageTimelineControllerAudioConverterReceivedInvocationsLock.withLock { sendVoiceMessageTimelineControllerAudioConverterUnderlyingReceivedInvocations = newValue } } } private let sendVoiceMessageTimelineControllerAudioConverterReturnValueLock = NSLock() - private var sendVoiceMessageTimelineControllerAudioConverterUnderlyingReturnValue: Result! + private nonisolated(unsafe) var sendVoiceMessageTimelineControllerAudioConverterUnderlyingReturnValue: Result! var sendVoiceMessageTimelineControllerAudioConverterReturnValue: Result! { get { sendVoiceMessageTimelineControllerAudioConverterReturnValueLock.withLock { sendVoiceMessageTimelineControllerAudioConverterUnderlyingReturnValue } } set { sendVoiceMessageTimelineControllerAudioConverterReturnValueLock.withLock { sendVoiceMessageTimelineControllerAudioConverterUnderlyingReturnValue = newValue } } } - var sendVoiceMessageTimelineControllerAudioConverterClosure: ((TimelineControllerProtocol, AudioConverterProtocol) async -> Result)? + nonisolated(unsafe) var sendVoiceMessageTimelineControllerAudioConverterClosure: ((TimelineControllerProtocol, AudioConverterProtocol) async -> Result)? - func sendVoiceMessage(timelineController: TimelineControllerProtocol, audioConverter: AudioConverterProtocol) async -> Result { + @concurrent func sendVoiceMessage(timelineController: TimelineControllerProtocol, audioConverter: AudioConverterProtocol) async -> Result { sendVoiceMessageTimelineControllerAudioConverterCallsCountLock.withLock { sendVoiceMessageTimelineControllerAudioConverterUnderlyingCallsCount += 1 } sendVoiceMessageTimelineControllerAudioConverterReceivedArguments = (timelineController: timelineController, audioConverter: audioConverter) sendVoiceMessageTimelineControllerAudioConverterReceivedInvocationsLock.withLock { sendVoiceMessageTimelineControllerAudioConverterUnderlyingReceivedInvocations.append((timelineController: timelineController, audioConverter: audioConverter)) } @@ -14958,22 +14958,22 @@ class VoiceMessageRecorderMock: VoiceMessageRecorderProtocol, @unchecked Sendabl } } } -class WindowManagerMock: WindowManagerProtocol, @unchecked Sendable { - var mainWindow: UIWindow! - var overlayWindow: UIWindow! - var globalSearchWindow: UIWindow! - var alternateWindow: UIWindow! - var windows: [UIWindow] = [] +nonisolated class WindowManagerMock: WindowManagerProtocol, @unchecked Sendable { + nonisolated(unsafe) var mainWindow: UIWindow! + nonisolated(unsafe) var overlayWindow: UIWindow! + nonisolated(unsafe) var globalSearchWindow: UIWindow! + nonisolated(unsafe) var alternateWindow: UIWindow! + nonisolated(unsafe) var windows: [UIWindow] = [] var secondaryWindowsEnabled: Bool { get { return underlyingSecondaryWindowsEnabled } set(value) { underlyingSecondaryWindowsEnabled = value } } - var underlyingSecondaryWindowsEnabled: Bool! + nonisolated(unsafe) var underlyingSecondaryWindowsEnabled: Bool! //MARK: - showGlobalSearch private let showGlobalSearchCallsCountLock = NSLock() - private var showGlobalSearchUnderlyingCallsCount = 0 + private nonisolated(unsafe) var showGlobalSearchUnderlyingCallsCount = 0 var showGlobalSearchCallsCount: Int { get { showGlobalSearchCallsCountLock.withLock { showGlobalSearchUnderlyingCallsCount } } set { showGlobalSearchCallsCountLock.withLock { showGlobalSearchUnderlyingCallsCount = newValue } } @@ -14981,7 +14981,7 @@ class WindowManagerMock: WindowManagerProtocol, @unchecked Sendable { var showGlobalSearchCalled: Bool { return showGlobalSearchCallsCount > 0 } - var showGlobalSearchClosure: (() -> Void)? + nonisolated(unsafe) var showGlobalSearchClosure: (() -> Void)? func showGlobalSearch() { showGlobalSearchCallsCountLock.withLock { showGlobalSearchUnderlyingCallsCount += 1 } @@ -14990,7 +14990,7 @@ class WindowManagerMock: WindowManagerProtocol, @unchecked Sendable { //MARK: - hideGlobalSearch private let hideGlobalSearchCallsCountLock = NSLock() - private var hideGlobalSearchUnderlyingCallsCount = 0 + private nonisolated(unsafe) var hideGlobalSearchUnderlyingCallsCount = 0 var hideGlobalSearchCallsCount: Int { get { hideGlobalSearchCallsCountLock.withLock { hideGlobalSearchUnderlyingCallsCount } } set { hideGlobalSearchCallsCountLock.withLock { hideGlobalSearchUnderlyingCallsCount = newValue } } @@ -14998,7 +14998,7 @@ class WindowManagerMock: WindowManagerProtocol, @unchecked Sendable { var hideGlobalSearchCalled: Bool { return hideGlobalSearchCallsCount > 0 } - var hideGlobalSearchClosure: (() -> Void)? + nonisolated(unsafe) var hideGlobalSearchClosure: (() -> Void)? func hideGlobalSearch() { hideGlobalSearchCallsCountLock.withLock { hideGlobalSearchUnderlyingCallsCount += 1 } @@ -15007,7 +15007,7 @@ class WindowManagerMock: WindowManagerProtocol, @unchecked Sendable { //MARK: - registerCoordinator private let registerCoordinatorFlowCoordinatorForWindowTypeCallsCountLock = NSLock() - private var registerCoordinatorFlowCoordinatorForWindowTypeUnderlyingCallsCount = 0 + private nonisolated(unsafe) var registerCoordinatorFlowCoordinatorForWindowTypeUnderlyingCallsCount = 0 var registerCoordinatorFlowCoordinatorForWindowTypeCallsCount: Int { get { registerCoordinatorFlowCoordinatorForWindowTypeCallsCountLock.withLock { registerCoordinatorFlowCoordinatorForWindowTypeUnderlyingCallsCount } } set { registerCoordinatorFlowCoordinatorForWindowTypeCallsCountLock.withLock { registerCoordinatorFlowCoordinatorForWindowTypeUnderlyingCallsCount = newValue } } @@ -15016,18 +15016,18 @@ class WindowManagerMock: WindowManagerProtocol, @unchecked Sendable { return registerCoordinatorFlowCoordinatorForWindowTypeCallsCount > 0 } private let registerCoordinatorFlowCoordinatorForWindowTypeReceivedArgumentsLock = NSLock() - private var registerCoordinatorFlowCoordinatorForWindowTypeUnderlyingReceivedArguments: (coordinator: CoordinatorProtocol, flowCoordinator: FlowCoordinatorProtocol?, type: SecondaryWindowType)? + private nonisolated(unsafe) var registerCoordinatorFlowCoordinatorForWindowTypeUnderlyingReceivedArguments: (coordinator: CoordinatorProtocol, flowCoordinator: FlowCoordinatorProtocol?, type: SecondaryWindowType)? var registerCoordinatorFlowCoordinatorForWindowTypeReceivedArguments: (coordinator: CoordinatorProtocol, flowCoordinator: FlowCoordinatorProtocol?, type: SecondaryWindowType)? { get { registerCoordinatorFlowCoordinatorForWindowTypeReceivedArgumentsLock.withLock { registerCoordinatorFlowCoordinatorForWindowTypeUnderlyingReceivedArguments } } set { registerCoordinatorFlowCoordinatorForWindowTypeReceivedArgumentsLock.withLock { registerCoordinatorFlowCoordinatorForWindowTypeUnderlyingReceivedArguments = newValue } } } private let registerCoordinatorFlowCoordinatorForWindowTypeReceivedInvocationsLock = NSLock() - private var registerCoordinatorFlowCoordinatorForWindowTypeUnderlyingReceivedInvocations: [(coordinator: CoordinatorProtocol, flowCoordinator: FlowCoordinatorProtocol?, type: SecondaryWindowType)] = [] + private nonisolated(unsafe) var registerCoordinatorFlowCoordinatorForWindowTypeUnderlyingReceivedInvocations: [(coordinator: CoordinatorProtocol, flowCoordinator: FlowCoordinatorProtocol?, type: SecondaryWindowType)] = [] var registerCoordinatorFlowCoordinatorForWindowTypeReceivedInvocations: [(coordinator: CoordinatorProtocol, flowCoordinator: FlowCoordinatorProtocol?, type: SecondaryWindowType)] { get { registerCoordinatorFlowCoordinatorForWindowTypeReceivedInvocationsLock.withLock { registerCoordinatorFlowCoordinatorForWindowTypeUnderlyingReceivedInvocations } } set { registerCoordinatorFlowCoordinatorForWindowTypeReceivedInvocationsLock.withLock { registerCoordinatorFlowCoordinatorForWindowTypeUnderlyingReceivedInvocations = newValue } } } - var registerCoordinatorFlowCoordinatorForWindowTypeClosure: ((CoordinatorProtocol, FlowCoordinatorProtocol?, SecondaryWindowType) -> Void)? + nonisolated(unsafe) var registerCoordinatorFlowCoordinatorForWindowTypeClosure: ((CoordinatorProtocol, FlowCoordinatorProtocol?, SecondaryWindowType) -> Void)? func registerCoordinator(_ coordinator: CoordinatorProtocol, flowCoordinator: FlowCoordinatorProtocol?, forWindowType type: SecondaryWindowType) { registerCoordinatorFlowCoordinatorForWindowTypeCallsCountLock.withLock { registerCoordinatorFlowCoordinatorForWindowTypeUnderlyingCallsCount += 1 } @@ -15038,7 +15038,7 @@ class WindowManagerMock: WindowManagerProtocol, @unchecked Sendable { //MARK: - closeAllSecondaryWindows private let closeAllSecondaryWindowsCallsCountLock = NSLock() - private var closeAllSecondaryWindowsUnderlyingCallsCount = 0 + private nonisolated(unsafe) var closeAllSecondaryWindowsUnderlyingCallsCount = 0 var closeAllSecondaryWindowsCallsCount: Int { get { closeAllSecondaryWindowsCallsCountLock.withLock { closeAllSecondaryWindowsUnderlyingCallsCount } } set { closeAllSecondaryWindowsCallsCountLock.withLock { closeAllSecondaryWindowsUnderlyingCallsCount = newValue } } @@ -15046,7 +15046,7 @@ class WindowManagerMock: WindowManagerProtocol, @unchecked Sendable { var closeAllSecondaryWindowsCalled: Bool { return closeAllSecondaryWindowsCallsCount > 0 } - var closeAllSecondaryWindowsClosure: (() -> Void)? + nonisolated(unsafe) var closeAllSecondaryWindowsClosure: (() -> Void)? func closeAllSecondaryWindows() { closeAllSecondaryWindowsCallsCountLock.withLock { closeAllSecondaryWindowsUnderlyingCallsCount += 1 } @@ -15055,7 +15055,7 @@ class WindowManagerMock: WindowManagerProtocol, @unchecked Sendable { //MARK: - closeSecondaryWindow private let closeSecondaryWindowForTypeCallsCountLock = NSLock() - private var closeSecondaryWindowForTypeUnderlyingCallsCount = 0 + private nonisolated(unsafe) var closeSecondaryWindowForTypeUnderlyingCallsCount = 0 var closeSecondaryWindowForTypeCallsCount: Int { get { closeSecondaryWindowForTypeCallsCountLock.withLock { closeSecondaryWindowForTypeUnderlyingCallsCount } } set { closeSecondaryWindowForTypeCallsCountLock.withLock { closeSecondaryWindowForTypeUnderlyingCallsCount = newValue } } @@ -15064,18 +15064,18 @@ class WindowManagerMock: WindowManagerProtocol, @unchecked Sendable { return closeSecondaryWindowForTypeCallsCount > 0 } private let closeSecondaryWindowForTypeReceivedTypeLock = NSLock() - private var closeSecondaryWindowForTypeUnderlyingReceivedType: SecondaryWindowType? + private nonisolated(unsafe) var closeSecondaryWindowForTypeUnderlyingReceivedType: SecondaryWindowType? var closeSecondaryWindowForTypeReceivedType: SecondaryWindowType? { get { closeSecondaryWindowForTypeReceivedTypeLock.withLock { closeSecondaryWindowForTypeUnderlyingReceivedType } } set { closeSecondaryWindowForTypeReceivedTypeLock.withLock { closeSecondaryWindowForTypeUnderlyingReceivedType = newValue } } } private let closeSecondaryWindowForTypeReceivedInvocationsLock = NSLock() - private var closeSecondaryWindowForTypeUnderlyingReceivedInvocations: [SecondaryWindowType] = [] + private nonisolated(unsafe) var closeSecondaryWindowForTypeUnderlyingReceivedInvocations: [SecondaryWindowType] = [] var closeSecondaryWindowForTypeReceivedInvocations: [SecondaryWindowType] { get { closeSecondaryWindowForTypeReceivedInvocationsLock.withLock { closeSecondaryWindowForTypeUnderlyingReceivedInvocations } } set { closeSecondaryWindowForTypeReceivedInvocationsLock.withLock { closeSecondaryWindowForTypeUnderlyingReceivedInvocations = newValue } } } - var closeSecondaryWindowForTypeClosure: ((SecondaryWindowType) -> Void)? + nonisolated(unsafe) var closeSecondaryWindowForTypeClosure: ((SecondaryWindowType) -> Void)? func closeSecondaryWindow(forType type: SecondaryWindowType) { closeSecondaryWindowForTypeCallsCountLock.withLock { closeSecondaryWindowForTypeUnderlyingCallsCount += 1 } @@ -15086,7 +15086,7 @@ class WindowManagerMock: WindowManagerProtocol, @unchecked Sendable { //MARK: - setOrientation private let setOrientationCallsCountLock = NSLock() - private var setOrientationUnderlyingCallsCount = 0 + private nonisolated(unsafe) var setOrientationUnderlyingCallsCount = 0 var setOrientationCallsCount: Int { get { setOrientationCallsCountLock.withLock { setOrientationUnderlyingCallsCount } } set { setOrientationCallsCountLock.withLock { setOrientationUnderlyingCallsCount = newValue } } @@ -15095,18 +15095,18 @@ class WindowManagerMock: WindowManagerProtocol, @unchecked Sendable { return setOrientationCallsCount > 0 } private let setOrientationReceivedOrientationLock = NSLock() - private var setOrientationUnderlyingReceivedOrientation: UIInterfaceOrientationMask? + private nonisolated(unsafe) var setOrientationUnderlyingReceivedOrientation: UIInterfaceOrientationMask? var setOrientationReceivedOrientation: UIInterfaceOrientationMask? { get { setOrientationReceivedOrientationLock.withLock { setOrientationUnderlyingReceivedOrientation } } set { setOrientationReceivedOrientationLock.withLock { setOrientationUnderlyingReceivedOrientation = newValue } } } private let setOrientationReceivedInvocationsLock = NSLock() - private var setOrientationUnderlyingReceivedInvocations: [UIInterfaceOrientationMask] = [] + private nonisolated(unsafe) var setOrientationUnderlyingReceivedInvocations: [UIInterfaceOrientationMask] = [] var setOrientationReceivedInvocations: [UIInterfaceOrientationMask] { get { setOrientationReceivedInvocationsLock.withLock { setOrientationUnderlyingReceivedInvocations } } set { setOrientationReceivedInvocationsLock.withLock { setOrientationUnderlyingReceivedInvocations = newValue } } } - var setOrientationClosure: ((UIInterfaceOrientationMask) -> Void)? + nonisolated(unsafe) var setOrientationClosure: ((UIInterfaceOrientationMask) -> Void)? func setOrientation(_ orientation: UIInterfaceOrientationMask) { setOrientationCallsCountLock.withLock { setOrientationUnderlyingCallsCount += 1 } @@ -15117,7 +15117,7 @@ class WindowManagerMock: WindowManagerProtocol, @unchecked Sendable { //MARK: - lockOrientation private let lockOrientationCallsCountLock = NSLock() - private var lockOrientationUnderlyingCallsCount = 0 + private nonisolated(unsafe) var lockOrientationUnderlyingCallsCount = 0 var lockOrientationCallsCount: Int { get { lockOrientationCallsCountLock.withLock { lockOrientationUnderlyingCallsCount } } set { lockOrientationCallsCountLock.withLock { lockOrientationUnderlyingCallsCount = newValue } } @@ -15126,18 +15126,18 @@ class WindowManagerMock: WindowManagerProtocol, @unchecked Sendable { return lockOrientationCallsCount > 0 } private let lockOrientationReceivedOrientationLock = NSLock() - private var lockOrientationUnderlyingReceivedOrientation: UIInterfaceOrientationMask? + private nonisolated(unsafe) var lockOrientationUnderlyingReceivedOrientation: UIInterfaceOrientationMask? var lockOrientationReceivedOrientation: UIInterfaceOrientationMask? { get { lockOrientationReceivedOrientationLock.withLock { lockOrientationUnderlyingReceivedOrientation } } set { lockOrientationReceivedOrientationLock.withLock { lockOrientationUnderlyingReceivedOrientation = newValue } } } private let lockOrientationReceivedInvocationsLock = NSLock() - private var lockOrientationUnderlyingReceivedInvocations: [UIInterfaceOrientationMask] = [] + private nonisolated(unsafe) var lockOrientationUnderlyingReceivedInvocations: [UIInterfaceOrientationMask] = [] var lockOrientationReceivedInvocations: [UIInterfaceOrientationMask] { get { lockOrientationReceivedInvocationsLock.withLock { lockOrientationUnderlyingReceivedInvocations } } set { lockOrientationReceivedInvocationsLock.withLock { lockOrientationUnderlyingReceivedInvocations = newValue } } } - var lockOrientationClosure: ((UIInterfaceOrientationMask) -> Void)? + nonisolated(unsafe) var lockOrientationClosure: ((UIInterfaceOrientationMask) -> Void)? func lockOrientation(_ orientation: UIInterfaceOrientationMask) { lockOrientationCallsCountLock.withLock { lockOrientationUnderlyingCallsCount += 1 } diff --git a/ElementX/Sources/Mocks/RoomLiveLocationServiceMock.swift b/ElementX/Sources/Mocks/RoomLiveLocationServiceMock.swift index f9d105870..48d156d27 100644 --- a/ElementX/Sources/Mocks/RoomLiveLocationServiceMock.swift +++ b/ElementX/Sources/Mocks/RoomLiveLocationServiceMock.swift @@ -12,7 +12,7 @@ struct RoomLiveLocationServiceMockConfiguration { var shares: [LiveLocationShare] = [] } -extension RoomLiveLocationServiceMock { +@MainActor extension RoomLiveLocationServiceMock { convenience init(_ configuration: RoomLiveLocationServiceMockConfiguration = .init()) { self.init() liveLocationsPublisher = CurrentValueSubject(configuration.shares).asCurrentValuePublisher() diff --git a/ElementX/Sources/Mocks/RoomMemberProxyMock.swift b/ElementX/Sources/Mocks/RoomMemberProxyMock.swift index 66e26f1df..f69ea522d 100644 --- a/ElementX/Sources/Mocks/RoomMemberProxyMock.swift +++ b/ElementX/Sources/Mocks/RoomMemberProxyMock.swift @@ -9,7 +9,7 @@ import Foundation import MatrixRustSDK -struct RoomMemberProxyMockConfiguration { +nonisolated struct RoomMemberProxyMockConfiguration { var userID: String var displayName: String? var avatarURL: URL? diff --git a/ElementX/Sources/Mocks/RoomNotificationSettingsProxyMock.swift b/ElementX/Sources/Mocks/RoomNotificationSettingsProxyMock.swift index 2feeae18a..6524d259f 100644 --- a/ElementX/Sources/Mocks/RoomNotificationSettingsProxyMock.swift +++ b/ElementX/Sources/Mocks/RoomNotificationSettingsProxyMock.swift @@ -14,7 +14,7 @@ struct RoomNotificationSettingsProxyMockConfiguration { var isDefault = true } -extension RoomNotificationSettingsProxyMock { +@MainActor extension RoomNotificationSettingsProxyMock { convenience init(with configuration: RoomNotificationSettingsProxyMockConfiguration) { self.init() diff --git a/ElementX/Sources/Mocks/RoomPowerLevelsProxyMock.swift b/ElementX/Sources/Mocks/RoomPowerLevelsProxyMock.swift index 8beabf97a..33c86fffc 100644 --- a/ElementX/Sources/Mocks/RoomPowerLevelsProxyMock.swift +++ b/ElementX/Sources/Mocks/RoomPowerLevelsProxyMock.swift @@ -8,7 +8,7 @@ import MatrixRustSDK -extension RoomPowerLevelsProxyMock { +@MainActor extension RoomPowerLevelsProxyMock { struct Configuration { var canUserSendMessage = true var canUserSendState = false diff --git a/ElementX/Sources/Mocks/RoomPreviewProxyMock.swift b/ElementX/Sources/Mocks/RoomPreviewProxyMock.swift index c110580a9..c8ee05111 100644 --- a/ElementX/Sources/Mocks/RoomPreviewProxyMock.swift +++ b/ElementX/Sources/Mocks/RoomPreviewProxyMock.swift @@ -9,7 +9,7 @@ import Foundation import MatrixRustSDK -extension RoomPreviewProxyMock { +@MainActor extension RoomPreviewProxyMock { struct Configuration { var roomID = "1" var canonicalAlias = "#3-body-problem:matrix.org" diff --git a/ElementX/Sources/Mocks/SDK/ClientSDKMock.swift b/ElementX/Sources/Mocks/SDK/ClientSDKMock.swift index 4fb72be8a..30a5318e4 100644 --- a/ElementX/Sources/Mocks/SDK/ClientSDKMock.swift +++ b/ElementX/Sources/Mocks/SDK/ClientSDKMock.swift @@ -10,7 +10,7 @@ import Foundation import MatrixRustSDK import MatrixRustSDKMocks -extension ClientSDKMock { +nonisolated extension ClientSDKMock { struct Configuration { // MARK: Authentication @@ -73,7 +73,7 @@ extension ClientSDKMock { } } -extension HomeserverLoginDetailsSDKMock { +nonisolated extension HomeserverLoginDetailsSDKMock { convenience init(configuration: ClientSDKMock.Configuration) { self.init() @@ -89,7 +89,7 @@ extension HomeserverLoginDetailsSDKMock { } } -extension OAuthAuthorizationDataSDKMock { +nonisolated extension OAuthAuthorizationDataSDKMock { convenience init(configuration: ClientSDKMock.Configuration) { self.init() diff --git a/ElementX/Sources/Mocks/SDK/EventTimelineItem.swift b/ElementX/Sources/Mocks/SDK/EventTimelineItem.swift index 49b3d9115..d91a159b4 100644 --- a/ElementX/Sources/Mocks/SDK/EventTimelineItem.swift +++ b/ElementX/Sources/Mocks/SDK/EventTimelineItem.swift @@ -11,7 +11,7 @@ import LoremSwiftum import MatrixRustSDK import MatrixRustSDKMocks -struct EventTimelineItemSDKMockConfiguration { +nonisolated struct EventTimelineItemSDKMockConfiguration { var eventID: String = UUID().uuidString var sender = "" var senderProfile: ProfileDetails? @@ -27,7 +27,7 @@ struct EventTimelineItemSDKMockConfiguration { threadSummary: nil)) } -extension EventTimelineItem { +nonisolated extension EventTimelineItem { init(configuration: EventTimelineItemSDKMockConfiguration) { let lazyProvider = LazyTimelineItemProviderSDKMock() lazyProvider.containsOnlyEmojisReturnValue = false diff --git a/ElementX/Sources/Mocks/SDK/IdentityResetHandleSDKMock.swift b/ElementX/Sources/Mocks/SDK/IdentityResetHandleSDKMock.swift index 178d9ea59..a4e4ee10e 100644 --- a/ElementX/Sources/Mocks/SDK/IdentityResetHandleSDKMock.swift +++ b/ElementX/Sources/Mocks/SDK/IdentityResetHandleSDKMock.swift @@ -10,7 +10,7 @@ import Foundation import MatrixRustSDK import MatrixRustSDKMocks -extension IdentityResetHandleSDKMock { +nonisolated extension IdentityResetHandleSDKMock { struct Configuration { } convenience init(_ configuration: Configuration) { diff --git a/ElementX/Sources/Mocks/SDK/LeaveSpaceHandleSDKMock.swift b/ElementX/Sources/Mocks/SDK/LeaveSpaceHandleSDKMock.swift index 3001e3b61..c60632b52 100644 --- a/ElementX/Sources/Mocks/SDK/LeaveSpaceHandleSDKMock.swift +++ b/ElementX/Sources/Mocks/SDK/LeaveSpaceHandleSDKMock.swift @@ -10,7 +10,7 @@ import Foundation import MatrixRustSDK import MatrixRustSDKMocks -extension LeaveSpaceHandleSDKMock { +nonisolated extension LeaveSpaceHandleSDKMock { struct Configuration { var rooms: [LeaveSpaceRoom] = .mockRooms } @@ -22,7 +22,7 @@ extension LeaveSpaceHandleSDKMock { } } -extension [LeaveSpaceRoom] { +nonisolated extension [LeaveSpaceRoom] { static func mockRoomsWithSpace(spaceServiceRoom: SpaceServiceRoom, isLastOwner: Bool, areCreatorsPrivileged: Bool) -> [LeaveSpaceRoom] { mockRooms + mockSingleSpace(spaceServiceRoom: spaceServiceRoom, isLastOwner: isLastOwner, areCreatorsPrivileged: areCreatorsPrivileged) } @@ -138,7 +138,7 @@ extension [LeaveSpaceRoom] { } } -private extension SpaceRoom { +private nonisolated extension SpaceRoom { init(id: String, canonicalAlias: String? = nil, name: String, diff --git a/ElementX/Sources/Mocks/SessionVerificationControllerProxyMock.swift b/ElementX/Sources/Mocks/SessionVerificationControllerProxyMock.swift index 0a3a4b2f6..d69328ec1 100644 --- a/ElementX/Sources/Mocks/SessionVerificationControllerProxyMock.swift +++ b/ElementX/Sources/Mocks/SessionVerificationControllerProxyMock.swift @@ -27,7 +27,7 @@ extension SessionVerificationControllerProxyMock { mock.acknowledgeVerificationRequestDetailsReturnValue = .success(()) mock.requestDeviceVerificationClosure = { [weak mock] in - Task.detached { + Task { guard let mock else { return } try await Task.sleep(for: requestDelay) @@ -46,13 +46,13 @@ extension SessionVerificationControllerProxyMock { } mock.startSasVerificationClosure = { [weak mock] in - Task.detached { + Task { guard let mock else { return } try await Task.sleep(for: requestDelay) mock.actions.send(.startedSasVerification) - Task.detached { + Task { try await Task.sleep(for: requestDelay) mock.actions.send(.receivedVerificationData(emojis)) } @@ -62,7 +62,7 @@ extension SessionVerificationControllerProxyMock { } mock.approveVerificationClosure = { [weak mock] in - Task.detached { + Task { guard let mock else { return } try await Task.sleep(for: requestDelay) @@ -73,7 +73,7 @@ extension SessionVerificationControllerProxyMock { } mock.declineVerificationClosure = { [weak mock] in - Task.detached { + Task { guard let mock else { return } try await Task.sleep(for: requestDelay) @@ -84,7 +84,7 @@ extension SessionVerificationControllerProxyMock { } mock.cancelVerificationClosure = { [weak mock] in - Task.detached { + Task { guard let mock else { return } try await Task.sleep(for: requestDelay) diff --git a/ElementX/Sources/Mocks/SignallingTimelineItemProviderMock.swift b/ElementX/Sources/Mocks/SignallingTimelineItemProviderMock.swift index c56ce1250..4cc6cedd0 100644 --- a/ElementX/Sources/Mocks/SignallingTimelineItemProviderMock.swift +++ b/ElementX/Sources/Mocks/SignallingTimelineItemProviderMock.swift @@ -14,7 +14,7 @@ import MatrixRustSDK /// A ``TimelineItemProviderMock`` subclass that optionally listens for ``UITestsSignalling`` signals /// to drive pagination and incoming message simulation. @MainActor -class SignallingTimelineItemProviderMock: TimelineItemProviderMock { +class SignallingTimelineItemProviderMock: TimelineItemProviderMock, @unchecked Sendable { private let stateSubject: CurrentValueSubject<([TimelineItemProxy], TimelinePaginationState), Never> /// An array of item arrays that will be prepended in order on each paginate signal. @@ -25,6 +25,10 @@ class SignallingTimelineItemProviderMock: TimelineItemProviderMock { private var client: UITestsSignalling.Client? private var signalCancellable: AnyCancellable? + override nonisolated init() { + fatalError("Use init(itemProxies:paginationState:listenForSignals:) instead.") + } + init(itemProxies: [TimelineItemProxy] = [], paginationState: TimelinePaginationState = .init(backward: .idle, forward: .endReached), listenForSignals: Bool = false) { diff --git a/ElementX/Sources/Mocks/SpaceRoomListProxyMock.swift b/ElementX/Sources/Mocks/SpaceRoomListProxyMock.swift index 337d00523..7181dd706 100644 --- a/ElementX/Sources/Mocks/SpaceRoomListProxyMock.swift +++ b/ElementX/Sources/Mocks/SpaceRoomListProxyMock.swift @@ -10,7 +10,7 @@ import Combine import Foundation import MatrixRustSDK -extension SpaceRoomListProxyMock { +@MainActor extension SpaceRoomListProxyMock { class Configuration { var spaceServiceRoom: SpaceServiceRoom var initialSpaceRooms: [SpaceServiceRoom] diff --git a/ElementX/Sources/Mocks/TimelineControllerMock.swift b/ElementX/Sources/Mocks/TimelineControllerMock.swift index 3a7d93f0d..10fea0ffa 100644 --- a/ElementX/Sources/Mocks/TimelineControllerMock.swift +++ b/ElementX/Sources/Mocks/TimelineControllerMock.swift @@ -22,7 +22,7 @@ struct TimelineControllerMockConfiguration { var paginationState: TimelinePaginationState = .initial } -extension TimelineControllerMock { +@MainActor extension TimelineControllerMock { static var mediaGallery: TimelineControllerMock { TimelineControllerMock(.init(timelineKind: .media(.mediaFilesScreen), timelineItems: (0..<5).reduce([]) { partialResult, _ in partialResult + [TimelineFixtures.separator] + TimelineFixtures.mediaChunk diff --git a/ElementX/Sources/Mocks/UserSessionMock.swift b/ElementX/Sources/Mocks/UserSessionMock.swift index 7eee9a90c..721242314 100644 --- a/ElementX/Sources/Mocks/UserSessionMock.swift +++ b/ElementX/Sources/Mocks/UserSessionMock.swift @@ -13,7 +13,7 @@ struct UserSessionMockConfiguration { var clientProxy: ClientProxyProtocol = ClientProxyMock(.init()) } -extension UserSessionMock { +@MainActor extension UserSessionMock { convenience init(_ configuration: UserSessionMockConfiguration) { self.init() diff --git a/ElementX/Sources/Other/Avatars.swift b/ElementX/Sources/Other/Avatars.swift index b5e05a021..e3b577bd4 100644 --- a/ElementX/Sources/Other/Avatars.swift +++ b/ElementX/Sources/Other/Avatars.swift @@ -29,11 +29,11 @@ enum Avatars { } /// Value in pixels by using the scale of the main screen - var scaledValue: CGFloat { + @MainActor var scaledValue: CGFloat { value * UIScreen.main.scale } - var scaledSize: CGSize { + @MainActor var scaledSize: CGSize { CGSize(width: scaledValue, height: scaledValue) } } diff --git a/ElementX/Sources/Other/CallIntent.swift b/ElementX/Sources/Other/CallIntent.swift index 02498e63f..384ad1e01 100644 --- a/ElementX/Sources/Other/CallIntent.swift +++ b/ElementX/Sources/Other/CallIntent.swift @@ -8,11 +8,11 @@ import Foundation import MatrixRustSDK -enum CallIntent: String, Codable, CaseIterable { +nonisolated enum CallIntent: String, Codable, CaseIterable { case video, audio } -extension CallIntent { +nonisolated extension CallIntent { // periphery:ignore - Unused, but added to detect new cases when updating the SDK. init(rustCallIntent: MatrixRustSDK.RtcCallIntent) { switch rustCallIntent { diff --git a/ElementX/Sources/Other/CollapsibleFlowLayout/CollapsibleReactionLayout.swift b/ElementX/Sources/Other/CollapsibleFlowLayout/CollapsibleReactionLayout.swift index e63dd1f05..f6cc1df6c 100644 --- a/ElementX/Sources/Other/CollapsibleFlowLayout/CollapsibleReactionLayout.swift +++ b/ElementX/Sources/Other/CollapsibleFlowLayout/CollapsibleReactionLayout.swift @@ -12,7 +12,7 @@ import SwiftUI /// on the same row (moving them both to a new row if necessary). /// Each subview should be marked with the appropriate `ReactionLayoutItem` using the `reactionLayoutItem` modified /// so the layout can appropriately treat each type of item. -struct CollapsibleReactionLayout: Layout { +nonisolated struct CollapsibleReactionLayout: Layout { static let pointOffscreen = CGPoint(x: -10000, y: -10000) /// The horizontal spacing between items var itemSpacing: CGFloat = 0 @@ -250,33 +250,33 @@ struct CollapsibleReactionLayout: Layout { } } -struct ReactionSubviews { +nonisolated struct ReactionSubviews { var reactions: [FlowLayoutSubview] var collapseButton: FlowLayoutSubview var addMoreButton: FlowLayoutSubview } /// A protocol representing subviews so that we can inject mocks in unit tests. -protocol FlowLayoutSubviews: RandomAccessCollection where Element: FlowLayoutSubview, Index == Int, SubSequence == Self { } +nonisolated protocol FlowLayoutSubviews: RandomAccessCollection where Element: FlowLayoutSubview, Index == Int, SubSequence == Self { } -extension LayoutSubviews: FlowLayoutSubviews { } +nonisolated extension LayoutSubviews: FlowLayoutSubviews { } /// A protocol representing a subview so that we can inject mocks in unit tests. -protocol FlowLayoutSubview { +nonisolated protocol FlowLayoutSubview { func sizeThatFits(_ proposal: ProposedViewSize) -> CGSize func place(at position: CGPoint, anchor: UnitPoint, proposal: ProposedViewSize) subscript(key: K.Type) -> K.Value where K: LayoutValueKey { get } } -extension LayoutSubview: FlowLayoutSubview { } +nonisolated extension LayoutSubview: FlowLayoutSubview { } -enum ReactionLayoutItem { +nonisolated enum ReactionLayoutItem { case reaction case expandCollapse case addMore } -struct ReactionLayoutItemType: LayoutValueKey { +nonisolated struct ReactionLayoutItemType: LayoutValueKey { static let defaultValue: ReactionLayoutItem = .reaction } diff --git a/ElementX/Sources/Other/CurrentValuePublisher.swift b/ElementX/Sources/Other/CurrentValuePublisher.swift index a210be078..b4cb6a4f5 100644 --- a/ElementX/Sources/Other/CurrentValuePublisher.swift +++ b/ElementX/Sources/Other/CurrentValuePublisher.swift @@ -12,7 +12,7 @@ import Combine /// The purpose of this type is to remove the possibility to send new values on the underlying subject. /// /// `CurrentValueSubject` is documented as thread-safe but is not formally `Sendable`, hence `@unchecked`. -struct CurrentValuePublisher: Publisher, @unchecked Sendable { +nonisolated struct CurrentValuePublisher: Publisher, @unchecked Sendable { private let subject: CurrentValueSubject init(_ subject: CurrentValueSubject) { @@ -32,7 +32,7 @@ struct CurrentValuePublisher: Publisher, @unchecked Send } } -extension CurrentValueSubject { +nonisolated extension CurrentValueSubject { func asCurrentValuePublisher() -> CurrentValuePublisher { .init(self) } diff --git a/ElementX/Sources/Other/EffectsScene/EffectsScene.swift b/ElementX/Sources/Other/EffectsScene/EffectsScene.swift index 2c7bc1333..f06cac9d1 100644 --- a/ElementX/Sources/Other/EffectsScene/EffectsScene.swift +++ b/ElementX/Sources/Other/EffectsScene/EffectsScene.swift @@ -9,7 +9,7 @@ import SceneKit import SwiftUI -class EffectsScene: SCNScene { +nonisolated class EffectsScene: SCNScene { static let colors: [Color] = [ .blue, .red, @@ -54,7 +54,7 @@ class EffectsScene: SCNScene { } } -private extension Color { +private nonisolated extension Color { /// The color's components as an array of floats in the extended linear sRGB colorspace. /// /// SceneKit works in a colorspace with a linear gamma, which is why this conversion is necessary. diff --git a/ElementX/Sources/Other/Extensions/AVMetadataMachineReadableCodeObject.swift b/ElementX/Sources/Other/Extensions/AVMetadataMachineReadableCodeObject.swift index 4e199dcad..7505da132 100644 --- a/ElementX/Sources/Other/Extensions/AVMetadataMachineReadableCodeObject.swift +++ b/ElementX/Sources/Other/Extensions/AVMetadataMachineReadableCodeObject.swift @@ -11,13 +11,13 @@ import AVKit import Foundation -enum AVMetadataBinaryValueError: Error { +nonisolated enum AVMetadataBinaryValueError: Error { case unhandledQRSegmentMode(UInt8) case bitError(BitError) case unknown(Error) } -extension AVMetadataMachineReadableCodeObject { +nonisolated extension AVMetadataMachineReadableCodeObject { var qrBinaryValue: Data? { get throws(AVMetadataBinaryValueError) { guard type == .qr else { return nil } @@ -66,11 +66,11 @@ enum BitError: Error { case unhandledAlphanumericCharacter(UInt8) } -private struct Bit { +private nonisolated struct Bit { let value: UInt8 } -private extension [Bit] { +private nonisolated extension [Bit] { mutating func takeBits(_ count: Int) throws(BitError) -> UInt8 { guard count <= 8 else { throw .moreThan8BitsTaken } @@ -163,7 +163,7 @@ private extension [Bit] { } } -private extension Data { +private nonisolated extension Data { func bits() -> [Bit] { var result = [Bit]() forEach { (byte: UInt8) in @@ -173,7 +173,7 @@ private extension Data { } } -private extension UInt8 { +private nonisolated extension UInt8 { func bits() -> [Bit] { var bits: [Bit] = [] for i in 0..<8 { diff --git a/ElementX/Sources/Other/Extensions/Array.swift b/ElementX/Sources/Other/Extensions/Array.swift index 716a1a777..ba2996842 100644 --- a/ElementX/Sources/Other/Extensions/Array.swift +++ b/ElementX/Sources/Other/Extensions/Array.swift @@ -8,7 +8,7 @@ import Foundation -extension Array { +nonisolated extension Array { func groupBy(_ isGroupable: (Element) -> Bool) -> [[Element]] { var newItems = [[Element]]() @@ -60,7 +60,7 @@ extension Array { } } -extension Array where Element == RoomTimelineItemProtocol { +nonisolated extension Array where Element == RoomTimelineItemProtocol { func firstUsingStableID(_ id: TimelineItemIdentifier) -> Element? { first { $0.id.uniqueID == id.uniqueID } } diff --git a/ElementX/Sources/Other/Extensions/AsyncSequence.swift b/ElementX/Sources/Other/Extensions/AsyncSequence.swift index 68a9cf51a..011a1eae8 100644 --- a/ElementX/Sources/Other/Extensions/AsyncSequence.swift +++ b/ElementX/Sources/Other/Extensions/AsyncSequence.swift @@ -6,8 +6,9 @@ // Please see LICENSE files in the repository root for full details. // -extension AsyncSequence { +nonisolated extension AsyncSequence { func first() async rethrows -> Self.Element? { - try await first { _ in true } + var iterator = makeAsyncIterator() + return try await iterator.next(isolation: #isolation) } } diff --git a/ElementX/Sources/Other/Extensions/AttributedString.swift b/ElementX/Sources/Other/Extensions/AttributedString.swift index 508123ec3..8e5c89d91 100644 --- a/ElementX/Sources/Other/Extensions/AttributedString.swift +++ b/ElementX/Sources/Other/Extensions/AttributedString.swift @@ -8,7 +8,7 @@ import Foundation -extension AttributedString { +nonisolated extension AttributedString { /// faster than doing `String(characters)`: https://forums.swift.org/t/attributedstring-to-string/61667 var string: String { String(characters[...]) diff --git a/ElementX/Sources/Other/Extensions/Bundle.swift b/ElementX/Sources/Other/Extensions/Bundle.swift index c74a16998..0c2328360 100644 --- a/ElementX/Sources/Other/Extensions/Bundle.swift +++ b/ElementX/Sources/Other/Extensions/Bundle.swift @@ -9,7 +9,7 @@ import Foundation import Synchronization -public extension Bundle { +public nonisolated extension Bundle { /// The top-level bundle that contains the entire app. static var app: Bundle { var bundle = Bundle.main diff --git a/ElementX/Sources/Other/Extensions/CharacterSet.swift b/ElementX/Sources/Other/Extensions/CharacterSet.swift index 516997b23..e60eb7547 100644 --- a/ElementX/Sources/Other/Extensions/CharacterSet.swift +++ b/ElementX/Sources/Other/Extensions/CharacterSet.swift @@ -8,7 +8,7 @@ import Foundation -extension CharacterSet { +nonisolated extension CharacterSet { private static let urlAllowedSets: [CharacterSet] = [ .urlUserAllowed, .urlPasswordAllowed, diff --git a/ElementX/Sources/Other/Extensions/ClientBuilder.swift b/ElementX/Sources/Other/Extensions/ClientBuilder.swift index 6710a444e..1d3315c01 100644 --- a/ElementX/Sources/Other/Extensions/ClientBuilder.swift +++ b/ElementX/Sources/Other/Extensions/ClientBuilder.swift @@ -9,7 +9,7 @@ import Foundation import MatrixRustSDK -extension ClientBuilder { +nonisolated extension ClientBuilder { /// A helper method that applies the common builder modifiers needed for the app. static func baseBuilder(setupEncryption: Bool = true, httpProxy: String? = nil, diff --git a/ElementX/Sources/Other/Extensions/Collection.swift b/ElementX/Sources/Other/Extensions/Collection.swift index cf0241bff..88f0cd2b6 100644 --- a/ElementX/Sources/Other/Extensions/Collection.swift +++ b/ElementX/Sources/Other/Extensions/Collection.swift @@ -8,7 +8,7 @@ import Foundation -extension Collection { +nonisolated extension Collection { /// Returns the element at the specified index if it is within bounds, otherwise nil. subscript(safe index: Index) -> Element? { indices.contains(index) ? self[index] : nil diff --git a/ElementX/Sources/Other/Extensions/Date.swift b/ElementX/Sources/Other/Extensions/Date.swift index 414169225..7f6b2c7c1 100644 --- a/ElementX/Sources/Other/Extensions/Date.swift +++ b/ElementX/Sources/Other/Extensions/Date.swift @@ -10,7 +10,7 @@ import Foundation extension Date { /// The date formatted with the minimal necessary units given how long ago it occurred. - func formattedMinimal() -> String { + nonisolated func formattedMinimal() -> String { let calendar = Calendar.current if calendar.isDateInToday(self) { @@ -35,7 +35,7 @@ extension Date { } /// The date of an expiration formatted with the minimal necessary units given how long in the future it is. - func formattedExpiration() -> String { + nonisolated func formattedExpiration() -> String { let calendar = Calendar.current let now = Date.now @@ -75,12 +75,12 @@ extension Date { } /// The date formatted as just the time, for use in timeline items specifically. - func formattedTime() -> String { + nonisolated func formattedTime() -> String { formatted(date: .omitted, time: .shortened) } /// A fixed date used for mocks, previews etc. - static var mock: Date { + nonisolated static var mock: Date { DateComponents(calendar: .current, year: 2007, month: 1, day: 9, hour: 9, minute: 41).date ?? .now } } diff --git a/ElementX/Sources/Other/Extensions/Dictionary.swift b/ElementX/Sources/Other/Extensions/Dictionary.swift index 5c5c97d75..a76776713 100644 --- a/ElementX/Sources/Other/Extensions/Dictionary.swift +++ b/ElementX/Sources/Other/Extensions/Dictionary.swift @@ -8,7 +8,7 @@ import Foundation -extension Dictionary { +nonisolated extension Dictionary { var jsonString: String? { guard let data = try? JSONSerialization.data(withJSONObject: self, options: [.fragmentsAllowed, .sortedKeys]) else { diff --git a/ElementX/Sources/Other/Extensions/FileManager.swift b/ElementX/Sources/Other/Extensions/FileManager.swift index 221024dbf..9fea748bb 100644 --- a/ElementX/Sources/Other/Extensions/FileManager.swift +++ b/ElementX/Sources/Other/Extensions/FileManager.swift @@ -12,7 +12,7 @@ enum FileManagerError: Error { case invalidFileSize } -extension FileManager { +nonisolated extension FileManager { func directoryExists(at url: URL) -> Bool { var isDirectory: ObjCBool = false guard fileExists(atPath: url.path(percentEncoded: false), isDirectory: &isDirectory) else { diff --git a/ElementX/Sources/Other/Extensions/HTMLParserStyle.swift b/ElementX/Sources/Other/Extensions/HTMLParserStyle.swift index 019bc1f7d..16a5b7e58 100644 --- a/ElementX/Sources/Other/Extensions/HTMLParserStyle.swift +++ b/ElementX/Sources/Other/Extensions/HTMLParserStyle.swift @@ -10,7 +10,6 @@ import Compound import HTMLParser import SwiftUI -@MainActor extension HTMLParserStyle { static let elementX = HTMLParserStyle(textColor: UIColor.label, linkColor: UIColor.link, diff --git a/ElementX/Sources/Other/Extensions/ImageCache.swift b/ElementX/Sources/Other/Extensions/ImageCache.swift index b481c24ce..cf21c4796 100644 --- a/ElementX/Sources/Other/Extensions/ImageCache.swift +++ b/ElementX/Sources/Other/Extensions/ImageCache.swift @@ -9,7 +9,7 @@ import Foundation import Kingfisher -extension ImageCache { +nonisolated extension ImageCache { static var onlyInMemory: ImageCache { let result = ImageCache.default result.memoryStorage.config.keepWhenEnteringBackground = true diff --git a/ElementX/Sources/Other/Extensions/NSRegularExpresion.swift b/ElementX/Sources/Other/Extensions/NSRegularExpresion.swift index f7f0650c2..127478bdb 100644 --- a/ElementX/Sources/Other/Extensions/NSRegularExpresion.swift +++ b/ElementX/Sources/Other/Extensions/NSRegularExpresion.swift @@ -9,7 +9,7 @@ import Foundation /// NSRegularExpressions work internally on NSStrings, we need to be careful how we build the ranges for extended grapheme clusters https://stackoverflow.com/a/27880748/730924 -extension NSRegularExpression { +nonisolated extension NSRegularExpression { func matches(in string: String, options: NSRegularExpression.MatchingOptions = []) -> [NSTextCheckingResult] { matches(in: string, options: options, range: .init(location: 0, length: (string as NSString).length)) } diff --git a/ElementX/Sources/Other/Extensions/Observable.swift b/ElementX/Sources/Other/Extensions/Observable.swift index 5be2dea44..1f559fb89 100644 --- a/ElementX/Sources/Other/Extensions/Observable.swift +++ b/ElementX/Sources/Other/Extensions/Observable.swift @@ -14,26 +14,34 @@ extension Observable { /// https://github.com/swiftlang/swift-evolution/blob/main/proposals/0475-observed.md /// /// - Parameter property: The key path to the property you would like to observe. - func observe(_ property: KeyPath) -> AsyncStream { - AsyncStream { continuation in - let isActive = Mutex(true) - - @Sendable func observe() { + @MainActor func observe(_ property: KeyPath) -> AsyncStream { + let (stream, continuation) = AsyncStream.makeStream() + let (changeSignals, changeSignaller) = AsyncStream.makeStream() + + // Read and yield the initial value synchronously at subscription time, + // otherwise observers miss changes made right after creating the stream. + let initialValue = withObservationTracking { + self[keyPath: property] + } onChange: { + changeSignaller.yield() + } + continuation.yield(initialValue) + + let task = Task { @MainActor in + // The signal is sent on willSet, but as this task runs on the next main + // executor job the new value will have been set by the time we read it. + for await _ in changeSignals { let value = withObservationTracking { self[keyPath: property] } onChange: { - // Handle the update on the next run loop as this is willSet not didSet. - DispatchQueue.main.async { - guard isActive.withLock({ $0 }) else { return } - observe() - } + changeSignaller.yield() } continuation.yield(value) } - - continuation.onTermination = { _ in isActive.withLock { $0 = false } } - - observe() } + + continuation.onTermination = { _ in task.cancel() } + + return stream } } diff --git a/ElementX/Sources/Other/Extensions/ProcessInfo.swift b/ElementX/Sources/Other/Extensions/ProcessInfo.swift index f566e9de4..c8341e69a 100644 --- a/ElementX/Sources/Other/Extensions/ProcessInfo.swift +++ b/ElementX/Sources/Other/Extensions/ProcessInfo.swift @@ -8,7 +8,7 @@ import Foundation -extension ProcessInfo { +nonisolated extension ProcessInfo { /// Flag indicating whether the app is running the unit tests. static var isRunningUnitTests: Bool { #if DEBUG diff --git a/ElementX/Sources/Other/Extensions/ProposedViewSize.swift b/ElementX/Sources/Other/Extensions/ProposedViewSize.swift index aec002cf5..e26efa8b2 100644 --- a/ElementX/Sources/Other/Extensions/ProposedViewSize.swift +++ b/ElementX/Sources/Other/Extensions/ProposedViewSize.swift @@ -8,7 +8,7 @@ import SwiftUI -extension ProposedViewSize: @retroactive Hashable { +nonisolated extension ProposedViewSize: @retroactive Hashable { public func hash(into hasher: inout Hasher) { hasher.combine(width) hasher.combine(height) diff --git a/ElementX/Sources/Other/Extensions/Publisher.swift b/ElementX/Sources/Other/Extensions/Publisher.swift index 560f1454e..218f9b350 100644 --- a/ElementX/Sources/Other/Extensions/Publisher.swift +++ b/ElementX/Sources/Other/Extensions/Publisher.swift @@ -46,8 +46,8 @@ extension Published.Publisher { var iterator = values.makeAsyncIterator() // skips the publisher's current value - _ = await iterator.next() - return await iterator.next() + _ = await iterator.next(isolation: #isolation) + return await iterator.next(isolation: #isolation) } } } diff --git a/ElementX/Sources/Other/Extensions/String.swift b/ElementX/Sources/Other/Extensions/String.swift index 0f1badb03..76515e8bf 100644 --- a/ElementX/Sources/Other/Extensions/String.swift +++ b/ElementX/Sources/Other/Extensions/String.swift @@ -9,7 +9,7 @@ import SwiftUI import UniformTypeIdentifiers -extension String { +nonisolated extension String { /// Returns the string as an `AttributedString` with the specified character tinted in a different color. /// - Parameters: /// - character: The character to be tinted. @@ -41,7 +41,7 @@ extension String { } } -extension String { +nonisolated extension String { func ellipsize(length: Int) -> String { guard count > length else { return self @@ -50,7 +50,7 @@ extension String { } } -extension String { +nonisolated extension String { func replacingHtmlBreaksOccurrences() -> String { var result = self let pattern = #"

(\n+)

"# @@ -74,14 +74,14 @@ extension String { } } -extension String { +nonisolated extension String { /// detects if the string is empty or contains only whitespaces and newlines var isBlank: Bool { trimmingCharacters(in: .whitespacesAndNewlines).isEmpty } } -extension String { +nonisolated extension String { static func makeCanonicalAlias(aliasLocalPart: Self?, serverName: Self?) -> Self? { guard let aliasLocalPart, !aliasLocalPart.isEmpty, let serverName, !serverName.isEmpty else { @@ -91,7 +91,7 @@ extension String { } } -extension String { +nonisolated extension String { var validatedFileExtension: String { let fileExtension = (self as NSString).pathExtension guard !fileExtension.isEmpty else { @@ -101,7 +101,7 @@ extension String { } } -extension String { +nonisolated extension String { /// Whether the first character with a strong BiDi direction is right-to-left. /// Mirrors the Unicode BiDi "first strong" rule used by TextKit to resolve /// paragraph direction when `baseWritingDirection` is `.natural`. @@ -120,7 +120,7 @@ extension String { } } -extension String { +nonisolated extension String { /// To be used if the string is actually a URL var asSanitizedLink: String { var link = self diff --git a/ElementX/Sources/Other/Extensions/UNNotificationContent.swift b/ElementX/Sources/Other/Extensions/UNNotificationContent.swift index 86779b772..fbeb407fc 100644 --- a/ElementX/Sources/Other/Extensions/UNNotificationContent.swift +++ b/ElementX/Sources/Other/Extensions/UNNotificationContent.swift @@ -9,7 +9,7 @@ import Foundation import UserNotifications -extension UNNotificationContent { +nonisolated extension UNNotificationContent { @objc var receiverID: String? { userInfo[NotificationConstants.UserInfoKey.receiverIdentifier] as? String } @@ -35,7 +35,7 @@ extension UNNotificationContent { } } -extension UNMutableNotificationContent { +nonisolated extension UNMutableNotificationContent { override var receiverID: String? { get { userInfo[NotificationConstants.UserInfoKey.receiverIdentifier] as? String diff --git a/ElementX/Sources/Other/Extensions/URL.swift b/ElementX/Sources/Other/Extensions/URL.swift index 9f69abc25..fbce0b8ae 100644 --- a/ElementX/Sources/Other/Extensions/URL.swift +++ b/ElementX/Sources/Other/Extensions/URL.swift @@ -10,7 +10,7 @@ import Foundation // MARK: - Custom URLs -extension URL { +nonisolated extension URL { /// The URL of the primary app group container. static var appGroupContainerDirectory: URL { guard let url = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: InfoPlistReader.main.appGroupIdentifier) else { @@ -135,34 +135,34 @@ extension URL { // MARK: Mocks - static var mockMXCAudio: URL { + nonisolated static var mockMXCAudio: URL { "mxc://matrix.org/1234567890AuDiO" } - static var mockMXCFile: URL { + nonisolated static var mockMXCFile: URL { "mxc://matrix.org/1234567890FiLe" } - static var mockMXCImage: URL { + nonisolated static var mockMXCImage: URL { "mxc://matrix.org/1234567890ImAgE" } - static var mockMXCVideo: URL { + nonisolated static var mockMXCVideo: URL { "mxc://matrix.org/1234567890ViDeO" } - static var mockMXCAvatar: URL { + nonisolated static var mockMXCAvatar: URL { "mxc://matrix.org/1234567890AvAtAr" } - static var mockMXCUserAvatar: URL { + nonisolated static var mockMXCUserAvatar: URL { "mxc://matrix.org/1234567890AvAtArUsEr" } } // MARK: - Helpers -extension URL: @retroactive ExpressibleByStringLiteral { +nonisolated extension URL: @retroactive ExpressibleByStringLiteral { public init(stringLiteral value: StaticString) { guard let url = URL(string: "\(value)") else { fatalError("The static string used to create this URL is invalid") @@ -177,7 +177,7 @@ extension URL: @retroactive ExpressibleByStringLiteral { } } -extension String { +nonisolated extension String { /// Assumes that the string is a URL and sanitises it for use as the name of a directory. func asURLDirectoryName() -> String { replacingOccurrences(of: "https://", with: "") @@ -188,7 +188,7 @@ extension String { // MARK: - Phishing Confirmation URL -extension URL { +nonisolated extension URL { static let confirmationScheme = "confirm" var requiresConfirmation: Bool { @@ -204,7 +204,7 @@ extension URL { } } -struct ConfirmURLParameters { +nonisolated struct ConfirmURLParameters { static let internalURLKey = "internalURL" static let displayStringKey = "displayString" @@ -217,7 +217,7 @@ struct ConfirmURLParameters { } } -extension ConfirmURLParameters { +nonisolated extension ConfirmURLParameters { init?(queryItems: [URLQueryItem]) { guard let internalURLString = queryItems.first(where: { $0.name == Self.internalURLKey })?.value, let internalURL = URL(string: internalURLString), diff --git a/ElementX/Sources/Other/Extensions/URLSession.swift b/ElementX/Sources/Other/Extensions/URLSession.swift index f9171c654..e8c526b98 100644 --- a/ElementX/Sources/Other/Extensions/URLSession.swift +++ b/ElementX/Sources/Other/Extensions/URLSession.swift @@ -8,7 +8,7 @@ import Foundation -extension URLSession { +nonisolated extension URLSession { /// The same as `data(for:delegate:)` but with an additional immediate retry if the first attempt fails. func dataWithRetry(for request: URLRequest, delegate: URLSessionTaskDelegate? = nil) async throws -> (Data, URLResponse) { if let firstTryResult = try? await data(for: request, delegate: delegate) { diff --git a/ElementX/Sources/Other/Extensions/UTType.swift b/ElementX/Sources/Other/Extensions/UTType.swift index d053ba88b..22712d567 100644 --- a/ElementX/Sources/Other/Extensions/UTType.swift +++ b/ElementX/Sources/Other/Extensions/UTType.swift @@ -8,7 +8,7 @@ import UniformTypeIdentifiers -extension UTType { +nonisolated extension UTType { /// Creates a type based on an optional mime type, falling back to a filename when this type is missing or unknown. init?(mimeType: String?, fallbackFilename: String) { guard let mimeType, let type = UTType(mimeType: mimeType) else { diff --git a/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilder.swift b/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilder.swift index c7d37ba90..99d5a836f 100644 --- a/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilder.swift +++ b/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilder.swift @@ -13,7 +13,7 @@ import SwiftSoup import Synchronization import UIKit -protocol MentionBuilderProtocol { +nonisolated protocol MentionBuilderProtocol: Sendable { func handleUserMention(for attributedString: NSMutableAttributedString, in range: NSRange, url: URL, userID: String, userDisplayName: String?) func handleRoomIDMention(for attributedString: NSMutableAttributedString, in range: NSRange, url: URL, roomID: String) func handleRoomAliasMention(for attributedString: NSMutableAttributedString, in range: NSRange, url: URL, roomAlias: String, roomDisplayName: String?) @@ -22,7 +22,7 @@ protocol MentionBuilderProtocol { func handleAllUsersMention(for attributedString: NSMutableAttributedString, in range: NSRange) } -extension NSAttributedString.Key { +nonisolated extension NSAttributedString.Key { static let MatrixBlockquote: NSAttributedString.Key = .init(rawValue: BlockquoteAttribute.name) static let MatrixUserID: NSAttributedString.Key = .init(rawValue: UserIDAttribute.name) static let MatrixUserDisplayName: NSAttributedString.Key = .init(rawValue: UserDisplayNameAttribute.name) @@ -36,7 +36,7 @@ extension NSAttributedString.Key { static let InlineCode: NSAttributedString.Key = .init(rawValue: InlineCodeAttribute.name) } -struct AttributedStringBuilder: AttributedStringBuilderProtocol { +nonisolated struct AttributedStringBuilder: AttributedStringBuilderProtocol { private static let defaultKey = "default" private let cacheKey: String @@ -468,7 +468,7 @@ struct AttributedStringBuilder: AttributedStringBuilderProtocol { } } -private struct TextParsingMatch { +private nonisolated struct TextParsingMatch { enum MatchType { case userID(identifier: String) case roomAlias(alias: String) @@ -492,7 +492,7 @@ private struct TextParsingMatch { } } -private extension NSMutableAttributedString { +private nonisolated extension NSMutableAttributedString { func setFontPreservingSymbolicTraits(_ newFont: UIFont) { enumerateAttribute(.font, in: NSRange(location: 0, length: length)) { value, range, _ in if let oldFont = value as? UIFont { @@ -512,7 +512,7 @@ private extension NSMutableAttributedString { } } -private extension NSString { +private nonisolated extension NSString { func hasSuffixCharacter(from characterSet: CharacterSet) -> Bool { if length == 0 { return false diff --git a/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderProtocol.swift b/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderProtocol.swift index 8b3e996f7..0e415ebad 100644 --- a/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderProtocol.swift +++ b/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderProtocol.swift @@ -8,7 +8,7 @@ import Foundation -struct AttributedStringBuilderComponent: Hashable, Identifiable { +nonisolated struct AttributedStringBuilderComponent: Hashable, Identifiable { enum ComponentType { case plainText case blockquote @@ -21,7 +21,7 @@ struct AttributedStringBuilderComponent: Hashable, Identifiable { let type: ComponentType } -protocol AttributedStringBuilderProtocol { +nonisolated protocol AttributedStringBuilderProtocol: Sendable { func fromPlain(_ string: String?) -> AttributedString? func fromHTML(_ htmlString: String?) -> AttributedString? diff --git a/ElementX/Sources/Other/HTMLParsing/ElementXAttributeScope.swift b/ElementX/Sources/Other/HTMLParsing/ElementXAttributeScope.swift index 40e020a22..8719c3648 100644 --- a/ElementX/Sources/Other/HTMLParsing/ElementXAttributeScope.swift +++ b/ElementX/Sources/Other/HTMLParsing/ElementXAttributeScope.swift @@ -74,7 +74,7 @@ enum InlineCodeAttribute: AttributedStringKey { } // periphery: ignore - required to make NSAttributedString to AttributedString conversion even if not used directly -extension AttributeScopes { +nonisolated extension AttributeScopes { struct ElementXAttributes: AttributeScope { let blockquote: BlockquoteAttribute @@ -101,7 +101,7 @@ extension AttributeScopes { } // periphery: ignore - required to make NSAttributedString to AttributedString conversion even if not used directly -extension AttributeDynamicLookup { +nonisolated extension AttributeDynamicLookup { subscript(dynamicMember keyPath: KeyPath) -> T { self[T.self] } diff --git a/ElementX/Sources/Other/HTMLParsing/HTMLFixtures.swift b/ElementX/Sources/Other/HTMLParsing/HTMLFixtures.swift index e107556d3..3afeb7bf2 100644 --- a/ElementX/Sources/Other/HTMLParsing/HTMLFixtures.swift +++ b/ElementX/Sources/Other/HTMLParsing/HTMLFixtures.swift @@ -6,7 +6,7 @@ // Please see LICENSE files in the repository root for full details. // -enum HTMLFixtures: String, CaseIterable { +nonisolated enum HTMLFixtures: String, CaseIterable { case plainText case headers case paragraphs diff --git a/ElementX/Sources/Other/HTMLParsing/PhishingDetector.swift b/ElementX/Sources/Other/HTMLParsing/PhishingDetector.swift index 165573665..7c8ef5db6 100644 --- a/ElementX/Sources/Other/HTMLParsing/PhishingDetector.swift +++ b/ElementX/Sources/Other/HTMLParsing/PhishingDetector.swift @@ -9,7 +9,7 @@ import Foundation import MatrixRustSDK -enum PhishingDetector { +nonisolated enum PhishingDetector { static func isPhishingAttempt(displayString: String, internalURL: URL) -> Bool { // Some phishing attempts can be hidden by using the unicode character "﹒" instead of "." let disambiguatedDisplayString = displayString.replacingOccurrences(of: "﹒", with: ".") diff --git a/ElementX/Sources/Other/InfoPlistReader.swift b/ElementX/Sources/Other/InfoPlistReader.swift index b2f75d00a..e11d5041e 100644 --- a/ElementX/Sources/Other/InfoPlistReader.swift +++ b/ElementX/Sources/Other/InfoPlistReader.swift @@ -8,7 +8,7 @@ import Foundation -struct InfoPlistReader { +nonisolated struct InfoPlistReader { private enum Keys { static let appGroupIdentifier = "appGroupIdentifier" static let baseBundleIdentifier = "baseBundleIdentifier" diff --git a/ElementX/Sources/Other/Logging/ExtensionLogger.swift b/ElementX/Sources/Other/Logging/ExtensionLogger.swift index f7707eb10..5d918900f 100644 --- a/ElementX/Sources/Other/Logging/ExtensionLogger.swift +++ b/ElementX/Sources/Other/Logging/ExtensionLogger.swift @@ -9,7 +9,7 @@ import Foundation import MatrixRustSDK -enum ExtensionLogger { +nonisolated enum ExtensionLogger { /// Memory formatter, uses exact 2 fraction digits and no grouping private static var numberFormatter: NumberFormatter { let formatter = NumberFormatter() diff --git a/ElementX/Sources/Other/Logging/LogLevel.swift b/ElementX/Sources/Other/Logging/LogLevel.swift index d5c5e4b0b..b13a6e881 100644 --- a/ElementX/Sources/Other/Logging/LogLevel.swift +++ b/ElementX/Sources/Other/Logging/LogLevel.swift @@ -9,7 +9,7 @@ import Foundation import MatrixRustSDK -enum LogLevel: String, Codable, Hashable { +nonisolated enum LogLevel: String, Codable, Hashable { case error, warn, info, debug, trace var title: String { diff --git a/ElementX/Sources/Other/Logging/MXLog.swift b/ElementX/Sources/Other/Logging/MXLog.swift index 69b1e63ab..05a94eb97 100644 --- a/ElementX/Sources/Other/Logging/MXLog.swift +++ b/ElementX/Sources/Other/Logging/MXLog.swift @@ -12,7 +12,7 @@ import MatrixRustSDK /// Logging utility that provies multiple logging levels as well as file output and rolling. /// Its purpose is to provide a common entry for customizing logging and should be used throughout the code. -enum MXLog { +nonisolated enum MXLog { private nonisolated(unsafe) static var rootSpan: Span! private nonisolated(unsafe) static var currentTarget: String! diff --git a/ElementX/Sources/Other/Logging/TraceLogPack.swift b/ElementX/Sources/Other/Logging/TraceLogPack.swift index 3709ce4b8..54453409d 100644 --- a/ElementX/Sources/Other/Logging/TraceLogPack.swift +++ b/ElementX/Sources/Other/Logging/TraceLogPack.swift @@ -9,7 +9,7 @@ import Foundation import MatrixRustSDK -enum TraceLogPack: Codable, CaseIterable { +nonisolated enum TraceLogPack: Codable, CaseIterable { case eventCache, sendQueue, timeline, notificationClient, syncProfiling, latestEvents var title: String { @@ -24,7 +24,7 @@ enum TraceLogPack: Codable, CaseIterable { } } -extension TraceLogPack { +nonisolated extension TraceLogPack { // periphery:ignore - Unused, but added to detect new cases when updating the SDK. init(rustLogPack: MatrixRustSDK.TraceLogPacks) { switch rustLogPack { diff --git a/ElementX/Sources/Other/Logging/Tracing.swift b/ElementX/Sources/Other/Logging/Tracing.swift index ffd6796c1..0c5ddd1c8 100644 --- a/ElementX/Sources/Other/Logging/Tracing.swift +++ b/ElementX/Sources/Other/Logging/Tracing.swift @@ -9,7 +9,7 @@ import Foundation import MatrixRustSDK -enum Tracing { +nonisolated enum Tracing { /// The directory that stores all of the log files. static var logsDirectory: URL { if ProcessInfo.isRunningIntegrationTests { diff --git a/ElementX/Sources/Other/MapLibre/MapLibreMapView.swift b/ElementX/Sources/Other/MapLibre/MapLibreMapView.swift index e2dfefbe9..b1b2d1015 100644 --- a/ElementX/Sources/Other/MapLibre/MapLibreMapView.swift +++ b/ElementX/Sources/Other/MapLibre/MapLibreMapView.swift @@ -233,7 +233,10 @@ extension MapLibreMapView { // Mirror every animated coordinate update to keep the camera as smooth as the marker. followedAnnotationObservation = annotation.observe(\.coordinate) { [weak mapView] annotation, _ in - mapView?.setCenter(annotation.coordinate, animated: false) + // The coordinate is only ever updated by SwiftUI so KVO fires on the main actor. + MainActor.assumeIsolated { + mapView?.setCenter(annotation.coordinate, animated: false) + } } } } @@ -303,7 +306,7 @@ extension MapLibreMapView { // is an option set and gestures can come combined with other reasons, so check for // containment instead of an exact match. let centerChangingGestures: MLNCameraChangeReason = [.gesturePan, .gesturePinch, .gestureRotate] - if !reason.intersection(centerChangingGestures).isEmpty { + if !reason.isDisjoint(with: centerChangingGestures) { // Stop following immediately, the camera would fight the gesture otherwise. stopFollowingMarker() mapLibreView.userDidPan?() diff --git a/ElementX/Sources/Other/MatrixEntityRegex.swift b/ElementX/Sources/Other/MatrixEntityRegex.swift index b592a5b1e..dc04e6e0e 100644 --- a/ElementX/Sources/Other/MatrixEntityRegex.swift +++ b/ElementX/Sources/Other/MatrixEntityRegex.swift @@ -9,7 +9,7 @@ import Foundation /// https://spec.matrix.org/latest/appendices/#identifier-grammar -enum MatrixEntityRegex: String { +nonisolated enum MatrixEntityRegex: String { case homeserver case userID case roomAlias diff --git a/ElementX/Sources/Other/Pagination.swift b/ElementX/Sources/Other/Pagination.swift index d8ef2e20e..70025d474 100644 --- a/ElementX/Sources/Other/Pagination.swift +++ b/ElementX/Sources/Other/Pagination.swift @@ -11,7 +11,7 @@ enum PaginationDirection: String { case backwards, forwards } -enum PaginationState { +nonisolated enum PaginationState { case idle case endReached case paginating diff --git a/ElementX/Sources/Other/Pills/MentionBuilder.swift b/ElementX/Sources/Other/Pills/MentionBuilder.swift index 83f841744..b941c0532 100644 --- a/ElementX/Sources/Other/Pills/MentionBuilder.swift +++ b/ElementX/Sources/Other/Pills/MentionBuilder.swift @@ -9,7 +9,7 @@ import Foundation import UIKit -struct MentionBuilder: MentionBuilderProtocol { +nonisolated struct MentionBuilder: MentionBuilderProtocol { struct AttributesToRestore { let font: UIFont let blockquote: Bool? @@ -173,7 +173,7 @@ struct MentionBuilder: MentionBuilderProtocol { } } -private extension Dictionary where Key == NSAttributedString.Key, Value == Any { +private nonisolated extension Dictionary where Key == NSAttributedString.Key, Value == Any { mutating func addBlockquoteIfNeeded(_ value: Bool?) { if let value { self[.MatrixBlockquote] = value diff --git a/ElementX/Sources/Other/Pills/MessageText.swift b/ElementX/Sources/Other/Pills/MessageText.swift index 6a3422cd9..910cf4875 100644 --- a/ElementX/Sources/Other/Pills/MessageText.swift +++ b/ElementX/Sources/Other/Pills/MessageText.swift @@ -59,7 +59,7 @@ final class MessageTextView: UITextView, PillAttachmentViewProviderDelegate, UIG /// as an invisible spacer so a message bubble's text reserves room for the overlaid /// timestamp. Without this subclass, an attachment with no image would render TextKit's /// default "missing image" glyph. -private final class TransparentTextAttachment: NSTextAttachment { +private final nonisolated class TransparentTextAttachment: NSTextAttachment { override func image(forBounds imageBounds: CGRect, textContainer: NSTextContainer?, characterIndex charIndex: Int) -> UIImage? { diff --git a/ElementX/Sources/Other/Pills/PillAttachmentViewProvider.swift b/ElementX/Sources/Other/Pills/PillAttachmentViewProvider.swift index 62a29558a..b8038b4c6 100644 --- a/ElementX/Sources/Other/Pills/PillAttachmentViewProvider.swift +++ b/ElementX/Sources/Other/Pills/PillAttachmentViewProvider.swift @@ -23,44 +23,53 @@ final class PillAttachmentViewProvider: NSTextAttachmentViewProvider, NSSecureCo // MARK: - Override - override init(textAttachment: NSTextAttachment, parentView: UIView?, textLayoutManager: NSTextLayoutManager?, location: NSTextLocation) { + override nonisolated init(textAttachment: NSTextAttachment, parentView: UIView?, textLayoutManager: NSTextLayoutManager?, location: NSTextLocation) { super.init(textAttachment: textAttachment, parentView: parentView, textLayoutManager: textLayoutManager, location: location) - // Keep a reference to the parent text view for size adjustments and pills flushing. - delegate = parentView?.superview as? PillAttachmentViewProviderDelegate + // TextKit isn't annotated but creates the view providers on the main thread, + // the assumeIsolated below would trap otherwise. + nonisolated(unsafe) let provider = self + MainActor.assumeIsolated { + // Keep a reference to the parent text view for size adjustments and pills flushing. + provider.delegate = parentView?.superview as? PillAttachmentViewProviderDelegate + } tracksTextAttachmentViewBounds = true } - @MainActor - override func loadView() { + override nonisolated func loadView() { super.loadView() - guard let textAttachment = textAttachment as? PillTextAttachment, - let pillData = textAttachment.pillData else { - MXLog.failure("Attachment is missing data or not of expected class") - return + // TextKit isn't annotated but loads the view on the main thread, + // the assumeIsolated below would trap otherwise. + nonisolated(unsafe) let provider = self + MainActor.assumeIsolated { + guard let textAttachment = provider.textAttachment as? PillTextAttachment, + let pillData = textAttachment.pillData else { + MXLog.failure("Attachment is missing data or not of expected class") + return + } + + let context: PillContext + if ProcessInfo.isXcodePreview || ProcessInfo.isRunningTests { + // The mock viewModel simulates the loading logic for testing purposes + context = PillContext.mock(viewState: .mention(isOwnMention: false, displayText: "Alice"), delay: .seconds(2)) + } else if let timelineContext = provider.delegate?.timelineContext { + context = PillContext(timelineContext: timelineContext, data: pillData) + } else { + MXLog.failure("Missing room context") + return + } + + let view = PillView(context: context) { [weak provider] in + provider?.delegate?.invalidateTextAttachmentsDisplay() + } + let controller = UIHostingController(rootView: view) + controller.view.backgroundColor = .clear + // This allows the text view to handle it as a link + controller.view.isUserInteractionEnabled = false + provider.view = controller.view + provider.delegate?.registerPillView(controller.view) } - - let context: PillContext - if ProcessInfo.isXcodePreview || ProcessInfo.isRunningTests { - // The mock viewModel simulates the loading logic for testing purposes - context = PillContext.mock(viewState: .mention(isOwnMention: false, displayText: "Alice"), delay: .seconds(2)) - } else if let timelineContext = delegate?.timelineContext { - context = PillContext(timelineContext: timelineContext, data: pillData) - } else { - MXLog.failure("Missing room context") - return - } - - let view = PillView(context: context) { [weak self] in - self?.delegate?.invalidateTextAttachmentsDisplay() - } - let controller = UIHostingController(rootView: view) - controller.view.backgroundColor = .clear - // This allows the text view to handle it as a link - controller.view.isUserInteractionEnabled = false - self.view = controller.view - delegate?.registerPillView(controller.view) } // MARK: - NSSecureCoding @@ -87,7 +96,6 @@ final class ComposerMentionDisplayHelper: MentionDisplayHelper { self.timelineContext = timelineContext } - @MainActor static var mock: Self { Self(timelineContext: TimelineViewModel.mock.context) } diff --git a/ElementX/Sources/Other/Pills/PillContext.swift b/ElementX/Sources/Other/Pills/PillContext.swift index 93b626694..57d623d74 100644 --- a/ElementX/Sources/Other/Pills/PillContext.swift +++ b/ElementX/Sources/Other/Pills/PillContext.swift @@ -9,7 +9,6 @@ import Combine import Foundation -@MainActor final class PillContext: ObservableObject { @Published var viewState: PillViewState = .undefined diff --git a/ElementX/Sources/Other/Pills/PillTextAttachment.swift b/ElementX/Sources/Other/Pills/PillTextAttachment.swift index 991ab2133..75e879b07 100644 --- a/ElementX/Sources/Other/Pills/PillTextAttachment.swift +++ b/ElementX/Sources/Other/Pills/PillTextAttachment.swift @@ -9,7 +9,7 @@ import UIKit /// Text attachment for pills display. -final class PillTextAttachment: NSTextAttachment { +final nonisolated class PillTextAttachment: NSTextAttachment { convenience init?(attachmentData: PillTextAttachmentData) { let encoder = JSONEncoder() guard let encodedData = try? encoder.encode(attachmentData) else { return nil } diff --git a/ElementX/Sources/Other/Pills/PillTextAttachmentData.swift b/ElementX/Sources/Other/Pills/PillTextAttachmentData.swift index 1441ee18c..e6da0ce1e 100644 --- a/ElementX/Sources/Other/Pills/PillTextAttachmentData.swift +++ b/ElementX/Sources/Other/Pills/PillTextAttachmentData.swift @@ -9,7 +9,7 @@ import Foundation import UIKit -enum PillType: Codable, Equatable { +nonisolated enum PillType: Codable, Equatable { enum EventRoom: Codable, Equatable { case roomAlias(String) case roomID(String) @@ -24,7 +24,7 @@ enum PillType: Codable, Equatable { case allUsers } -struct PillTextAttachmentData: Codable, Equatable { +nonisolated struct PillTextAttachmentData: Codable, Equatable { struct Font: Codable, Equatable { let descender: CGFloat let lineHeight: CGFloat @@ -37,7 +37,7 @@ struct PillTextAttachmentData: Codable, Equatable { let fontData: Font } -extension PillTextAttachmentData { +nonisolated extension PillTextAttachmentData { init(type: PillType, font: UIFont) { self.type = type fontData = Font(descender: font.descender, lineHeight: font.lineHeight) diff --git a/ElementX/Sources/Other/Pills/PillUtilities.swift b/ElementX/Sources/Other/Pills/PillUtilities.swift index 84d02ce91..77cb1b3d2 100644 --- a/ElementX/Sources/Other/Pills/PillUtilities.swift +++ b/ElementX/Sources/Other/Pills/PillUtilities.swift @@ -8,7 +8,7 @@ import Foundation -enum PillUtilities { +nonisolated enum PillUtilities { static let atRoom = "@room" /// Used by the WYSIWYG as the urlString value to identify @room mentions diff --git a/ElementX/Sources/Other/Pills/PlainMentionBuilder.swift b/ElementX/Sources/Other/Pills/PlainMentionBuilder.swift index d33c3478f..61930a3d6 100644 --- a/ElementX/Sources/Other/Pills/PlainMentionBuilder.swift +++ b/ElementX/Sources/Other/Pills/PlainMentionBuilder.swift @@ -9,7 +9,7 @@ import Foundation /// In the future we might use this to do some customisation in what is plain text used to represent mentions. -struct PlainMentionBuilder: MentionBuilderProtocol { +nonisolated struct PlainMentionBuilder: MentionBuilderProtocol { func handleEventOnRoomAliasMention(for attributedString: NSMutableAttributedString, in range: NSRange, url: URL, eventID: String, roomAlias: String) { } func handleEventOnRoomIDMention(for attributedString: NSMutableAttributedString, in range: NSRange, url: URL, eventID: String, roomID: String) { } diff --git a/ElementX/Sources/Other/SDKListener.swift b/ElementX/Sources/Other/SDKListener.swift index 762eaf763..48f4644e3 100644 --- a/ElementX/Sources/Other/SDKListener.swift +++ b/ElementX/Sources/Other/SDKListener.swift @@ -13,7 +13,7 @@ import MatrixRustSDK /// /// To use this you'll need to add a conformance to the required listener /// protocol with a specialisation for the type it listens for. -final class SDKListener: Sendable { +final nonisolated class SDKListener: Sendable { private let onUpdateClosure: @Sendable (T) -> Void /// Creates a new listener. @@ -23,21 +23,62 @@ final class SDKListener: Sendable { } } +nonisolated extension SDKListener where T: Sendable { + /// Creates a new listener that delivers its updates on the main actor in FIFO order, + /// guaranteeing one in-flight update at a time. + /// + /// The SDK calls listeners from arbitrary threads, use this whenever the updates + /// need to touch main actor state. The internal stream (and so the long-lived task + /// consuming it) ends when the listener is released. + /// - Parameter onUpdate: A closure that will be called on the main actor whenever a new value is available. + static func onMainActor(_ onUpdate: @escaping @MainActor (T) -> Void) -> SDKListener { + let (stream, continuation) = AsyncStream.makeStream() + + Task { @MainActor in + for await value in stream { + onUpdate(value) + } + } + + // The wrapper is owned by the listener's closure, so when the SDK releases the listener + // (its subscription handle being dropped) the wrapper deinits and finishes the stream, + // ending the consumer task above. Deiniting the continuation alone does *not* terminate + // the stream (see SE-0406), which would otherwise leak the task. + let continuationWrapper = StreamContinuationWrapper(continuation) + return SDKListener { value in + continuationWrapper.continuation.yield(value) + } + } +} + +/// Owns an `AsyncStream.Continuation` and finishes its stream when released. +private final nonisolated class StreamContinuationWrapper: Sendable { + let continuation: AsyncStream.Continuation + + init(_ continuation: AsyncStream.Continuation) { + self.continuation = continuation + } + + deinit { + continuation.finish() + } +} + // MARK: QRCodeLoginService -extension SDKListener: QrLoginProgressListener where T == QrLoginProgress { +nonisolated extension SDKListener: QrLoginProgressListener where T == QrLoginProgress { func onUpdate(state: QrLoginProgress) { onUpdateClosure(state) } } -extension SDKListener: GrantQrLoginProgressListener where T == GrantQrLoginProgress { +nonisolated extension SDKListener: GrantQrLoginProgressListener where T == GrantQrLoginProgress { func onUpdate(state: GrantQrLoginProgress) { onUpdateClosure(state) } } -extension SDKListener: GrantGeneratedQrLoginProgressListener where T == GrantGeneratedQrLoginProgress { +nonisolated extension SDKListener: GrantGeneratedQrLoginProgressListener where T == GrantGeneratedQrLoginProgress { func onUpdate(state: GrantGeneratedQrLoginProgress) { onUpdateClosure(state) } @@ -45,49 +86,49 @@ extension SDKListener: GrantGeneratedQrLoginProgressListener where T == GrantGen // MARK: ClientProxy -extension SDKListener: MediaPreviewConfigListener where T == MediaPreviewConfig? { +nonisolated extension SDKListener: MediaPreviewConfigListener where T == MediaPreviewConfig? { func onChange(mediaPreviewConfig: MediaPreviewConfig?) { onUpdateClosure(mediaPreviewConfig) } } -extension SDKListener: SyncServiceStateObserver where T == SyncServiceState { +nonisolated extension SDKListener: SyncServiceStateObserver where T == SyncServiceState { func onUpdate(state: SyncServiceState) { onUpdateClosure(state) } } -extension SDKListener: RoomListServiceStateListener where T == RoomListServiceState { +nonisolated extension SDKListener: RoomListServiceStateListener where T == RoomListServiceState { func onUpdate(state: RoomListServiceState) { onUpdateClosure(state) } } -extension SDKListener: RoomListServiceSyncIndicatorListener where T == RoomListServiceSyncIndicator { +nonisolated extension SDKListener: RoomListServiceSyncIndicatorListener where T == RoomListServiceSyncIndicator { func onUpdate(syncIndicator: RoomListServiceSyncIndicator) { onUpdateClosure(syncIndicator) } } -extension SDKListener: VerificationStateListener where T == VerificationState { +nonisolated extension SDKListener: VerificationStateListener where T == VerificationState { func onUpdate(status: VerificationState) { onUpdateClosure(status) } } -extension SDKListener: IgnoredUsersListener where T == [String] { +nonisolated extension SDKListener: IgnoredUsersListener where T == [String] { func call(ignoredUserIds: [String]) { onUpdateClosure(ignoredUserIds) } } -extension SDKListener: SendQueueRoomErrorListener where T == (String, ClientError) { +nonisolated extension SDKListener: SendQueueRoomErrorListener where T == (String, ClientError) { func onError(roomId: String, error: ClientError) { onUpdateClosure((roomId, error)) } } -extension SDKListener: SendQueueRoomUpdateListener where T == (String, RoomSendQueueUpdate) { +nonisolated extension SDKListener: SendQueueRoomUpdateListener where T == (String, RoomSendQueueUpdate) { func onUpdate(roomId: String, update: RoomSendQueueUpdate) { onUpdateClosure((roomId, update)) } @@ -95,25 +136,25 @@ extension SDKListener: SendQueueRoomUpdateListener where T == (String, RoomSendQ // MARK: SecureBackupController -extension SDKListener: BackupStateListener where T == BackupState { +nonisolated extension SDKListener: BackupStateListener where T == BackupState { func onUpdate(status: BackupState) { onUpdateClosure(status) } } -extension SDKListener: RecoveryStateListener where T == RecoveryState { +nonisolated extension SDKListener: RecoveryStateListener where T == RecoveryState { func onUpdate(status: RecoveryState) { onUpdateClosure(status) } } -extension SDKListener: EnableRecoveryProgressListener where T == EnableRecoveryProgress { +nonisolated extension SDKListener: EnableRecoveryProgressListener where T == EnableRecoveryProgress { func onUpdate(status: EnableRecoveryProgress) { onUpdateClosure(status) } } -extension SDKListener: BackupSteadyStateListener where T == BackupUploadState { +nonisolated extension SDKListener: BackupSteadyStateListener where T == BackupUploadState { func onUpdate(status: BackupUploadState) { onUpdateClosure(status) } @@ -121,13 +162,13 @@ extension SDKListener: BackupSteadyStateListener where T == BackupUploadState { // MARK: RoomSummaryProvider -extension SDKListener: RoomListEntriesListener where T == [RoomListEntriesUpdate] { +nonisolated extension SDKListener: RoomListEntriesListener where T == [RoomListEntriesUpdate] { func onUpdate(roomEntriesUpdate: [RoomListEntriesUpdate]) { onUpdateClosure(roomEntriesUpdate) } } -extension SDKListener: RoomListLoadingStateListener where T == RoomListLoadingState { +nonisolated extension SDKListener: RoomListLoadingStateListener where T == RoomListLoadingState { func onUpdate(state: RoomListLoadingState) { onUpdateClosure(state) } @@ -135,31 +176,31 @@ extension SDKListener: RoomListLoadingStateListener where T == RoomListLoadingSt // MARK: Spaces -extension SDKListener: SpaceServiceJoinedSpacesListener where T == [SpaceListUpdate] { +nonisolated extension SDKListener: SpaceServiceJoinedSpacesListener where T == [SpaceListUpdate] { func onUpdate(rooms: [SpaceListUpdate]) { onUpdateClosure(rooms) } } -extension SDKListener: SpaceRoomListEntriesListener where T == [SpaceListUpdate] { +nonisolated extension SDKListener: SpaceRoomListEntriesListener where T == [SpaceListUpdate] { func onUpdate(roomUpdates: [SpaceListUpdate]) { onUpdateClosure(roomUpdates) } } -extension SDKListener: SpaceRoomListPaginationStateListener where T == SpaceRoomListPaginationState { +nonisolated extension SDKListener: SpaceRoomListPaginationStateListener where T == SpaceRoomListPaginationState { func onUpdate(paginationState: SpaceRoomListPaginationState) { onUpdateClosure(paginationState) } } -extension SDKListener: SpaceRoomListSpaceListener where T == SpaceRoom? { +nonisolated extension SDKListener: SpaceRoomListSpaceListener where T == SpaceRoom? { func onUpdate(space: SpaceRoom?) { onUpdateClosure(space) } } -extension SDKListener: SpaceServiceSpaceFiltersListener where T == [SpaceFilterUpdate] { +nonisolated extension SDKListener: SpaceServiceSpaceFiltersListener where T == [SpaceFilterUpdate] { func onUpdate(filterUpdates: [SpaceFilterUpdate]) { onUpdateClosure(filterUpdates) } @@ -167,55 +208,55 @@ extension SDKListener: SpaceServiceSpaceFiltersListener where T == [SpaceFilterU // MARK: Room -extension SDKListener: RoomInfoListener where T == RoomInfo { +nonisolated extension SDKListener: RoomInfoListener where T == RoomInfo { func call(roomInfo: RoomInfo) { onUpdateClosure(roomInfo) } } -extension SDKListener: CallDeclineListener where T == String { +nonisolated extension SDKListener: CallDeclineListener where T == String { func call(declinerUserId: String) { onUpdateClosure(declinerUserId) } } -extension SDKListener: TypingNotificationsListener where T == [String] { +nonisolated extension SDKListener: TypingNotificationsListener where T == [String] { func call(typingUserIds: [String]) { onUpdateClosure(typingUserIds) } } -extension SDKListener: IdentityStatusChangeListener where T == [IdentityStatusChange] { +nonisolated extension SDKListener: IdentityStatusChangeListener where T == [IdentityStatusChange] { func call(identityStatusChange: [IdentityStatusChange]) { onUpdateClosure(identityStatusChange) } } -extension SDKListener: KnockRequestsListener where T == [KnockRequest] { +nonisolated extension SDKListener: KnockRequestsListener where T == [KnockRequest] { func call(joinRequests: [KnockRequest]) { onUpdateClosure(joinRequests) } } -extension SDKListener: LiveLocationsListener where T == [LiveLocationShareUpdate] { +nonisolated extension SDKListener: LiveLocationsListener where T == [LiveLocationShareUpdate] { func onUpdate(updates: [LiveLocationShareUpdate]) { onUpdateClosure(updates) } } -extension SDKListener: BeaconInfoListener where T == BeaconInfoUpdate { +nonisolated extension SDKListener: BeaconInfoListener where T == BeaconInfoUpdate { func onUpdate(update: BeaconInfoUpdate) { onUpdateClosure(update) } } -extension SDKListener: ThreadListEntriesListener where T == [ThreadListUpdate] { +nonisolated extension SDKListener: ThreadListEntriesListener where T == [ThreadListUpdate] { func onUpdate(diff: [ThreadListUpdate]) { onUpdateClosure(diff) } } -extension SDKListener: ThreadListPaginationStateListener where T == ThreadListPaginationState { +nonisolated extension SDKListener: ThreadListPaginationStateListener where T == ThreadListPaginationState { func onUpdate(state: ThreadListPaginationState) { onUpdateClosure(state) } @@ -223,13 +264,13 @@ extension SDKListener: ThreadListPaginationStateListener where T == ThreadListPa // MARK: TimelineProxy -extension SDKListener: PaginationStatusListener where T == PaginationStatus { +nonisolated extension SDKListener: PaginationStatusListener where T == PaginationStatus { func onUpdate(status: PaginationStatus) { onUpdateClosure(status) } } -extension SDKListener: ProgressWatcher where T == Double { +nonisolated extension SDKListener: ProgressWatcher where T == Double { func transmissionProgress(progress: TransmissionProgress) { DispatchQueue.main.async { [weak self] in self?.onUpdateClosure(Double(progress.current) / Double(progress.total)) @@ -239,7 +280,7 @@ extension SDKListener: ProgressWatcher where T == Double { // MARK: TimelineItemProvider -extension SDKListener: TimelineListener where T == [TimelineDiff] { +nonisolated extension SDKListener: TimelineListener where T == [TimelineDiff] { func onUpdate(diff: [TimelineDiff]) { onUpdateClosure(diff) } @@ -247,7 +288,7 @@ extension SDKListener: TimelineListener where T == [TimelineDiff] { // MARK: RoomDirectorySearchProxy -extension SDKListener: RoomDirectorySearchEntriesListener where T == [RoomDirectorySearchEntryUpdate] { +nonisolated extension SDKListener: RoomDirectorySearchEntriesListener where T == [RoomDirectorySearchEntryUpdate] { func onUpdate(roomEntriesUpdate: [RoomDirectorySearchEntryUpdate]) { onUpdateClosure(roomEntriesUpdate) } diff --git a/ElementX/Sources/Other/ShareToMapsAppActivity.swift b/ElementX/Sources/Other/ShareToMapsAppActivity.swift index 6629dc262..be8c7c19d 100644 --- a/ElementX/Sources/Other/ShareToMapsAppActivity.swift +++ b/ElementX/Sources/Other/ShareToMapsAppActivity.swift @@ -27,30 +27,33 @@ final class ShareToMapsAppActivity: UIActivity { super.init() } - override private init() { + override private nonisolated init() { fatalError() } - override var activityTitle: String? { + override nonisolated var activityTitle: String? { type.activityTitle } - override var activityType: UIActivity.ActivityType { + override nonisolated var activityType: UIActivity.ActivityType { .shareToMapsApp } - override func canPerform(withActivityItems activityItems: [Any]) -> Bool { + override nonisolated func canPerform(withActivityItems activityItems: [Any]) -> Bool { true } - override func prepare(withActivityItems activityItems: [Any]) { - UIApplication.shared.open(type.activityURL(for: location, senderName: senderName), options: [:]) { [weak self] result in - self?.activityDidFinish(result) + override nonisolated func prepare(withActivityItems activityItems: [Any]) { + // UIActivity isn't annotated but UIKit guarantees this is called on the main thread. + MainActor.assumeIsolated { + UIApplication.shared.open(type.activityURL(for: location, senderName: senderName), options: [:]) { [weak self] result in + self?.activityDidFinish(result) + } } } } -extension ShareToMapsAppActivity.MapsAppType { +nonisolated extension ShareToMapsAppActivity.MapsAppType { func activityURL(for location: CLLocationCoordinate2D, senderName: String?) -> URL { switch self { case .apple: @@ -89,6 +92,6 @@ extension ShareToMapsAppActivity.MapsAppType { } } -private extension UIActivity.ActivityType { +private nonisolated extension UIActivity.ActivityType { static let shareToMapsApp = UIActivity.ActivityType("ElementX.ShareToMapsApp") } diff --git a/ElementX/Sources/Other/SwiftUI/Layout/FullscreenDialog.swift b/ElementX/Sources/Other/SwiftUI/Layout/FullscreenDialog.swift index c64eb012f..79edb98b1 100644 --- a/ElementX/Sources/Other/SwiftUI/Layout/FullscreenDialog.swift +++ b/ElementX/Sources/Other/SwiftUI/Layout/FullscreenDialog.swift @@ -67,7 +67,7 @@ struct FullscreenDialog: View { } /// A layout where the content scrolls with the bottom content overlaid. Used with regular font sizes. - @MainActor var standardLayout: some View { + var standardLayout: some View { GeometryReader { geometry in ScrollView { VStack(spacing: 0) { diff --git a/ElementX/Sources/Other/SwiftUI/Layout/ViewFrameReader.swift b/ElementX/Sources/Other/SwiftUI/Layout/ViewFrameReader.swift index 5da8336b5..78394a4d7 100644 --- a/ElementX/Sources/Other/SwiftUI/Layout/ViewFrameReader.swift +++ b/ElementX/Sources/Other/SwiftUI/Layout/ViewFrameReader.swift @@ -13,10 +13,9 @@ extension View { /// Reads the frame of the view and stores it in the `frame` binding. /// - Parameters: /// - frame: a `CGRect` binding - /// - coordinateSpace: the coordinate space of the frame. - func readFrame(_ frame: Binding, in coordinateSpace: CoordinateSpace = .local) -> some View { + func readFrame(_ frame: Binding) -> some View { onGeometryChange(for: CGRect.self) { geometry in - geometry.frame(in: coordinateSpace) + geometry.frame(in: .local) } action: { newValue in frame.wrappedValue = newValue } diff --git a/ElementX/Sources/Other/SwiftUI/ViewModel/BindableState.swift b/ElementX/Sources/Other/SwiftUI/ViewModel/BindableState.swift index 282ee81e8..beae6898e 100644 --- a/ElementX/Sources/Other/SwiftUI/ViewModel/BindableState.swift +++ b/ElementX/Sources/Other/SwiftUI/ViewModel/BindableState.swift @@ -9,7 +9,6 @@ import Foundation /// Represents a specific portion of the ViewState that can be bound to with SwiftUI's [2-way binding](https://developer.apple.com/documentation/swiftui/binding). -@MainActor protocol BindableState { /// The associated type of the Bindable State. Defaults to Void. associatedtype BindStateType = Void diff --git a/ElementX/Sources/Other/SwiftUI/ViewModel/StateStoreViewModel.swift b/ElementX/Sources/Other/SwiftUI/ViewModel/StateStoreViewModel.swift index fe79f8e3b..d75471f68 100644 --- a/ElementX/Sources/Other/SwiftUI/ViewModel/StateStoreViewModel.swift +++ b/ElementX/Sources/Other/SwiftUI/ViewModel/StateStoreViewModel.swift @@ -16,7 +16,6 @@ import Foundation /// a specific portion of state that can be safely bound to. /// If we decide to add more features to our state management (like doing state processing off the main thread) /// we can do it in this centralised place. -@MainActor class StateStoreViewModel { /// For storing subscription references. /// @@ -57,7 +56,6 @@ class StateStoreViewModel { /// It provides a nice layer of consistency and also safety. As we are not passing the `ViewModel` to the view directly, shortcuts/hacks /// can't be made into the `ViewModel`. @dynamicMemberLookup - @MainActor final class Context: ObservableObject { fileprivate weak var viewModel: StateStoreViewModel? diff --git a/ElementX/Sources/Other/SwiftUI/ViewModel/StateStoreViewModelV2.swift b/ElementX/Sources/Other/SwiftUI/ViewModel/StateStoreViewModelV2.swift index 13cbbcf82..2d2adba5a 100644 --- a/ElementX/Sources/Other/SwiftUI/ViewModel/StateStoreViewModelV2.swift +++ b/ElementX/Sources/Other/SwiftUI/ViewModel/StateStoreViewModelV2.swift @@ -18,7 +18,6 @@ import Observation /// a specific portion of state that can be safely bound to. /// If we decide to add more features to our state management (like doing state processing off the main thread) /// we can do it in this centralised place. -@MainActor class StateStoreViewModelV2 { /// For storing subscription references. /// @@ -59,7 +58,6 @@ class StateStoreViewModelV2 { /// It provides a nice layer of consistency and also safety. As we are not passing the `ViewModel` to the view directly, shortcuts/hacks /// can't be made into the `ViewModel`. @dynamicMemberLookup - @MainActor @Observable final class Context { fileprivate weak var viewModel: StateStoreViewModelV2? diff --git a/ElementX/Sources/Other/SwiftUI/Views/LoadableImage.swift b/ElementX/Sources/Other/SwiftUI/Views/LoadableImage.swift index b1aecbfcb..cd93debe1 100644 --- a/ElementX/Sources/Other/SwiftUI/Views/LoadableImage.swift +++ b/ElementX/Sources/Other/SwiftUI/Views/LoadableImage.swift @@ -230,16 +230,24 @@ private struct LoadableImageContent) -> Void) { - guard case let .gifData(data) = contentLoader.content else { + nonisolated func data(handler: @escaping (Result) -> Void) { + // Kingfisher isn't annotated but invokes the provider on the main thread. + let gifData = MainActor.assumeIsolated { () -> Data? in + guard case let .gifData(data) = contentLoader.content else { + return nil + } + return data + } + + guard let gifData else { fatalError("Shouldn't reach this point without any gif data") } - handler(.success(data)) + handler(.success(gifData)) } } @@ -279,7 +287,6 @@ private class ContentLoader: ObservableObject { self.mediaProvider = mediaProvider } - @MainActor func load() async { if isGIF { if case let .success(data) = await mediaProvider?.loadImageDataFromSource(mediaSource) { diff --git a/ElementX/Sources/Other/SwiftUI/Views/RoomInviterLabel.swift b/ElementX/Sources/Other/SwiftUI/Views/RoomInviterLabel.swift index 687ae8ff8..442b3d6b7 100644 --- a/ElementX/Sources/Other/SwiftUI/Views/RoomInviterLabel.swift +++ b/ElementX/Sources/Other/SwiftUI/Views/RoomInviterLabel.swift @@ -8,7 +8,6 @@ import SwiftUI -@MainActor struct RoomInviterDetails: Equatable { let id: String let displayName: String? diff --git a/ElementX/Sources/Other/SwiftUI/Views/ToolbarButton.swift b/ElementX/Sources/Other/SwiftUI/Views/ToolbarButton.swift index 07ec2beff..28a3c974f 100644 --- a/ElementX/Sources/Other/SwiftUI/Views/ToolbarButton.swift +++ b/ElementX/Sources/Other/SwiftUI/Views/ToolbarButton.swift @@ -9,7 +9,6 @@ import Compound import SwiftUI struct ToolbarButton: View { - @MainActor enum Role { static let cancel = Role.cancel(title: L10n.actionCancel) static let done = Role.confirm(title: L10n.actionDone) diff --git a/ElementX/Sources/Other/UserAgentBuilder.swift b/ElementX/Sources/Other/UserAgentBuilder.swift index 52e7a6476..ce35d06d3 100644 --- a/ElementX/Sources/Other/UserAgentBuilder.swift +++ b/ElementX/Sources/Other/UserAgentBuilder.swift @@ -13,7 +13,12 @@ import UIKit import DeviceKit #endif -enum UserAgentBuilder { +nonisolated enum UserAgentBuilder { + /// The screen scale used in the user agent. It never changes at runtime, so it's captured once + /// on the main actor at launch (see the app coordinator) and read freely from any thread/process. + /// Contexts without a screen (e.g. the NSE) keep the default. + nonisolated(unsafe) static var displayScale: CGFloat = 2.0 + static func makeASCIIUserAgent() -> String { makeUserAgent()?.asciified() ?? "unknown" } @@ -23,20 +28,21 @@ enum UserAgentBuilder { let clientVersion = InfoPlistReader.app.bundleShortVersionString #if os(iOS) - let scale = UIScreen.main.scale + let osVersion = ProcessInfo.processInfo.operatingSystemVersion + let systemVersion = "\(osVersion.majorVersion).\(osVersion.minorVersion).\(osVersion.patchVersion)" return if ProcessInfo.processInfo.isiOSAppOnMac { String(format: "%@/%@ (Mac; macOS %@; Scale/%0.2f)", clientName, clientVersion, ProcessInfo.processInfo.operatingSystemVersionString, - scale) + displayScale) } else { String(format: "%@/%@ (%@; iOS %@; Scale/%0.2f)", clientName, clientVersion, Device.current.safeDescription, - UIDevice.current.systemVersion, - scale) + systemVersion, + displayScale) } #elseif os(tvOS) return String(format: "%@/%@ (%@; tvOS %@; Scale/%0.2f)", diff --git a/ElementX/Sources/Other/VoiceMessage/EstimatedWaveformView.swift b/ElementX/Sources/Other/VoiceMessage/EstimatedWaveformView.swift index b85851105..9280e35e1 100644 --- a/ElementX/Sources/Other/VoiceMessage/EstimatedWaveformView.swift +++ b/ElementX/Sources/Other/VoiceMessage/EstimatedWaveformView.swift @@ -8,7 +8,7 @@ import SwiftUI -struct EstimatedWaveform: Equatable, Hashable { +nonisolated struct EstimatedWaveform: Equatable, Hashable { static let dataRange: ClosedRange = 0...1024 let data: [UInt16] } @@ -38,7 +38,7 @@ extension EstimatedWaveform { } } -extension EstimatedWaveform { +nonisolated extension EstimatedWaveform { static let mockWaveform = EstimatedWaveform(data: [0, 0, 0, 3, 3, 127, 400, 266, 126, 122, 373, 251, 45, 112, 334, 205, 99, 138, 397, 354, 125, 361, 199, 51, 294, 131, 19, 2, 3, 3, 1, 2, 0, 0, diff --git a/ElementX/Sources/Screens/AppLock/AppLockScreen/AppLockScreenViewModelProtocol.swift b/ElementX/Sources/Screens/AppLock/AppLockScreen/AppLockScreenViewModelProtocol.swift index c66e61f8e..ebfaebd8f 100644 --- a/ElementX/Sources/Screens/AppLock/AppLockScreen/AppLockScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/AppLock/AppLockScreen/AppLockScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol AppLockScreenViewModelProtocol { var actions: AnyPublisher { get } var context: AppLockScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/AppLock/AppLockSetupBiometricsScreen/AppLockSetupBiometricsScreenViewModelProtocol.swift b/ElementX/Sources/Screens/AppLock/AppLockSetupBiometricsScreen/AppLockSetupBiometricsScreenViewModelProtocol.swift index 5d4852671..949023355 100644 --- a/ElementX/Sources/Screens/AppLock/AppLockSetupBiometricsScreen/AppLockSetupBiometricsScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/AppLock/AppLockSetupBiometricsScreen/AppLockSetupBiometricsScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol AppLockSetupBiometricsScreenViewModelProtocol { var actions: AnyPublisher { get } var context: AppLockSetupBiometricsScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/AppLock/AppLockSetupPINScreen/AppLockSetupPINScreenViewModelProtocol.swift b/ElementX/Sources/Screens/AppLock/AppLockSetupPINScreen/AppLockSetupPINScreenViewModelProtocol.swift index 6bfb694e0..23c1ee5f8 100644 --- a/ElementX/Sources/Screens/AppLock/AppLockSetupPINScreen/AppLockSetupPINScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/AppLock/AppLockSetupPINScreen/AppLockSetupPINScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol AppLockSetupPINScreenViewModelProtocol { var actions: AnyPublisher { get } var context: AppLockSetupPINScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/AppLock/AppLockSetupSettingsScreen/AppLockSetupSettingsScreenViewModelProtocol.swift b/ElementX/Sources/Screens/AppLock/AppLockSetupSettingsScreen/AppLockSetupSettingsScreenViewModelProtocol.swift index ffe177ff6..af77fd8c2 100644 --- a/ElementX/Sources/Screens/AppLock/AppLockSetupSettingsScreen/AppLockSetupSettingsScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/AppLock/AppLockSetupSettingsScreen/AppLockSetupSettingsScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol AppLockSetupSettingsScreenViewModelProtocol { var actions: AnyPublisher { get } var context: AppLockSetupSettingsScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/Authentication/LoginScreen/LoginMode.swift b/ElementX/Sources/Screens/Authentication/LoginScreen/LoginMode.swift index fc2875a36..ae87c4fe1 100644 --- a/ElementX/Sources/Screens/Authentication/LoginScreen/LoginMode.swift +++ b/ElementX/Sources/Screens/Authentication/LoginScreen/LoginMode.swift @@ -9,7 +9,7 @@ import Foundation /// The supported forms of login that a homeserver allows. -enum LoginMode: Equatable { +nonisolated enum LoginMode: Equatable { /// The login mode hasn't been determined yet. case unknown /// The homeserver supports login via OpenID Connect. diff --git a/ElementX/Sources/Screens/Authentication/LoginScreen/LoginScreenViewModelProtocol.swift b/ElementX/Sources/Screens/Authentication/LoginScreen/LoginScreenViewModelProtocol.swift index 0607a82c2..d1ef40ba9 100644 --- a/ElementX/Sources/Screens/Authentication/LoginScreen/LoginScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/Authentication/LoginScreen/LoginScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol LoginScreenViewModelProtocol { var actions: AnyPublisher { get } var context: LoginScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/Authentication/OAuthAuthenticationPresenter.swift b/ElementX/Sources/Screens/Authentication/OAuthAuthenticationPresenter.swift index b9039db00..264fa1468 100644 --- a/ElementX/Sources/Screens/Authentication/OAuthAuthenticationPresenter.swift +++ b/ElementX/Sources/Screens/Authentication/OAuthAuthenticationPresenter.swift @@ -13,7 +13,6 @@ import AuthenticationServices /// In certain instances the URL may require opening an external app instead of using a WAS. Because of this /// it is recommended to not encode the OAuth authentication within any state machines, as there is no guarantee /// that any cancellations/failures will be communicated upwards. -@MainActor class OAuthAuthenticationPresenter: NSObject { private let authenticationService: AuthenticationServiceProtocol private let redirectURL: URL diff --git a/ElementX/Sources/Screens/Authentication/ServerConfirmationScreen/ServerConfirmationScreenViewModelProtocol.swift b/ElementX/Sources/Screens/Authentication/ServerConfirmationScreen/ServerConfirmationScreenViewModelProtocol.swift index 1aa9d7b59..f57ce3432 100644 --- a/ElementX/Sources/Screens/Authentication/ServerConfirmationScreen/ServerConfirmationScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/Authentication/ServerConfirmationScreen/ServerConfirmationScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol ServerConfirmationScreenViewModelProtocol { var actions: AnyPublisher { get } var context: ServerConfirmationScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/Authentication/ServerSelectionScreen/ServerSelectionScreenViewModelProtocol.swift b/ElementX/Sources/Screens/Authentication/ServerSelectionScreen/ServerSelectionScreenViewModelProtocol.swift index 94082e3fe..7fd70675a 100644 --- a/ElementX/Sources/Screens/Authentication/ServerSelectionScreen/ServerSelectionScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/Authentication/ServerSelectionScreen/ServerSelectionScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol ServerSelectionScreenViewModelProtocol { var actions: AnyPublisher { get } var context: ServerSelectionScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/Authentication/SoftLogoutScreen/MockSoftLogoutScreenState.swift b/ElementX/Sources/Screens/Authentication/SoftLogoutScreen/MockSoftLogoutScreenState.swift index b6ded78ca..e93a5f24a 100644 --- a/ElementX/Sources/Screens/Authentication/SoftLogoutScreen/MockSoftLogoutScreenState.swift +++ b/ElementX/Sources/Screens/Authentication/SoftLogoutScreen/MockSoftLogoutScreenState.swift @@ -22,7 +22,7 @@ enum MockSoftLogoutScreenState: String, CaseIterable { case keyBackupNeeded /// Generate the view struct for the screen state. - @MainActor var viewModel: SoftLogoutScreenViewModel { + var viewModel: SoftLogoutScreenViewModel { let credentials = SoftLogoutScreenCredentials(userID: "@mock:matrix.org", homeserverName: "matrix.org", userDisplayName: "mock", diff --git a/ElementX/Sources/Screens/Authentication/SoftLogoutScreen/SoftLogoutScreenCoordinator.swift b/ElementX/Sources/Screens/Authentication/SoftLogoutScreen/SoftLogoutScreenCoordinator.swift index 962a1a224..02177723e 100644 --- a/ElementX/Sources/Screens/Authentication/SoftLogoutScreen/SoftLogoutScreenCoordinator.swift +++ b/ElementX/Sources/Screens/Authentication/SoftLogoutScreen/SoftLogoutScreenCoordinator.swift @@ -106,7 +106,7 @@ final class SoftLogoutScreenCoordinator: CoordinatorProtocol { private static let loadingIndicatorIdentifier = "\(SoftLogoutScreenCoordinator.self)-Loading" /// Show an activity indicator whilst loading. - @MainActor private func startLoading() { + private func startLoading() { parameters.userIndicatorController.submitIndicator(UserIndicator(id: Self.loadingIndicatorIdentifier, type: .modal, title: L10n.commonLoading, @@ -114,17 +114,17 @@ final class SoftLogoutScreenCoordinator: CoordinatorProtocol { } /// Hide the currently displayed activity indicator. - @MainActor private func stopLoading() { + private func stopLoading() { parameters.userIndicatorController.retractIndicatorWithId(Self.loadingIndicatorIdentifier) } /// Shows the forgot password screen. - @MainActor private func showForgotPasswordScreen() { + private func showForgotPasswordScreen() { viewModel.displayError(.alert("Not implemented.")) } /// Login with the supplied username and password. - @MainActor private func login(withPassword password: String) { + private func login(withPassword password: String) { let username = parameters.credentials.userID startLoading() diff --git a/ElementX/Sources/Screens/Authentication/SoftLogoutScreen/SoftLogoutScreenViewModel.swift b/ElementX/Sources/Screens/Authentication/SoftLogoutScreen/SoftLogoutScreenViewModel.swift index 58b0fba34..c15e3330f 100644 --- a/ElementX/Sources/Screens/Authentication/SoftLogoutScreen/SoftLogoutScreenViewModel.swift +++ b/ElementX/Sources/Screens/Authentication/SoftLogoutScreen/SoftLogoutScreenViewModel.swift @@ -46,7 +46,7 @@ class SoftLogoutScreenViewModel: SoftLogoutScreenViewModelType, SoftLogoutScreen } } - @MainActor func displayError(_ type: SoftLogoutScreenErrorType) { + func displayError(_ type: SoftLogoutScreenErrorType) { switch type { case .alert(let message): state.bindings.alertInfo = AlertInfo(id: type, diff --git a/ElementX/Sources/Screens/Authentication/SoftLogoutScreen/SoftLogoutScreenViewModelProtocol.swift b/ElementX/Sources/Screens/Authentication/SoftLogoutScreen/SoftLogoutScreenViewModelProtocol.swift index 2f162b2da..2d080c052 100644 --- a/ElementX/Sources/Screens/Authentication/SoftLogoutScreen/SoftLogoutScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/Authentication/SoftLogoutScreen/SoftLogoutScreenViewModelProtocol.swift @@ -8,11 +8,10 @@ import Combine -@MainActor protocol SoftLogoutScreenViewModelProtocol { var actions: AnyPublisher { get } var context: SoftLogoutScreenViewModelType.Context { get } /// Display an error to the user. - @MainActor func displayError(_ type: SoftLogoutScreenErrorType) + func displayError(_ type: SoftLogoutScreenErrorType) } diff --git a/ElementX/Sources/Screens/Authentication/StartScreen/AuthenticationStartScreenViewModelProtocol.swift b/ElementX/Sources/Screens/Authentication/StartScreen/AuthenticationStartScreenViewModelProtocol.swift index e5006a7fd..998768a86 100644 --- a/ElementX/Sources/Screens/Authentication/StartScreen/AuthenticationStartScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/Authentication/StartScreen/AuthenticationStartScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol AuthenticationStartScreenViewModelProtocol { var actions: AnyPublisher { get } var context: AuthenticationStartScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/BlockedUsersScreen/BlockedUsersScreenViewModel.swift b/ElementX/Sources/Screens/BlockedUsersScreen/BlockedUsersScreenViewModel.swift index 81d858a2b..b59c5db0d 100644 --- a/ElementX/Sources/Screens/BlockedUsersScreen/BlockedUsersScreenViewModel.swift +++ b/ElementX/Sources/Screens/BlockedUsersScreen/BlockedUsersScreenViewModel.swift @@ -69,20 +69,28 @@ class BlockedUsersScreenViewModel: BlockedUsersScreenViewModelType, BlockedUsers state.blockedUsers = await withTaskGroup(of: UserProfileProxy.self) { group in for userID in blockedUsers { group.addTask { - switch await self.clientProxy.profile(for: userID) { - case .success(let profile): profile - case .failure: UserProfileProxy(userID: userID) - } + await self.profile(for: userID) } } - return await group.reduce(into: []) { partialResult, profile in - partialResult.append(profile) + var profiles = [UserProfileProxy]() + for await profile in group { + profiles.append(profile) } + return profiles } } } + /// The client proxy isn't Sendable, fetch through this helper so that it + /// never leaves the main actor when running calls in parallel. + private func profile(for userID: String) async -> UserProfileProxy { + switch await clientProxy.profile(for: userID) { + case .success(let profile): profile + case .failure: UserProfileProxy(userID: userID) + } + } + private func unblockUser(_ user: UserProfileProxy) { showLoadingIndicator() state.processingUserID = user.userID diff --git a/ElementX/Sources/Screens/BlockedUsersScreen/BlockedUsersScreenViewModelProtocol.swift b/ElementX/Sources/Screens/BlockedUsersScreen/BlockedUsersScreenViewModelProtocol.swift index ab67129ff..af393a4c3 100644 --- a/ElementX/Sources/Screens/BlockedUsersScreen/BlockedUsersScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/BlockedUsersScreen/BlockedUsersScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol BlockedUsersScreenViewModelProtocol { var context: BlockedUsersScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/BugReportScreen/BugReportScreenViewModelProtocol.swift b/ElementX/Sources/Screens/BugReportScreen/BugReportScreenViewModelProtocol.swift index 605767dad..48c8ec4bd 100644 --- a/ElementX/Sources/Screens/BugReportScreen/BugReportScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/BugReportScreen/BugReportScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol BugReportScreenViewModelProtocol { var actions: AnyPublisher { get } var context: BugReportScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/BugReportScreen/View/BugReportScreen.swift b/ElementX/Sources/Screens/BugReportScreen/View/BugReportScreen.swift index 79ba5012d..fee2423b3 100644 --- a/ElementX/Sources/Screens/BugReportScreen/View/BugReportScreen.swift +++ b/ElementX/Sources/Screens/BugReportScreen/View/BugReportScreen.swift @@ -100,7 +100,10 @@ struct BugReportScreen: View { PhotosPicker(selection: $selectedScreenshot, matching: .screenshots, photoLibrary: .shared()) { - ListRowLabel.plain(title: photosPickerTitle) + // The label builder isn't isolated in SwiftUI's signature but is only ever called on the main actor. + MainActor.assumeIsolated { + ListRowLabel.plain(title: photosPickerTitle) + } } }) .accessibilityIdentifier(A11yIdentifiers.bugReportScreen.attachScreenshot) diff --git a/ElementX/Sources/Screens/CallScreen/CallScreenViewModelProtocol.swift b/ElementX/Sources/Screens/CallScreen/CallScreenViewModelProtocol.swift index d0b604a4a..7a0a514ea 100644 --- a/ElementX/Sources/Screens/CallScreen/CallScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/CallScreen/CallScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol CallScreenViewModelProtocol { var actions: AnyPublisher { get } var context: CallScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/CallScreen/View/CallScreen.swift b/ElementX/Sources/Screens/CallScreen/View/CallScreen.swift index 30d09a68d..8a7ab4fc9 100644 --- a/ElementX/Sources/Screens/CallScreen/View/CallScreen.swift +++ b/ElementX/Sources/Screens/CallScreen/View/CallScreen.swift @@ -71,7 +71,6 @@ private struct CallView: UIViewRepresentable { } } - @MainActor class Coordinator: NSObject, WKUIDelegate, WKNavigationDelegate, AVPictureInPictureControllerDelegate { private weak var viewModelContext: CallScreenViewModel.Context? @@ -168,6 +167,9 @@ private struct CallView: UIViewRepresentable { if let error { continuaton.resume(throwing: error) } else { + // The completion is called on the main thread which the continuation + // also resumes on, so the result never actually crosses threads. + nonisolated(unsafe) let result = result continuaton.resume(returning: result) } } diff --git a/ElementX/Sources/Screens/ChatsSpaceFiltersScreen/ChatsSpaceFiltersScreenViewModelProtocol.swift b/ElementX/Sources/Screens/ChatsSpaceFiltersScreen/ChatsSpaceFiltersScreenViewModelProtocol.swift index f0b5ab66c..6fcdbd238 100644 --- a/ElementX/Sources/Screens/ChatsSpaceFiltersScreen/ChatsSpaceFiltersScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/ChatsSpaceFiltersScreen/ChatsSpaceFiltersScreenViewModelProtocol.swift @@ -7,7 +7,6 @@ import Combine -@MainActor protocol ChatsSpaceFiltersScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: ChatsSpaceFiltersScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/ChatsSpaceFiltersScreen/View/ChatsSpaceFilterCell.swift b/ElementX/Sources/Screens/ChatsSpaceFiltersScreen/View/ChatsSpaceFilterCell.swift index 87a846cbf..1bf7ff427 100644 --- a/ElementX/Sources/Screens/ChatsSpaceFiltersScreen/View/ChatsSpaceFilterCell.swift +++ b/ElementX/Sources/Screens/ChatsSpaceFiltersScreen/View/ChatsSpaceFilterCell.swift @@ -49,7 +49,7 @@ struct ChatsSpaceFilterCell: View { .padding(.horizontal, horizontalInsets) } - @ViewBuilder @MainActor + @ViewBuilder private var avatar: some View { if dynamicTypeSize < .accessibility3 { RoomAvatarImage(avatar: filter.room.avatar, diff --git a/ElementX/Sources/Screens/CreatePollScreen/PollFormScreenViewModelProtocol.swift b/ElementX/Sources/Screens/CreatePollScreen/PollFormScreenViewModelProtocol.swift index df8e810b8..08fd50be9 100644 --- a/ElementX/Sources/Screens/CreatePollScreen/PollFormScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/CreatePollScreen/PollFormScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol PollFormScreenViewModelProtocol { var actions: AnyPublisher { get } var context: PollFormScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/CreatePollScreen/View/PollFormScreen.swift b/ElementX/Sources/Screens/CreatePollScreen/View/PollFormScreen.swift index 42b18ad66..7a455da34 100644 --- a/ElementX/Sources/Screens/CreatePollScreen/View/PollFormScreen.swift +++ b/ElementX/Sources/Screens/CreatePollScreen/View/PollFormScreen.swift @@ -148,7 +148,7 @@ struct PollFormScreen: View { } private extension View { - @MainActor @ViewBuilder + @ViewBuilder func trackAnalyticsIfNeeded(context: PollFormScreenViewModel.Context) -> some View { switch context.viewState.mode { case .edit: diff --git a/ElementX/Sources/Screens/CreateRoomScreen/CreateRoomScreenViewModel.swift b/ElementX/Sources/Screens/CreateRoomScreen/CreateRoomScreenViewModel.swift index 96ca8cd53..695ad33c2 100644 --- a/ElementX/Sources/Screens/CreateRoomScreen/CreateRoomScreenViewModel.swift +++ b/ElementX/Sources/Screens/CreateRoomScreen/CreateRoomScreenViewModel.swift @@ -303,9 +303,9 @@ class CreateRoomScreenViewModel: CreateRoomScreenViewModelType, CreateRoomScreen private func addRoomToSpace(roomProxy: JoinedRoomProxyProtocol, spaceID: String) async { roomProxy.subscribeToRoomInfoUpdates() - let runner = ExpiringTaskRunner { + let runner = ExpiringTaskRunner { @MainActor in // Necessary to build the room cache so that the space can be added as a parent. - _ = await roomProxy.infoPublisher.values.first { $0.powerLevels != nil } + _ = await roomProxy.infoPublisher.values.first { @Sendable in $0.powerLevels != nil } } do { diff --git a/ElementX/Sources/Screens/CreateRoomScreen/CreateRoomScreenViewModelProtocol.swift b/ElementX/Sources/Screens/CreateRoomScreen/CreateRoomScreenViewModelProtocol.swift index ccfd46328..9bf3e2741 100644 --- a/ElementX/Sources/Screens/CreateRoomScreen/CreateRoomScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/CreateRoomScreen/CreateRoomScreenViewModelProtocol.swift @@ -9,7 +9,6 @@ import Combine import Foundation -@MainActor protocol CreateRoomScreenViewModelProtocol { var actions: AnyPublisher { get } var context: CreateRoomScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/DeclineAndBlockScreen/DeclineAndBlockScreenViewModelProtocol.swift b/ElementX/Sources/Screens/DeclineAndBlockScreen/DeclineAndBlockScreenViewModelProtocol.swift index 1d18b9550..06c71b7f7 100644 --- a/ElementX/Sources/Screens/DeclineAndBlockScreen/DeclineAndBlockScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/DeclineAndBlockScreen/DeclineAndBlockScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol DeclineAndBlockScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: DeclineAndBlockScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/EditRoomAddressScreen/EditRoomAddressScreenViewModelProtocol.swift b/ElementX/Sources/Screens/EditRoomAddressScreen/EditRoomAddressScreenViewModelProtocol.swift index 1ea1652c3..c17653ddd 100644 --- a/ElementX/Sources/Screens/EditRoomAddressScreen/EditRoomAddressScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/EditRoomAddressScreen/EditRoomAddressScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol EditRoomAddressScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: EditRoomAddressScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/EmojiPickerScreen/EmojiPickerScreenViewModelProtocol.swift b/ElementX/Sources/Screens/EmojiPickerScreen/EmojiPickerScreenViewModelProtocol.swift index 5d37be5b1..4630126c7 100644 --- a/ElementX/Sources/Screens/EmojiPickerScreen/EmojiPickerScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/EmojiPickerScreen/EmojiPickerScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol EmojiPickerScreenViewModelProtocol { var actions: AnyPublisher { get } var context: EmojiPickerScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/EncryptionReset/EncryptionResetPasswordScreen/EncryptionResetPasswordScreenViewModelProtocol.swift b/ElementX/Sources/Screens/EncryptionReset/EncryptionResetPasswordScreen/EncryptionResetPasswordScreenViewModelProtocol.swift index df1a7217a..04358b8a2 100644 --- a/ElementX/Sources/Screens/EncryptionReset/EncryptionResetPasswordScreen/EncryptionResetPasswordScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/EncryptionReset/EncryptionResetPasswordScreen/EncryptionResetPasswordScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol EncryptionResetPasswordScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: EncryptionResetPasswordScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/EncryptionReset/EncryptionResetScreen/EncryptionResetScreenViewModelProtocol.swift b/ElementX/Sources/Screens/EncryptionReset/EncryptionResetScreen/EncryptionResetScreenViewModelProtocol.swift index 6f31531e8..13cf1fa85 100644 --- a/ElementX/Sources/Screens/EncryptionReset/EncryptionResetScreen/EncryptionResetScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/EncryptionReset/EncryptionResetScreen/EncryptionResetScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol EncryptionResetScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: EncryptionResetScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/FilePreviewScreen/View/TimelineMediaPreviewController.swift b/ElementX/Sources/Screens/FilePreviewScreen/View/TimelineMediaPreviewController.swift index ba859bbf0..037c6e75f 100644 --- a/ElementX/Sources/Screens/FilePreviewScreen/View/TimelineMediaPreviewController.swift +++ b/ElementX/Sources/Screens/FilePreviewScreen/View/TimelineMediaPreviewController.swift @@ -153,7 +153,10 @@ class TimelineMediaPreviewController: QLPreviewController { // Ridiculous hack to undo the controller's attempt to replace our info button with the list button. if barButtonTimer == nil { barButtonTimer = Timer.scheduledTimer(withTimeInterval: 0.1, repeats: true) { [weak self] _ in - self?.updateBarButtons() + // The timer is scheduled on the main run loop so it always fires on the main actor. + MainActor.assumeIsolated { + self?.updateBarButtons() + } } } } diff --git a/ElementX/Sources/Screens/GlobalSearchScreen/GlobalSearchScreenCoordinator.swift b/ElementX/Sources/Screens/GlobalSearchScreen/GlobalSearchScreenCoordinator.swift index e0832cfe2..69c5cfd35 100644 --- a/ElementX/Sources/Screens/GlobalSearchScreen/GlobalSearchScreenCoordinator.swift +++ b/ElementX/Sources/Screens/GlobalSearchScreen/GlobalSearchScreenCoordinator.swift @@ -20,7 +20,6 @@ enum GlobalSearchControllerAction { case select(roomID: String) } -@MainActor class GlobalSearchScreenCoordinator: CoordinatorProtocol { private let viewModel: GlobalSearchScreenViewModelProtocol diff --git a/ElementX/Sources/Screens/GlobalSearchScreen/GlobalSearchScreenViewModelProtocol.swift b/ElementX/Sources/Screens/GlobalSearchScreen/GlobalSearchScreenViewModelProtocol.swift index 91c8f9285..77fa594a2 100644 --- a/ElementX/Sources/Screens/GlobalSearchScreen/GlobalSearchScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/GlobalSearchScreen/GlobalSearchScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol GlobalSearchScreenViewModelProtocol { var actions: AnyPublisher { get } var context: GlobalSearchScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/GlobalSearchScreen/View/GlobalSearchScreenCell.swift b/ElementX/Sources/Screens/GlobalSearchScreen/View/GlobalSearchScreenCell.swift index e02876a34..f69e2bc2c 100644 --- a/ElementX/Sources/Screens/GlobalSearchScreen/View/GlobalSearchScreenCell.swift +++ b/ElementX/Sources/Screens/GlobalSearchScreen/View/GlobalSearchScreenCell.swift @@ -24,7 +24,7 @@ struct GlobalSearchScreenListRow: View { } } - @ViewBuilder @MainActor + @ViewBuilder var avatar: some View { if dynamicTypeSize < .accessibility3 { RoomAvatarImage(avatar: room.avatar, diff --git a/ElementX/Sources/Screens/HomeScreen/HomeScreenViewModelProtocol.swift b/ElementX/Sources/Screens/HomeScreen/HomeScreenViewModelProtocol.swift index 97910505c..345ce958e 100644 --- a/ElementX/Sources/Screens/HomeScreen/HomeScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/HomeScreen/HomeScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol HomeScreenViewModelProtocol { var actions: AnyPublisher { get } diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenInviteCell.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenInviteCell.swift index e53d0aa6a..1f98c05d8 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenInviteCell.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenInviteCell.swift @@ -10,7 +10,6 @@ import Combine import Compound import SwiftUI -@MainActor struct HomeScreenInviteCell: View { @Environment(\.dynamicTypeSize) var dynamicTypeSize @@ -209,7 +208,6 @@ struct HomeScreenInviteCell_Previews: PreviewProvider, TestablePreview { } } -@MainActor private extension HomeScreenRoom { static var dmInvite: HomeScreenRoom { let inviter = RoomMemberProxyMock() diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenKnockedCell.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenKnockedCell.swift index 1dcc7933b..0f022868c 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenKnockedCell.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenKnockedCell.swift @@ -10,7 +10,6 @@ import Combine import Compound import SwiftUI -@MainActor struct HomeScreenKnockedCell: View { @Environment(\.dynamicTypeSize) var dynamicTypeSize @@ -141,7 +140,6 @@ struct HomeScreenKnockedCell_Previews: PreviewProvider, TestablePreview { } } -@MainActor private extension HomeScreenRoom { static var dmInvite: HomeScreenRoom { let inviter = RoomMemberProxyMock() diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomCell.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomCell.swift index 82f006b97..7e1542e0c 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomCell.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomCell.swift @@ -44,7 +44,7 @@ struct HomeScreenRoomCell: View { .accessibilityHidden(redactionReasons.contains(.placeholder) ? true : false) } - @ViewBuilder @MainActor + @ViewBuilder private var avatar: some View { if dynamicTypeSize < .accessibility3 { RoomAvatarImage(avatar: room.avatar, @@ -211,10 +211,10 @@ import MatrixRustSDKMocks struct HomeScreenRoomCell_Previews: PreviewProvider, TestablePreview { static let summaryProviderGeneric = RoomSummaryProviderMock(.init(state: .loaded(.mockRooms))) - static let genericRooms = summaryProviderGeneric.roomListPublisher.value.compactMap(mockRoom) + static let genericRooms = summaryProviderGeneric.roomListPublisher.value.compactMap { mockRoom(summary: $0) } static let summaryProviderForNotificationsState = RoomSummaryProviderMock(.init(state: .loaded(.mockRoomsWithNotificationsState))) - static let notificationsStateRooms = summaryProviderForNotificationsState.roomListPublisher.value.compactMap(mockRoom) + static let notificationsStateRooms = summaryProviderForNotificationsState.roomListPublisher.value.compactMap { mockRoom(summary: $0) } static let lastMessageStateRooms = [makeRoom(lastMessageState: .sending), makeRoom(lastMessageState: .failed)] diff --git a/ElementX/Sources/Screens/InviteUsersScreen/InviteUsersScreenViewModel.swift b/ElementX/Sources/Screens/InviteUsersScreen/InviteUsersScreenViewModel.swift index c2e9fcbc3..cf6cb219d 100644 --- a/ElementX/Sources/Screens/InviteUsersScreen/InviteUsersScreenViewModel.swift +++ b/ElementX/Sources/Screens/InviteUsersScreen/InviteUsersScreenViewModel.swift @@ -156,9 +156,11 @@ class InviteUsersScreenViewModel: InviteUsersScreenViewModelType, InviteUsersScr } } - return await group.first { inviteResult in - inviteResult.isFailure - } ?? .success(()) + for await inviteResult in group where inviteResult.isFailure { + return inviteResult + } + + return .success(()) } guard case .failure = result else { diff --git a/ElementX/Sources/Screens/InviteUsersScreen/InviteUsersScreenViewModelProtocol.swift b/ElementX/Sources/Screens/InviteUsersScreen/InviteUsersScreenViewModelProtocol.swift index 86b5f9648..2e5a08c56 100644 --- a/ElementX/Sources/Screens/InviteUsersScreen/InviteUsersScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/InviteUsersScreen/InviteUsersScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol InviteUsersScreenViewModelProtocol { var actions: AnyPublisher { get } var context: InviteUsersScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModelProtocol.swift b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModelProtocol.swift index b51b3e5e2..e1dc938b5 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol JoinRoomScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: JoinRoomScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift b/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift index a6d8e8229..4d959ff32 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift @@ -386,7 +386,6 @@ struct JoinRoomScreenSpace_Previews: PreviewProvider, TestablePreview { } } -@MainActor struct JoinRoomScreenPreviewWrapper: Identifiable { let id = UUID() let viewModel: JoinRoomScreenViewModel diff --git a/ElementX/Sources/Screens/KnockRequestsListScreen/KnockRequestsListScreenViewModelProtocol.swift b/ElementX/Sources/Screens/KnockRequestsListScreen/KnockRequestsListScreenViewModelProtocol.swift index 7e2ba9d8c..6716cc54e 100644 --- a/ElementX/Sources/Screens/KnockRequestsListScreen/KnockRequestsListScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/KnockRequestsListScreen/KnockRequestsListScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol KnockRequestsListScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: KnockRequestsListScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/KnockRequestsListScreen/View/KnockRequestCell.swift b/ElementX/Sources/Screens/KnockRequestsListScreen/View/KnockRequestCell.swift index 4ff2f0467..484a70935 100644 --- a/ElementX/Sources/Screens/KnockRequestsListScreen/View/KnockRequestCell.swift +++ b/ElementX/Sources/Screens/KnockRequestsListScreen/View/KnockRequestCell.swift @@ -29,9 +29,9 @@ struct KnockRequestCellInfo: Equatable { struct KnockRequestCell: View { let cellInfo: KnockRequestCellInfo var mediaProvider: MediaProviderProtocol? - let onAccept: ((String) -> Void)? - let onDecline: ((String) -> Void)? - let onDeclineAndBan: ((String) -> Void)? + let onAccept: (@MainActor (String) -> Void)? + let onDecline: (@MainActor (String) -> Void)? + let onDeclineAndBan: (@MainActor (String) -> Void)? var body: some View { HStack(alignment: .top, spacing: 16) { diff --git a/ElementX/Sources/Screens/LabsScreen/LabsScreenViewModelProtocol.swift b/ElementX/Sources/Screens/LabsScreen/LabsScreenViewModelProtocol.swift index e0957e842..315620d38 100644 --- a/ElementX/Sources/Screens/LabsScreen/LabsScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/LabsScreen/LabsScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol LabsScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: LabsScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/LinkNewDeviceScreen/LinkNewDeviceScreenModels.swift b/ElementX/Sources/Screens/LinkNewDeviceScreen/LinkNewDeviceScreenModels.swift index 542931ac5..c2fdb05f6 100644 --- a/ElementX/Sources/Screens/LinkNewDeviceScreen/LinkNewDeviceScreenModels.swift +++ b/ElementX/Sources/Screens/LinkNewDeviceScreen/LinkNewDeviceScreenModels.swift @@ -14,7 +14,7 @@ enum LinkNewDeviceScreenViewModelAction { } struct LinkNewDeviceScreenViewState: BindableState { - enum Mode: Equatable { + nonisolated enum Mode: Equatable { case loading case readyToLink(isGeneratingCode: Bool) case error(QRCodeLoginState.ErrorState) diff --git a/ElementX/Sources/Screens/LinkNewDeviceScreen/LinkNewDeviceScreenViewModel.swift b/ElementX/Sources/Screens/LinkNewDeviceScreen/LinkNewDeviceScreenViewModel.swift index e893aad1c..9c5ae443a 100644 --- a/ElementX/Sources/Screens/LinkNewDeviceScreen/LinkNewDeviceScreenViewModel.swift +++ b/ElementX/Sources/Screens/LinkNewDeviceScreen/LinkNewDeviceScreenViewModel.swift @@ -69,13 +69,12 @@ class LinkNewDeviceScreenViewModel: LinkNewDeviceScreenViewModelType, LinkNewDev let progressPublisher = linkNewDeviceService.linkMobileDevice() do { - _ = try await progressPublisher.values - .first { progress in - switch progress { - case .qrReady: true - default: false - } + var iterator = progressPublisher.values.makeAsyncIterator() + while let progress = try await iterator.next(isolation: #isolation) { + if case .qrReady = progress { + break } + } actionsSubject.send(.linkMobileDevice(progressPublisher)) state.mode = .readyToLink(isGeneratingCode: false) diff --git a/ElementX/Sources/Screens/LinkNewDeviceScreen/LinkNewDeviceScreenViewModelProtocol.swift b/ElementX/Sources/Screens/LinkNewDeviceScreen/LinkNewDeviceScreenViewModelProtocol.swift index 4f2123c0c..4d74143b9 100644 --- a/ElementX/Sources/Screens/LinkNewDeviceScreen/LinkNewDeviceScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/LinkNewDeviceScreen/LinkNewDeviceScreenViewModelProtocol.swift @@ -7,7 +7,6 @@ import Combine -@MainActor protocol LinkNewDeviceScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: LinkNewDeviceScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/LocationSharing/LocationSharingScreenViewModelProtocol.swift b/ElementX/Sources/Screens/LocationSharing/LocationSharingScreenViewModelProtocol.swift index 5b6bcd2c1..317ed0e53 100644 --- a/ElementX/Sources/Screens/LocationSharing/LocationSharingScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/LocationSharing/LocationSharingScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol LocationSharingScreenViewModelProtocol { var actions: AnyPublisher { get } var context: LocationSharingScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/LogViewerScreen/LogViewerScreenViewModelProtocol.swift b/ElementX/Sources/Screens/LogViewerScreen/LogViewerScreenViewModelProtocol.swift index 5edeab707..a9f4152da 100644 --- a/ElementX/Sources/Screens/LogViewerScreen/LogViewerScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/LogViewerScreen/LogViewerScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol LogViewerScreenViewModelProtocol { var actions: AnyPublisher { get } var context: LogViewerScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/ManageAuthorizedSpacesScreen/ManageAuthorizedSpacesScreenViewModelProtocol.swift b/ElementX/Sources/Screens/ManageAuthorizedSpacesScreen/ManageAuthorizedSpacesScreenViewModelProtocol.swift index fbc286327..ccc982132 100644 --- a/ElementX/Sources/Screens/ManageAuthorizedSpacesScreen/ManageAuthorizedSpacesScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/ManageAuthorizedSpacesScreen/ManageAuthorizedSpacesScreenViewModelProtocol.swift @@ -7,7 +7,6 @@ import Combine -@MainActor protocol ManageAuthorizedSpacesScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: ManageAuthorizedSpacesScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/ManageRoomMemberSheet/ManageRoomMemberSheetViewModelProtocol.swift b/ElementX/Sources/Screens/ManageRoomMemberSheet/ManageRoomMemberSheetViewModelProtocol.swift index 0ff85aa61..ed940c937 100644 --- a/ElementX/Sources/Screens/ManageRoomMemberSheet/ManageRoomMemberSheetViewModelProtocol.swift +++ b/ElementX/Sources/Screens/ManageRoomMemberSheet/ManageRoomMemberSheetViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol ManageRoomMemberSheetViewModelProtocol { var actions: AnyPublisher { get } var context: ManageRoomMemberSheetViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/MediaEventsTimelineScreen/MediaEventsTimelineScreenViewModelProtocol.swift b/ElementX/Sources/Screens/MediaEventsTimelineScreen/MediaEventsTimelineScreenViewModelProtocol.swift index e623a13b6..dfe895899 100644 --- a/ElementX/Sources/Screens/MediaEventsTimelineScreen/MediaEventsTimelineScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/MediaEventsTimelineScreen/MediaEventsTimelineScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol MediaEventsTimelineScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: MediaEventsTimelineScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/MediaUploadPreviewScreen/MediaUploadPreviewScreenViewModel.swift b/ElementX/Sources/Screens/MediaUploadPreviewScreen/MediaUploadPreviewScreenViewModel.swift index ee3925712..db0ab9031 100644 --- a/ElementX/Sources/Screens/MediaUploadPreviewScreen/MediaUploadPreviewScreenViewModel.swift +++ b/ElementX/Sources/Screens/MediaUploadPreviewScreen/MediaUploadPreviewScreenViewModel.swift @@ -125,7 +125,7 @@ class MediaUploadPreviewScreenViewModel: MediaUploadPreviewScreenViewModelType, } private func sendAttachment(mediaInfo: MediaInfo, caption: String?) async -> Result { - let requestHandle: ((SendAttachmentJoinHandleProtocol) -> Void) = { [weak self] handle in + let requestHandle: (@MainActor @Sendable (SendAttachmentJoinHandleProtocol) -> Void) = { [weak self] handle in self?.requestHandle = handle } diff --git a/ElementX/Sources/Screens/MediaUploadPreviewScreen/MediaUploadPreviewScreenViewModelProtocol.swift b/ElementX/Sources/Screens/MediaUploadPreviewScreen/MediaUploadPreviewScreenViewModelProtocol.swift index b35dea0ca..2181a4620 100644 --- a/ElementX/Sources/Screens/MediaUploadPreviewScreen/MediaUploadPreviewScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/MediaUploadPreviewScreen/MediaUploadPreviewScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol MediaUploadPreviewScreenViewModelProtocol { var actions: AnyPublisher { get } var context: MediaUploadPreviewScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/MessageForwardingScreen/MessageForwardingScreenViewModelProtocol.swift b/ElementX/Sources/Screens/MessageForwardingScreen/MessageForwardingScreenViewModelProtocol.swift index 4b1145b74..59665afd4 100644 --- a/ElementX/Sources/Screens/MessageForwardingScreen/MessageForwardingScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/MessageForwardingScreen/MessageForwardingScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol MessageForwardingScreenViewModelProtocol { var actions: AnyPublisher { get } var context: MessageForwardingScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/MessageForwardingScreen/View/MessageForwardingScreen.swift b/ElementX/Sources/Screens/MessageForwardingScreen/View/MessageForwardingScreen.swift index 5311fbb5e..6fe6150ba 100644 --- a/ElementX/Sources/Screens/MessageForwardingScreen/View/MessageForwardingScreen.swift +++ b/ElementX/Sources/Screens/MessageForwardingScreen/View/MessageForwardingScreen.swift @@ -79,7 +79,7 @@ private struct MessageForwardingListRow: View { }) } - @ViewBuilder @MainActor + @ViewBuilder var avatar: some View { if dynamicTypeSize < .accessibility3 { RoomAvatarImage(avatar: room.avatar, diff --git a/ElementX/Sources/Screens/Onboarding/AnalyticsPromptScreen/AnalyticsPromptScreenViewModelProtocol.swift b/ElementX/Sources/Screens/Onboarding/AnalyticsPromptScreen/AnalyticsPromptScreenViewModelProtocol.swift index cc946c879..91ca38733 100644 --- a/ElementX/Sources/Screens/Onboarding/AnalyticsPromptScreen/AnalyticsPromptScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/Onboarding/AnalyticsPromptScreen/AnalyticsPromptScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol AnalyticsPromptScreenViewModelProtocol { var actions: AnyPublisher { get } var context: AnalyticsPromptScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/Onboarding/IdentityConfirmationScreen/IdentityConfirmationScreenViewModelProtocol.swift b/ElementX/Sources/Screens/Onboarding/IdentityConfirmationScreen/IdentityConfirmationScreenViewModelProtocol.swift index c9f6050aa..8fd24e254 100644 --- a/ElementX/Sources/Screens/Onboarding/IdentityConfirmationScreen/IdentityConfirmationScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/Onboarding/IdentityConfirmationScreen/IdentityConfirmationScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol IdentityConfirmationScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: IdentityConfirmationScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/Onboarding/IdentityConfirmedScreen/IdentityConfirmedScreenViewModelProtocol.swift b/ElementX/Sources/Screens/Onboarding/IdentityConfirmedScreen/IdentityConfirmedScreenViewModelProtocol.swift index d95507840..1409c6840 100644 --- a/ElementX/Sources/Screens/Onboarding/IdentityConfirmedScreen/IdentityConfirmedScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/Onboarding/IdentityConfirmedScreen/IdentityConfirmedScreenViewModelProtocol.swift @@ -7,7 +7,6 @@ import Combine -@MainActor protocol IdentityConfirmedScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: IdentityConfirmedScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/Onboarding/NotificationPermissionsScreen/NotificationPermissionsScreenViewModelProtocol.swift b/ElementX/Sources/Screens/Onboarding/NotificationPermissionsScreen/NotificationPermissionsScreenViewModelProtocol.swift index b21323e46..b905ad424 100644 --- a/ElementX/Sources/Screens/Onboarding/NotificationPermissionsScreen/NotificationPermissionsScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/Onboarding/NotificationPermissionsScreen/NotificationPermissionsScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol NotificationPermissionsScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: NotificationPermissionsScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/Onboarding/SessionVerificationScreen/SessionVerificationScreenViewModelProtocol.swift b/ElementX/Sources/Screens/Onboarding/SessionVerificationScreen/SessionVerificationScreenViewModelProtocol.swift index f06191eb5..3573542c7 100644 --- a/ElementX/Sources/Screens/Onboarding/SessionVerificationScreen/SessionVerificationScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/Onboarding/SessionVerificationScreen/SessionVerificationScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol SessionVerificationScreenViewModelProtocol { var actions: AnyPublisher { get } var context: SessionVerificationViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/PinnedEventsTimelineScreen/PinnedEventsTimelineScreenViewModelProtocol.swift b/ElementX/Sources/Screens/PinnedEventsTimelineScreen/PinnedEventsTimelineScreenViewModelProtocol.swift index 33698bf79..b7f2da181 100644 --- a/ElementX/Sources/Screens/PinnedEventsTimelineScreen/PinnedEventsTimelineScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/PinnedEventsTimelineScreen/PinnedEventsTimelineScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol PinnedEventsTimelineScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: PinnedEventsTimelineScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/QRCodeLoginScreen/QRCodeLoginScreenModels.swift b/ElementX/Sources/Screens/QRCodeLoginScreen/QRCodeLoginScreenModels.swift index 90d512b39..bc41174ab 100644 --- a/ElementX/Sources/Screens/QRCodeLoginScreen/QRCodeLoginScreenModels.swift +++ b/ElementX/Sources/Screens/QRCodeLoginScreen/QRCodeLoginScreenModels.swift @@ -95,7 +95,7 @@ enum QRCodeLoginScreenViewAction { case errorAction(QRCodeErrorView.Action) } -enum QRCodeLoginState: Equatable { +nonisolated enum QRCodeLoginState: Equatable { /// Initial state where the user is informed how to login this device by scanning a QR code. case loginInstructions /// Initial state where the user is informed how to link another device by scanning it's QR code. @@ -114,7 +114,7 @@ enum QRCodeLoginState: Equatable { /// Any full screen error state case error(ErrorState) - enum ErrorState: Equatable, CaseIterable { + nonisolated enum ErrorState: Equatable, CaseIterable { /// The account provider doesn't support the use of QR codes. case notSupported case noCameraPermission @@ -131,7 +131,7 @@ enum QRCodeLoginState: Equatable { case unknown } - enum ScanningState: Equatable { + nonisolated enum ScanningState: Equatable { /// The QR code is scanning. case scanning /// The QR code has been detected and is being processed. @@ -139,7 +139,7 @@ enum QRCodeLoginState: Equatable { /// The QR code was scanned, but an error occurred. case scanFailed(Error) - enum Error: Equatable { + nonisolated enum Error: Equatable { /// The QR code has been processed and is invalid. case invalid /// The QR code has been processed but it is for an account provider that isn't allowed. @@ -171,14 +171,14 @@ enum QRCodeLoginState: Equatable { } } - enum DisplayQRState: Equatable { + nonisolated enum DisplayQRState: Equatable { /// The QR code is available and is being shown. case active(UIImage) /// The QR code being shown has expired. We will need to generate a new one. case expired } - enum DisplayCodeState: Equatable { + nonisolated enum DisplayCodeState: Equatable { case deviceCode(String) case verificationCode(String) @@ -190,7 +190,7 @@ enum QRCodeLoginState: Equatable { } } - enum CheckCodeState: Equatable { + nonisolated enum CheckCodeState: Equatable { /// The user needs to input the confirmation code. case inputCode(CheckCodeSenderProxy) /// The code supplied by the user didn't pass local validation. diff --git a/ElementX/Sources/Screens/QRCodeLoginScreen/QRCodeLoginScreenViewModelProtocol.swift b/ElementX/Sources/Screens/QRCodeLoginScreen/QRCodeLoginScreenViewModelProtocol.swift index 13b9d61c4..894f980e2 100644 --- a/ElementX/Sources/Screens/QRCodeLoginScreen/QRCodeLoginScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/QRCodeLoginScreen/QRCodeLoginScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol QRCodeLoginScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: QRCodeLoginScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/QRCodeLoginScreen/View/QRCodeScannerView.swift b/ElementX/Sources/Screens/QRCodeLoginScreen/View/QRCodeScannerView.swift index 364863293..8ed165e5b 100644 --- a/ElementX/Sources/Screens/QRCodeLoginScreen/View/QRCodeScannerView.swift +++ b/ElementX/Sources/Screens/QRCodeLoginScreen/View/QRCodeScannerView.swift @@ -109,17 +109,19 @@ final class QRScannerController: UIViewController { } func startScan() { - // Start video capture. + // AVCaptureSession start/stop are blocking calls that Apple documents should be + // made off the main thread, the session synchronises access internally. + nonisolated(unsafe) let captureSession = captureSession DispatchQueue.global(qos: .userInitiated).async { - self.captureSession.startRunning() + captureSession.startRunning() MXLog.info("QRCodeScannerView: capture session started") } } func stopScan() { - // Stop video capture. + nonisolated(unsafe) let captureSession = captureSession DispatchQueue.global(qos: .userInitiated).async { - self.captureSession.stopRunning() + captureSession.stopRunning() MXLog.info("QRCodeScannerView: capture session stopped") } } diff --git a/ElementX/Sources/Screens/ReportContentScreen/ReportContentScreenViewModelProtocol.swift b/ElementX/Sources/Screens/ReportContentScreen/ReportContentScreenViewModelProtocol.swift index cafa3d12f..412d63d40 100644 --- a/ElementX/Sources/Screens/ReportContentScreen/ReportContentScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/ReportContentScreen/ReportContentScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol ReportContentScreenViewModelProtocol { var actions: AnyPublisher { get } var context: ReportContentScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/ReportRoomScreen/ReportRoomScreenViewModelProtocol.swift b/ElementX/Sources/Screens/ReportRoomScreen/ReportRoomScreenViewModelProtocol.swift index 7cb7a4fd2..d0cbfa63b 100644 --- a/ElementX/Sources/Screens/ReportRoomScreen/ReportRoomScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/ReportRoomScreen/ReportRoomScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol ReportRoomScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: ReportRoomScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/ResolveVerifiedUserSendFailureScreen/ResolveVerifiedUserSendFailureScreenViewModel.swift b/ElementX/Sources/Screens/ResolveVerifiedUserSendFailureScreen/ResolveVerifiedUserSendFailureScreenViewModel.swift index 058a46bbd..833bcb37b 100644 --- a/ElementX/Sources/Screens/ResolveVerifiedUserSendFailureScreen/ResolveVerifiedUserSendFailureScreenViewModel.swift +++ b/ElementX/Sources/Screens/ResolveVerifiedUserSendFailureScreen/ResolveVerifiedUserSendFailureScreenViewModel.swift @@ -111,7 +111,6 @@ class ResolveVerifiedUserSendFailureScreenViewModel: ResolveVerifiedUserSendFail // MARK: - Iterators -@MainActor private protocol VerifiedUserSendFailureIterator { func next() -> (userID: String, failure: TimelineItemSendFailure.VerifiedUser)? } diff --git a/ElementX/Sources/Screens/ResolveVerifiedUserSendFailureScreen/ResolveVerifiedUserSendFailureScreenViewModelProtocol.swift b/ElementX/Sources/Screens/ResolveVerifiedUserSendFailureScreen/ResolveVerifiedUserSendFailureScreenViewModelProtocol.swift index c8cfabc54..6bf661668 100644 --- a/ElementX/Sources/Screens/ResolveVerifiedUserSendFailureScreen/ResolveVerifiedUserSendFailureScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/ResolveVerifiedUserSendFailureScreen/ResolveVerifiedUserSendFailureScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol ResolveVerifiedUserSendFailureScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: ResolveVerifiedUserSendFailureScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/RoomChangePermissionsScreen/RoomChangePermissionsScreenViewModelProtocol.swift b/ElementX/Sources/Screens/RoomChangePermissionsScreen/RoomChangePermissionsScreenViewModelProtocol.swift index d714a0f45..aa63d76b7 100644 --- a/ElementX/Sources/Screens/RoomChangePermissionsScreen/RoomChangePermissionsScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/RoomChangePermissionsScreen/RoomChangePermissionsScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol RoomChangePermissionsScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: RoomChangePermissionsScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/RoomChangeRolesScreen/RoomChangeRolesScreenViewModel.swift b/ElementX/Sources/Screens/RoomChangeRolesScreen/RoomChangeRolesScreenViewModel.swift index dbb8283ba..340a83397 100644 --- a/ElementX/Sources/Screens/RoomChangeRolesScreen/RoomChangeRolesScreenViewModel.swift +++ b/ElementX/Sources/Screens/RoomChangeRolesScreen/RoomChangeRolesScreenViewModel.swift @@ -165,7 +165,11 @@ class RoomChangeRolesScreenViewModel: RoomChangeRolesScreenViewModelType, RoomCh // A task we can await until the room's info gets modified with the new power levels. // Note: Ignore the first value as the publisher is backed by a current value subject. - let infoTask = Task { await roomProxy.infoPublisher.dropFirst().values.first { _ in true } } + let infoTask = Task { + var iterator = roomProxy.infoPublisher.values.makeAsyncIterator() + _ = await iterator.next(isolation: #isolation) // The publisher's current value. + _ = await iterator.next(isolation: #isolation) + } switch await roomProxy.updatePowerLevelsForUsers(promotingUpdates + demotingUpdates) { case .success: diff --git a/ElementX/Sources/Screens/RoomChangeRolesScreen/RoomChangeRolesScreenViewModelProtocol.swift b/ElementX/Sources/Screens/RoomChangeRolesScreen/RoomChangeRolesScreenViewModelProtocol.swift index 84fbca245..94ff3b95b 100644 --- a/ElementX/Sources/Screens/RoomChangeRolesScreen/RoomChangeRolesScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/RoomChangeRolesScreen/RoomChangeRolesScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol RoomChangeRolesScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: RoomChangeRolesScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/RoomDetailsEditScreen/RoomDetailsEditScreenViewModel.swift b/ElementX/Sources/Screens/RoomDetailsEditScreen/RoomDetailsEditScreenViewModel.swift index d5503f7e7..8a2ff4e3e 100644 --- a/ElementX/Sources/Screens/RoomDetailsEditScreen/RoomDetailsEditScreenViewModel.swift +++ b/ElementX/Sources/Screens/RoomDetailsEditScreen/RoomDetailsEditScreenViewModel.swift @@ -138,23 +138,19 @@ class RoomDetailsEditScreenViewModel: RoomDetailsEditScreenViewModelType, RoomDe try await withThrowingTaskGroup(of: Void.self) { group in if state.avatarDidChange { group.addTask { - if let localMedia = await self.state.localMedia { - try await self.roomProxy.uploadAvatar(media: localMedia).get() - } else if await self.state.avatarURL == nil { - try await self.roomProxy.removeAvatar().get() - } + try await self.saveAvatar() } } if state.nameDidChange { group.addTask { - try await self.roomProxy.setName(self.state.bindings.name).get() + try await self.saveName() } } if state.topicDidChange { group.addTask { - try await self.roomProxy.setTopic(self.state.bindings.topic).get() + try await self.saveTopic() } } @@ -168,4 +164,20 @@ class RoomDetailsEditScreenViewModel: RoomDetailsEditScreenViewModelType, RoomDe message: L10n.screenRoomDetailsEditionError) } } + + private func saveAvatar() async throws { + if let localMedia = state.localMedia { + try await roomProxy.uploadAvatar(media: localMedia).get() + } else if state.avatarURL == nil { + try await roomProxy.removeAvatar().get() + } + } + + private func saveName() async throws { + try await roomProxy.setName(state.bindings.name).get() + } + + private func saveTopic() async throws { + try await roomProxy.setTopic(state.bindings.topic).get() + } } diff --git a/ElementX/Sources/Screens/RoomDetailsEditScreen/RoomDetailsEditScreenViewModelProtocol.swift b/ElementX/Sources/Screens/RoomDetailsEditScreen/RoomDetailsEditScreenViewModelProtocol.swift index 697574de6..f4eca910a 100644 --- a/ElementX/Sources/Screens/RoomDetailsEditScreen/RoomDetailsEditScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/RoomDetailsEditScreen/RoomDetailsEditScreenViewModelProtocol.swift @@ -9,7 +9,6 @@ import Combine import Foundation -@MainActor protocol RoomDetailsEditScreenViewModelProtocol { var actions: AnyPublisher { get } var context: RoomDetailsEditScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/RoomDetailsScreen/RoomDetailsScreenViewModelProtocol.swift b/ElementX/Sources/Screens/RoomDetailsScreen/RoomDetailsScreenViewModelProtocol.swift index 7008412e1..4c91a440e 100644 --- a/ElementX/Sources/Screens/RoomDetailsScreen/RoomDetailsScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/RoomDetailsScreen/RoomDetailsScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol RoomDetailsScreenViewModelProtocol { var actions: AnyPublisher { get } var context: RoomDetailsScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/RoomDirectorySearchScreen/RoomDirectorySearchScreenScreenModelProtocol.swift b/ElementX/Sources/Screens/RoomDirectorySearchScreen/RoomDirectorySearchScreenScreenModelProtocol.swift index a457f4fd6..95526d41e 100644 --- a/ElementX/Sources/Screens/RoomDirectorySearchScreen/RoomDirectorySearchScreenScreenModelProtocol.swift +++ b/ElementX/Sources/Screens/RoomDirectorySearchScreen/RoomDirectorySearchScreenScreenModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol RoomDirectorySearchScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: RoomDirectorySearchScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/RoomMemberDetailsScreen/RoomMemberDetailsScreenViewModel.swift b/ElementX/Sources/Screens/RoomMemberDetailsScreen/RoomMemberDetailsScreenViewModel.swift index 9b4ef47e5..504ef0e3f 100644 --- a/ElementX/Sources/Screens/RoomMemberDetailsScreen/RoomMemberDetailsScreenViewModel.swift +++ b/ElementX/Sources/Screens/RoomMemberDetailsScreen/RoomMemberDetailsScreenViewModel.swift @@ -142,7 +142,6 @@ class RoomMemberDetailsScreenViewModel: RoomMemberDetailsScreenViewModelType, Ro } } - @MainActor private func unignoreUser() async { guard let roomMemberProxy else { fatalError() @@ -164,7 +163,7 @@ class RoomMemberDetailsScreenViewModel: RoomMemberDetailsScreenViewModelType, Ro } private func updateMembers() { - Task.detached { + Task { await self.roomProxy.updateMembers() } } diff --git a/ElementX/Sources/Screens/RoomMemberDetailsScreen/RoomMemberDetailsScreenViewModelProtocol.swift b/ElementX/Sources/Screens/RoomMemberDetailsScreen/RoomMemberDetailsScreenViewModelProtocol.swift index 2637cfc85..7112d3e95 100644 --- a/ElementX/Sources/Screens/RoomMemberDetailsScreen/RoomMemberDetailsScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/RoomMemberDetailsScreen/RoomMemberDetailsScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol RoomMemberDetailsScreenViewModelProtocol { var actions: AnyPublisher { get } var context: RoomMemberDetailsScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/RoomMemberListScreen/RoomMembersListScreenModels.swift b/ElementX/Sources/Screens/RoomMemberListScreen/RoomMembersListScreenModels.swift index 270b71ab3..776a8a8b8 100644 --- a/ElementX/Sources/Screens/RoomMemberListScreen/RoomMembersListScreenModels.swift +++ b/ElementX/Sources/Screens/RoomMemberListScreen/RoomMembersListScreenModels.swift @@ -30,7 +30,7 @@ enum RoomMembersListScreenMode { case banned } -struct RoomMemberListScreenEntry: Equatable { +nonisolated struct RoomMemberListScreenEntry: Equatable { let member: RoomMemberDetails let verificationState: UserIdentityVerificationState } diff --git a/ElementX/Sources/Screens/RoomMemberListScreen/RoomMembersListScreenViewModel.swift b/ElementX/Sources/Screens/RoomMemberListScreen/RoomMembersListScreenViewModel.swift index 7e92d7182..694805f3a 100644 --- a/ElementX/Sources/Screens/RoomMemberListScreen/RoomMembersListScreenViewModel.swift +++ b/ElementX/Sources/Screens/RoomMemberListScreen/RoomMembersListScreenViewModel.swift @@ -123,7 +123,10 @@ class RoomMembersListScreenViewModel: RoomMembersListScreenViewModelType, RoomMe } private func buildMembersDetails(members: [RoomMemberProxyProtocol]) async -> RoomMembersDetails { - await Task.detached { [userSession, roomProxy] in + // We don't care about identity statuses on non-encrypted rooms + let isEncrypted = roomProxy.infoPublisher.value.isEncrypted + + return await Task.detached { [weak self] in // accessing RoomMember's properties is very slow. We need to do it in a background thread. var invitedMembers: [RoomMemberListScreenEntry] = .init() var joinedMembers: [RoomMemberListScreenEntry] = .init() @@ -131,10 +134,8 @@ class RoomMembersListScreenViewModel: RoomMembersListScreenViewModelType, RoomMe for member in members { var verificationState: UserIdentityVerificationState = .notVerified - if roomProxy.infoPublisher.value.isEncrypted, // We don't care about identity statuses on non-encrypted rooms - case let .success(userIdentity) = await userSession.clientProxy.userIdentity(for: member.userID, fallBackToServer: false), - let userIdentity { - verificationState = userIdentity.verificationState + if isEncrypted, let fetchedState = await self?.userIdentityVerificationState(for: member.userID) { + verificationState = fetchedState } switch member.membership { @@ -156,6 +157,15 @@ class RoomMembersListScreenViewModel: RoomMembersListScreenViewModelType, RoomMe .value } + /// The client proxy isn't Sendable, fetch identities through this helper so + /// that it never leaves the main actor. + private func userIdentityVerificationState(for userID: String) async -> UserIdentityVerificationState? { + guard case let .success(userIdentity) = await userSession.clientProxy.userIdentity(for: userID, fallBackToServer: false) else { + return nil + } + return userIdentity?.verificationState + } + private func selectMember(_ member: RoomMemberDetails) { guard currentUserProxy?.userID != member.id else { showMemberDetails(member) @@ -226,7 +236,7 @@ class RoomMembersListScreenViewModel: RoomMembersListScreenViewModelType, RoomMe } } -private struct RoomMembersDetails { +private nonisolated struct RoomMembersDetails { var invitedMembers: [RoomMemberListScreenEntry] var joinedMembers: [RoomMemberListScreenEntry] var bannedMembers: [RoomMemberListScreenEntry] diff --git a/ElementX/Sources/Screens/RoomMemberListScreen/RoomMembersListScreenViewModelProtocol.swift b/ElementX/Sources/Screens/RoomMemberListScreen/RoomMembersListScreenViewModelProtocol.swift index f31504ed2..6f157558f 100644 --- a/ElementX/Sources/Screens/RoomMemberListScreen/RoomMembersListScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/RoomMemberListScreen/RoomMembersListScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol RoomMembersListScreenViewModelProtocol { var actions: AnyPublisher { get } var context: RoomMembersListScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/RoomMemberListScreen/View/RoomMembersListScreen.swift b/ElementX/Sources/Screens/RoomMemberListScreen/View/RoomMembersListScreen.swift index 20e1adf8a..3c1886151 100644 --- a/ElementX/Sources/Screens/RoomMemberListScreen/View/RoomMembersListScreen.swift +++ b/ElementX/Sources/Screens/RoomMemberListScreen/View/RoomMembersListScreen.swift @@ -128,7 +128,6 @@ struct RoomMembersListScreen: View { } } -@MainActor private enum MembersSection { case joined case invited diff --git a/ElementX/Sources/Screens/RoomNotificationSettingsScreen/RoomNotificationSettingsScreenViewModelProtocol.swift b/ElementX/Sources/Screens/RoomNotificationSettingsScreen/RoomNotificationSettingsScreenViewModelProtocol.swift index 2cf6c18d7..65e2af59e 100644 --- a/ElementX/Sources/Screens/RoomNotificationSettingsScreen/RoomNotificationSettingsScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/RoomNotificationSettingsScreen/RoomNotificationSettingsScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol RoomNotificationSettingsScreenViewModelProtocol { var actions: AnyPublisher { get } var context: RoomNotificationSettingsScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/RoomPollsHistoryScreen/RoomPollsHistoryScreenViewModelProtocol.swift b/ElementX/Sources/Screens/RoomPollsHistoryScreen/RoomPollsHistoryScreenViewModelProtocol.swift index 68a85a557..304d2268b 100644 --- a/ElementX/Sources/Screens/RoomPollsHistoryScreen/RoomPollsHistoryScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/RoomPollsHistoryScreen/RoomPollsHistoryScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol RoomPollsHistoryScreenViewModelProtocol { var actions: AnyPublisher { get } var context: RoomPollsHistoryScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/RoomRolesAndPermissionsScreen/RoomRolesAndPermissionsScreenViewModel.swift b/ElementX/Sources/Screens/RoomRolesAndPermissionsScreen/RoomRolesAndPermissionsScreenViewModel.swift index 716b50990..e16dc0c58 100644 --- a/ElementX/Sources/Screens/RoomRolesAndPermissionsScreen/RoomRolesAndPermissionsScreenViewModel.swift +++ b/ElementX/Sources/Screens/RoomRolesAndPermissionsScreen/RoomRolesAndPermissionsScreenViewModel.swift @@ -100,7 +100,11 @@ class RoomRolesAndPermissionsScreenViewModel: RoomRolesAndPermissionsScreenViewM // A task we can await until the room's info gets modified with the new power levels. // Note: Ignore the first value as the publisher is backed by a current value subject. - let infoTask = Task { await roomProxy.infoPublisher.dropFirst().values.first { _ in true } } + let infoTask = Task { + var iterator = roomProxy.infoPublisher.values.makeAsyncIterator() + _ = await iterator.next(isolation: #isolation) // The publisher's current value. + _ = await iterator.next(isolation: #isolation) + } switch await roomProxy.updatePowerLevelsForUsers([(userID: roomProxy.ownUserID, powerLevel: role.powerLevelValue)]) { case .success: diff --git a/ElementX/Sources/Screens/RoomRolesAndPermissionsScreen/RoomRolesAndPermissionsScreenViewModelProtocol.swift b/ElementX/Sources/Screens/RoomRolesAndPermissionsScreen/RoomRolesAndPermissionsScreenViewModelProtocol.swift index 0ec0d8630..012724df7 100644 --- a/ElementX/Sources/Screens/RoomRolesAndPermissionsScreen/RoomRolesAndPermissionsScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/RoomRolesAndPermissionsScreen/RoomRolesAndPermissionsScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol RoomRolesAndPermissionsScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: RoomRolesAndPermissionsScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/ComposerToolbarViewModel.swift b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/ComposerToolbarViewModel.swift index 018da435e..0609d252a 100644 --- a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/ComposerToolbarViewModel.swift +++ b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/ComposerToolbarViewModel.swift @@ -405,7 +405,7 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool repeat { // Don't enumerate and mutate at the same time, big no no shouldMakeAnotherPass = false - attributedString.enumerateAttribute(.link, in: .init(location: 0, length: attributedString.length), options: []) { value, range, stop in + attributedString.enumerateAttribute(.link, in: .init(location: 0, length: attributedString.length), options: []) { @Sendable value, range, stop in guard let value else { return } shouldMakeAnotherPass = true @@ -429,7 +429,7 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool repeat { shouldMakeAnotherPass = false - attributedString.enumerateAttribute(.MatrixAllUsersMention, in: .init(location: 0, length: attributedString.length), options: []) { value, range, stop in + attributedString.enumerateAttribute(.MatrixAllUsersMention, in: .init(location: 0, length: attributedString.length), options: []) { @Sendable value, range, stop in guard value != nil else { return } shouldMakeAnotherPass = true diff --git a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/ComposerToolbarViewModelProtocol.swift b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/ComposerToolbarViewModelProtocol.swift index 5d503c0fb..eb10f85d4 100644 --- a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/ComposerToolbarViewModelProtocol.swift +++ b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/ComposerToolbarViewModelProtocol.swift @@ -10,7 +10,6 @@ import Combine import WysiwygComposer // periphery: ignore - markdown protocol -@MainActor protocol ComposerToolbarViewModelProtocol { var actions: AnyPublisher { get } var context: ComposerToolbarViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/FormattingToolbar.swift b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/FormattingToolbar.swift index dea0a6800..04c6e007d 100644 --- a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/FormattingToolbar.swift +++ b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/FormattingToolbar.swift @@ -38,7 +38,6 @@ struct FormattingToolbar: View { } } -@MainActor private extension FormatItem { var foregroundColor: Color { switch state { diff --git a/ElementX/Sources/Screens/RoomScreen/RoomScreenModels.swift b/ElementX/Sources/Screens/RoomScreen/RoomScreenModels.swift index 328127a1b..f728617fc 100644 --- a/ElementX/Sources/Screens/RoomScreen/RoomScreenModels.swift +++ b/ElementX/Sources/Screens/RoomScreen/RoomScreenModels.swift @@ -120,7 +120,6 @@ enum RoomScreenFooterViewDetails { case verificationViolation(member: RoomMemberProxyProtocol, learnMoreURL: URL) } -@MainActor enum PinnedEventsBannerState: Equatable { case loading(numbersOfEvents: Int) case loaded(state: PinnedEventsState) @@ -225,7 +224,6 @@ enum PinnedEventsBannerState: Equatable { } } -@MainActor struct PinnedEventsState: Equatable { var pinnedEventContents: OrderedDictionary = [:] { didSet { diff --git a/ElementX/Sources/Screens/RoomScreen/RoomScreenViewModelProtocol.swift b/ElementX/Sources/Screens/RoomScreen/RoomScreenViewModelProtocol.swift index 883324297..6878d7242 100644 --- a/ElementX/Sources/Screens/RoomScreen/RoomScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/RoomScreen/RoomScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol RoomScreenViewModelProtocol { var actions: AnyPublisher { get } var context: RoomScreenViewModel.Context { get } diff --git a/ElementX/Sources/Screens/RoomScreen/View/KnockRequestsBannerView.swift b/ElementX/Sources/Screens/RoomScreen/View/KnockRequestsBannerView.swift index e85153e61..6158c9342 100644 --- a/ElementX/Sources/Screens/RoomScreen/View/KnockRequestsBannerView.swift +++ b/ElementX/Sources/Screens/RoomScreen/View/KnockRequestsBannerView.swift @@ -19,9 +19,9 @@ struct KnockRequestInfo: Equatable { struct KnockRequestsBannerView: View { let requests: [KnockRequestInfo] - let onDismiss: () -> Void - let onAccept: ((String) -> Void)? - let onViewAll: () -> Void + let onDismiss: @MainActor () -> Void + let onAccept: (@MainActor (String) -> Void)? + let onViewAll: @MainActor () -> Void var mediaProvider: MediaProviderProtocol? var body: some View { @@ -50,9 +50,9 @@ struct KnockRequestsBannerView: View { private struct SingleKnockRequestBannerContent: View { let request: KnockRequestInfo - let onDismiss: () -> Void - let onAccept: ((String) -> Void)? - let onViewAll: () -> Void + let onDismiss: @MainActor () -> Void + let onAccept: (@MainActor (String) -> Void)? + let onViewAll: @MainActor () -> Void var mediaProvider: MediaProviderProtocol? var body: some View { @@ -118,8 +118,8 @@ private struct SingleKnockRequestBannerContent: View { private struct MultipleKnockRequestsBannerContent: View { let requests: [KnockRequestInfo] - let onDismiss: () -> Void - let onViewAll: () -> Void + let onDismiss: @MainActor () -> Void + let onViewAll: @MainActor () -> Void var mediaProvider: MediaProviderProtocol? private var avatars: [StackedAvatarInfo] { @@ -162,7 +162,7 @@ private struct MultipleKnockRequestsBannerContent: View { } private struct KnockRequestsBannerDismissButton: View { - let onDismiss: () -> Void + let onDismiss: @MainActor () -> Void var body: some View { Button { diff --git a/ElementX/Sources/Screens/RoomSelectionScreen/RoomSelectionScreenViewModelProtocol.swift b/ElementX/Sources/Screens/RoomSelectionScreen/RoomSelectionScreenViewModelProtocol.swift index 12d8c8699..95cf3bc18 100644 --- a/ElementX/Sources/Screens/RoomSelectionScreen/RoomSelectionScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/RoomSelectionScreen/RoomSelectionScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol RoomSelectionScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: RoomSelectionScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/RoomSelectionScreen/View/RoomSelectionScreen.swift b/ElementX/Sources/Screens/RoomSelectionScreen/View/RoomSelectionScreen.swift index 79b05f130..22493e52b 100644 --- a/ElementX/Sources/Screens/RoomSelectionScreen/View/RoomSelectionScreen.swift +++ b/ElementX/Sources/Screens/RoomSelectionScreen/View/RoomSelectionScreen.swift @@ -78,7 +78,7 @@ private struct RoomSelectionListRow: View { }) } - @ViewBuilder @MainActor + @ViewBuilder var avatar: some View { if dynamicTypeSize < .accessibility3 { RoomAvatarImage(avatar: room.avatar, diff --git a/ElementX/Sources/Screens/RoomThreadListScreen/RoomThreadListScreenViewModelProtocol.swift b/ElementX/Sources/Screens/RoomThreadListScreen/RoomThreadListScreenViewModelProtocol.swift index 876dc9d26..081518779 100644 --- a/ElementX/Sources/Screens/RoomThreadListScreen/RoomThreadListScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/RoomThreadListScreen/RoomThreadListScreenViewModelProtocol.swift @@ -7,7 +7,6 @@ import Combine -@MainActor protocol RoomThreadListScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: RoomThreadListScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/SecureBackup/SecureBackupKeyBackupScreen/SecureBackupKeyBackupScreenViewModelProtocol.swift b/ElementX/Sources/Screens/SecureBackup/SecureBackupKeyBackupScreen/SecureBackupKeyBackupScreenViewModelProtocol.swift index d776518fc..fa1278f88 100644 --- a/ElementX/Sources/Screens/SecureBackup/SecureBackupKeyBackupScreen/SecureBackupKeyBackupScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/SecureBackup/SecureBackupKeyBackupScreen/SecureBackupKeyBackupScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol SecureBackupKeyBackupScreenViewModelProtocol { var actions: AnyPublisher { get } var context: SecureBackupKeyBackupScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/SecureBackup/SecureBackupLogoutConfirmationScreen/SecureBackupLogoutConfirmationScreenModels.swift b/ElementX/Sources/Screens/SecureBackup/SecureBackupLogoutConfirmationScreen/SecureBackupLogoutConfirmationScreenModels.swift index 91604b53f..601b05cfb 100644 --- a/ElementX/Sources/Screens/SecureBackup/SecureBackupLogoutConfirmationScreen/SecureBackupLogoutConfirmationScreenModels.swift +++ b/ElementX/Sources/Screens/SecureBackup/SecureBackupLogoutConfirmationScreen/SecureBackupLogoutConfirmationScreenModels.swift @@ -14,7 +14,7 @@ enum SecureBackupLogoutConfirmationScreenViewModelAction { case logout } -enum SecureBackupLogoutConfirmationScreenViewMode: Equatable { +nonisolated enum SecureBackupLogoutConfirmationScreenViewMode: Equatable { case saveRecoveryKey case waitingToStart(hasStalled: Bool) case backupOngoing(progress: Double) diff --git a/ElementX/Sources/Screens/SecureBackup/SecureBackupLogoutConfirmationScreen/SecureBackupLogoutConfirmationScreenViewModelProtocol.swift b/ElementX/Sources/Screens/SecureBackup/SecureBackupLogoutConfirmationScreen/SecureBackupLogoutConfirmationScreenViewModelProtocol.swift index 69b3779b7..4c9b6f58b 100644 --- a/ElementX/Sources/Screens/SecureBackup/SecureBackupLogoutConfirmationScreen/SecureBackupLogoutConfirmationScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/SecureBackup/SecureBackupLogoutConfirmationScreen/SecureBackupLogoutConfirmationScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol SecureBackupLogoutConfirmationScreenViewModelProtocol { var actions: AnyPublisher { get } var context: SecureBackupLogoutConfirmationScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/SecureBackup/SecureBackupRecoveryKeyScreen/SecureBackupRecoveryKeyScreenViewModelProtocol.swift b/ElementX/Sources/Screens/SecureBackup/SecureBackupRecoveryKeyScreen/SecureBackupRecoveryKeyScreenViewModelProtocol.swift index 007567133..ff90a30a1 100644 --- a/ElementX/Sources/Screens/SecureBackup/SecureBackupRecoveryKeyScreen/SecureBackupRecoveryKeyScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/SecureBackup/SecureBackupRecoveryKeyScreen/SecureBackupRecoveryKeyScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol SecureBackupRecoveryKeyScreenViewModelProtocol { var actions: AnyPublisher { get } var context: SecureBackupRecoveryKeyScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/SecureBackup/SecureBackupScreen/SecureBackupScreenViewModelProtocol.swift b/ElementX/Sources/Screens/SecureBackup/SecureBackupScreen/SecureBackupScreenViewModelProtocol.swift index 14a70d85d..0ec1e9c5b 100644 --- a/ElementX/Sources/Screens/SecureBackup/SecureBackupScreen/SecureBackupScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/SecureBackup/SecureBackupScreen/SecureBackupScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol SecureBackupScreenViewModelProtocol { var actions: AnyPublisher { get } var context: SecureBackupScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/SecurityAndPrivacyScreen/SecurityAndPrivacyScreenViewModel.swift b/ElementX/Sources/Screens/SecurityAndPrivacyScreen/SecurityAndPrivacyScreenViewModel.swift index dd6f27f06..196e8a6ad 100644 --- a/ElementX/Sources/Screens/SecurityAndPrivacyScreen/SecurityAndPrivacyScreenViewModel.swift +++ b/ElementX/Sources/Screens/SecurityAndPrivacyScreen/SecurityAndPrivacyScreenViewModel.swift @@ -105,6 +105,9 @@ class SecurityAndPrivacyScreenViewModel: SecurityAndPrivacyScreenViewModelType, .drop { !$0.canEditAddress } .map(\.bindings.desiredSettings.accessType) .removeDuplicates() + // Only react to the user changing the access type, the room's initial + // state shouldn't reset the visibility it reports. + .dropFirst() // To allow the view to update properly .receive(on: DispatchQueue.main) .sink { [weak self] accessType in diff --git a/ElementX/Sources/Screens/SecurityAndPrivacyScreen/SecurityAndPrivacyScreenViewModelProtocol.swift b/ElementX/Sources/Screens/SecurityAndPrivacyScreen/SecurityAndPrivacyScreenViewModelProtocol.swift index 0ba9e90e0..cb53e4626 100644 --- a/ElementX/Sources/Screens/SecurityAndPrivacyScreen/SecurityAndPrivacyScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/SecurityAndPrivacyScreen/SecurityAndPrivacyScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol SecurityAndPrivacyScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: SecurityAndPrivacyScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/Settings/AccountSettings/OAuthAccountSettingsPresenter.swift b/ElementX/Sources/Screens/Settings/AccountSettings/OAuthAccountSettingsPresenter.swift index 573e18ac8..be0cd66cf 100644 --- a/ElementX/Sources/Screens/Settings/AccountSettings/OAuthAccountSettingsPresenter.swift +++ b/ElementX/Sources/Screens/Settings/AccountSettings/OAuthAccountSettingsPresenter.swift @@ -14,7 +14,6 @@ import AuthenticationServices /// meaning that the user doesn't need to sign in again. `SFSafariViewController` doesn't /// have access to this session, and for some reason `prefersEphemeralWebBrowserSession` /// isn't sharing the session back to Safari. -@MainActor class OAuthAccountSettingsPresenter: NSObject { private let accountURL: URL private let redirectURL: URL diff --git a/ElementX/Sources/Screens/Settings/AdvancedSettingsScreen/AdvancedSettingsScreenViewModelProtocol.swift b/ElementX/Sources/Screens/Settings/AdvancedSettingsScreen/AdvancedSettingsScreenViewModelProtocol.swift index a1bc40bcd..d918236b3 100644 --- a/ElementX/Sources/Screens/Settings/AdvancedSettingsScreen/AdvancedSettingsScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/Settings/AdvancedSettingsScreen/AdvancedSettingsScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol AdvancedSettingsScreenViewModelProtocol { var context: AdvancedSettingsScreenViewModelType.Context { get } } diff --git a/ElementX/Sources/Screens/Settings/AnalyticsSettingsScreen/AnalyticsSettingsScreenViewModelProtocol.swift b/ElementX/Sources/Screens/Settings/AnalyticsSettingsScreen/AnalyticsSettingsScreenViewModelProtocol.swift index 3471e51e0..7a2dfaa1d 100644 --- a/ElementX/Sources/Screens/Settings/AnalyticsSettingsScreen/AnalyticsSettingsScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/Settings/AnalyticsSettingsScreen/AnalyticsSettingsScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol AnalyticsSettingsScreenViewModelProtocol { var context: AnalyticsSettingsScreenViewModelType.Context { get } } diff --git a/ElementX/Sources/Screens/Settings/DeactivateAccountScreen/DeactivateAccountScreenViewModelProtocol.swift b/ElementX/Sources/Screens/Settings/DeactivateAccountScreen/DeactivateAccountScreenViewModelProtocol.swift index b553efa1f..643f3d1d2 100644 --- a/ElementX/Sources/Screens/Settings/DeactivateAccountScreen/DeactivateAccountScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/Settings/DeactivateAccountScreen/DeactivateAccountScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol DeactivateAccountScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: DeactivateAccountScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenViewModel.swift b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenViewModel.swift index 8b5aff060..9d9ea1977 100644 --- a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenViewModel.swift +++ b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenViewModel.swift @@ -59,7 +59,7 @@ class DeveloperOptionsScreenViewModel: DeveloperOptionsScreenViewModelType, Deve case .clearCache: actionsSubject.send(.clearCache) case .markAllRoomsAsRead: - Task.detached { + Task { await self.clientProxy?.markAllRoomsAsRead() } } diff --git a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenViewModelProtocol.swift b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenViewModelProtocol.swift index 45ef5eb95..8f143f8a7 100644 --- a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol DeveloperOptionsScreenViewModelProtocol { var actions: AnyPublisher { get } var context: DeveloperOptionsScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/Settings/LegalInformationScreen/LegalInformationScreenViewModelProtocol.swift b/ElementX/Sources/Screens/Settings/LegalInformationScreen/LegalInformationScreenViewModelProtocol.swift index 0bce5c9ff..c39061edb 100644 --- a/ElementX/Sources/Screens/Settings/LegalInformationScreen/LegalInformationScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/Settings/LegalInformationScreen/LegalInformationScreenViewModelProtocol.swift @@ -9,7 +9,6 @@ import Combine // periphery:ignore - markdown protocol -@MainActor protocol LegalInformationScreenViewModelProtocol { var context: LegalInformationScreenViewModelType.Context { get } } diff --git a/ElementX/Sources/Screens/Settings/NotificationSettingsEditScreen/NotificationSettingsEditScreenViewModelProtocol.swift b/ElementX/Sources/Screens/Settings/NotificationSettingsEditScreen/NotificationSettingsEditScreenViewModelProtocol.swift index f378d18a9..32031917e 100644 --- a/ElementX/Sources/Screens/Settings/NotificationSettingsEditScreen/NotificationSettingsEditScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/Settings/NotificationSettingsEditScreen/NotificationSettingsEditScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol NotificationSettingsEditScreenViewModelProtocol { var actions: AnyPublisher { get } var context: NotificationSettingsEditScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/Settings/NotificationSettingsEditScreen/View/NotificationSettingsEditScreenRoomCell.swift b/ElementX/Sources/Screens/Settings/NotificationSettingsEditScreen/View/NotificationSettingsEditScreenRoomCell.swift index d8b0dfb1b..d83fabcc4 100644 --- a/ElementX/Sources/Screens/Settings/NotificationSettingsEditScreen/View/NotificationSettingsEditScreenRoomCell.swift +++ b/ElementX/Sources/Screens/Settings/NotificationSettingsEditScreen/View/NotificationSettingsEditScreenRoomCell.swift @@ -28,7 +28,7 @@ struct NotificationSettingsEditScreenRoomCell: View { .accessibilityIdentifier(A11yIdentifiers.notificationSettingsEditScreen.roomName(room.name)) } - @ViewBuilder @MainActor + @ViewBuilder var avatar: some View { if dynamicTypeSize < .accessibility3 { RoomAvatarImage(avatar: room.avatar, @@ -39,7 +39,6 @@ struct NotificationSettingsEditScreenRoomCell: View { } } - @MainActor var roomDetailsLabel: ListRowDetails? { guard let mode = room.notificationMode else { return nil } return .label(title: context.viewState.strings.string(for: mode), diff --git a/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/NotificationSettingsScreenViewModelProtocol.swift b/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/NotificationSettingsScreenViewModelProtocol.swift index ae4110574..97bddecf7 100644 --- a/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/NotificationSettingsScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/NotificationSettingsScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol NotificationSettingsScreenViewModelProtocol { var actions: AnyPublisher { get } var context: NotificationSettingsScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/Settings/SettingsScreen/SettingsScreenViewModelProtocol.swift b/ElementX/Sources/Screens/Settings/SettingsScreen/SettingsScreenViewModelProtocol.swift index 3476668a8..86f773f08 100644 --- a/ElementX/Sources/Screens/Settings/SettingsScreen/SettingsScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/Settings/SettingsScreen/SettingsScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol SettingsScreenViewModelProtocol { var actions: AnyPublisher { get } var context: SettingsScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/Settings/UserDetailsEditScreen/UserDetailsEditScreenViewModel.swift b/ElementX/Sources/Screens/Settings/UserDetailsEditScreen/UserDetailsEditScreenViewModel.swift index dc2e7bf42..c041bf3bf 100644 --- a/ElementX/Sources/Screens/Settings/UserDetailsEditScreen/UserDetailsEditScreenViewModel.swift +++ b/ElementX/Sources/Screens/Settings/UserDetailsEditScreen/UserDetailsEditScreenViewModel.swift @@ -134,17 +134,13 @@ class UserDetailsEditScreenViewModel: UserDetailsEditScreenViewModelType, UserDe try await withThrowingTaskGroup(of: Void.self) { group in if state.avatarDidChange { group.addTask { - if let localMedia = await self.state.localMedia { - try await self.clientProxy.setUserAvatar(media: localMedia).get() - } else if await self.state.selectedAvatarURL == nil { - try await self.clientProxy.removeUserAvatar().get() - } + try await self.saveAvatar() } } if state.nameDidChange { group.addTask { - try await self.clientProxy.setUserDisplayName(self.state.bindings.name).get() + try await self.saveDisplayName() } } @@ -158,4 +154,16 @@ class UserDetailsEditScreenViewModel: UserDetailsEditScreenViewModelType, UserDe message: L10n.screenEditProfileError) } } + + private func saveAvatar() async throws { + if let localMedia = state.localMedia { + try await clientProxy.setUserAvatar(media: localMedia).get() + } else if state.selectedAvatarURL == nil { + try await clientProxy.removeUserAvatar().get() + } + } + + private func saveDisplayName() async throws { + try await clientProxy.setUserDisplayName(state.bindings.name).get() + } } diff --git a/ElementX/Sources/Screens/Settings/UserDetailsEditScreen/UserDetailsEditScreenViewModelProtocol.swift b/ElementX/Sources/Screens/Settings/UserDetailsEditScreen/UserDetailsEditScreenViewModelProtocol.swift index 0d03e5ba2..b0941f921 100644 --- a/ElementX/Sources/Screens/Settings/UserDetailsEditScreen/UserDetailsEditScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/Settings/UserDetailsEditScreen/UserDetailsEditScreenViewModelProtocol.swift @@ -9,7 +9,6 @@ import Combine import Foundation -@MainActor protocol UserDetailsEditScreenViewModelProtocol { var actions: AnyPublisher { get } var context: UserDetailsEditScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/Spaces/Common/SpaceRoomCell.swift b/ElementX/Sources/Screens/Spaces/Common/SpaceRoomCell.swift index 57f38e237..4ac95229d 100644 --- a/ElementX/Sources/Screens/Spaces/Common/SpaceRoomCell.swift +++ b/ElementX/Sources/Screens/Spaces/Common/SpaceRoomCell.swift @@ -89,7 +89,7 @@ struct SpaceRoomCell: View { .accessibilityIdentifier(A11yIdentifiers.spacesScreen.spaceRoomName(spaceServiceRoom.name)) } - @ViewBuilder @MainActor + @ViewBuilder private var avatar: some View { if dynamicTypeSize < .accessibility3 { RoomAvatarImage(avatar: spaceServiceRoom.avatar, diff --git a/ElementX/Sources/Screens/Spaces/SpaceAddRoomsScreen/SpaceAddRoomsScreenModels.swift b/ElementX/Sources/Screens/Spaces/SpaceAddRoomsScreen/SpaceAddRoomsScreenModels.swift index 204713155..4b63389fe 100644 --- a/ElementX/Sources/Screens/Spaces/SpaceAddRoomsScreen/SpaceAddRoomsScreenModels.swift +++ b/ElementX/Sources/Screens/Spaces/SpaceAddRoomsScreen/SpaceAddRoomsScreenModels.swift @@ -19,7 +19,7 @@ struct SpaceAddRoomsScreenViewState: BindableState { var bindings = SpaceAddRoomsScreenViewStateBindings() struct Section { - enum SectionType: Equatable { case searchResults, suggestions } + nonisolated enum SectionType: Equatable { case searchResults, suggestions } let type: SectionType let rooms: [SpaceAddRoomsScreenRoom] diff --git a/ElementX/Sources/Screens/Spaces/SpaceAddRoomsScreen/SpaceAddRoomsScreenViewModel.swift b/ElementX/Sources/Screens/Spaces/SpaceAddRoomsScreen/SpaceAddRoomsScreenViewModel.swift index 1d03056ce..c68cb931f 100644 --- a/ElementX/Sources/Screens/Spaces/SpaceAddRoomsScreen/SpaceAddRoomsScreenViewModel.swift +++ b/ElementX/Sources/Screens/Spaces/SpaceAddRoomsScreen/SpaceAddRoomsScreenViewModel.swift @@ -49,10 +49,13 @@ class SpaceAddRoomsScreenViewModel: SpaceAddRoomsScreenViewModelType, SpaceAddRo let existingRooms = spaceRoomListProxy.spaceRoomsPublisher.value suggestedRooms = await userSession.clientProxy .recentlyVisitedRooms { roomProxy in - !roomProxy.infoPublisher.value.isDirect - && !roomProxy.infoPublisher.value.isSpace - && roomProxy.infoPublisher.value.membership == .joined - && !existingRooms.contains { $0.id == roomProxy.id } + // The filter is Sendable for the mock's sake but the client proxy always calls it on the main actor. + MainActor.assumeIsolated { + !roomProxy.infoPublisher.value.isDirect + && !roomProxy.infoPublisher.value.isSpace + && roomProxy.infoPublisher.value.membership == .joined + && !existingRooms.contains { $0.id == roomProxy.id } + } } .map { .init(roomProxy: $0) } diff --git a/ElementX/Sources/Screens/Spaces/SpaceAddRoomsScreen/SpaceAddRoomsScreenViewModelProtocol.swift b/ElementX/Sources/Screens/Spaces/SpaceAddRoomsScreen/SpaceAddRoomsScreenViewModelProtocol.swift index 6738d5ab3..08dd03a49 100644 --- a/ElementX/Sources/Screens/Spaces/SpaceAddRoomsScreen/SpaceAddRoomsScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/Spaces/SpaceAddRoomsScreen/SpaceAddRoomsScreenViewModelProtocol.swift @@ -7,7 +7,6 @@ import Combine -@MainActor protocol SpaceAddRoomsScreenViewModelProtocol { var actions: AnyPublisher { get } var context: SpaceAddRoomsScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/Spaces/SpaceAddRoomsScreen/View/SpaceAddRoomsScreen.swift b/ElementX/Sources/Screens/Spaces/SpaceAddRoomsScreen/View/SpaceAddRoomsScreen.swift index 00547b34a..694b3197c 100644 --- a/ElementX/Sources/Screens/Spaces/SpaceAddRoomsScreen/View/SpaceAddRoomsScreen.swift +++ b/ElementX/Sources/Screens/Spaces/SpaceAddRoomsScreen/View/SpaceAddRoomsScreen.swift @@ -143,7 +143,7 @@ private struct SpaceAddRoomsListRow: View { }) } - @ViewBuilder @MainActor + @ViewBuilder var avatar: some View { if dynamicTypeSize < .accessibility3 { RoomAvatarImage(avatar: room.avatar, diff --git a/ElementX/Sources/Screens/Spaces/SpaceScreen/SpaceScreenViewModelProtocol.swift b/ElementX/Sources/Screens/Spaces/SpaceScreen/SpaceScreenViewModelProtocol.swift index 7ff436ecb..165453ce0 100644 --- a/ElementX/Sources/Screens/Spaces/SpaceScreen/SpaceScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/Spaces/SpaceScreen/SpaceScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol SpaceScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: SpaceScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/Spaces/SpaceScreen/View/SpaceScreen.swift b/ElementX/Sources/Screens/Spaces/SpaceScreen/View/SpaceScreen.swift index a9860193d..74dcfd86f 100644 --- a/ElementX/Sources/Screens/Spaces/SpaceScreen/View/SpaceScreen.swift +++ b/ElementX/Sources/Screens/Spaces/SpaceScreen/View/SpaceScreen.swift @@ -203,7 +203,7 @@ struct SpaceScreen_Previews: PreviewProvider, TestablePreview { SpaceScreen(context: newSpaceViewModel.context) } .previewDisplayName("New Space") - .snapshotPreferences(expect: newSpaceViewModel.context.observe(\.viewState).map(\.canEditChildren)) + .snapshotPreferences(expect: newSpaceViewModel.context.observe(\.viewState.canEditChildren)) } static func makeViewModel(isManagingRooms: Bool = false, isNewSpace: Bool = false) -> SpaceScreenViewModel { diff --git a/ElementX/Sources/Screens/Spaces/SpacesScreen/SpacesScreenViewModelProtocol.swift b/ElementX/Sources/Screens/Spaces/SpacesScreen/SpacesScreenViewModelProtocol.swift index fdadb61d9..b989584c3 100644 --- a/ElementX/Sources/Screens/Spaces/SpacesScreen/SpacesScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/Spaces/SpacesScreen/SpacesScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol SpacesScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: SpacesScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/StartChatScreen/StartChatScreenViewModelProtocol.swift b/ElementX/Sources/Screens/StartChatScreen/StartChatScreenViewModelProtocol.swift index 8bac2fc30..e33505faa 100644 --- a/ElementX/Sources/Screens/StartChatScreen/StartChatScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/StartChatScreen/StartChatScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol StartChatScreenViewModelProtocol { var actions: AnyPublisher { get } var context: StartChatScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/ThreadTimelineScreen/ThreadTimelineScreenViewModelProtocol.swift b/ElementX/Sources/Screens/ThreadTimelineScreen/ThreadTimelineScreenViewModelProtocol.swift index 24b683bf5..ef87f6259 100644 --- a/ElementX/Sources/Screens/ThreadTimelineScreen/ThreadTimelineScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/ThreadTimelineScreen/ThreadTimelineScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol ThreadTimelineScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: ThreadTimelineScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/Timeline/TimelineInteractionHandler.swift b/ElementX/Sources/Screens/Timeline/TimelineInteractionHandler.swift index e60fe1487..327dd711e 100644 --- a/ElementX/Sources/Screens/Timeline/TimelineInteractionHandler.swift +++ b/ElementX/Sources/Screens/Timeline/TimelineInteractionHandler.swift @@ -31,7 +31,6 @@ enum TimelineInteractionHandlerAction { /// The interaction handler groups logic for dealing with various actions the user can take on a timeline's /// view that would've normally been part of the ``TimelineViewModel`` -@MainActor class TimelineInteractionHandler { private let roomProxy: JoinedRoomProxyProtocol private let timelineController: TimelineControllerProtocol diff --git a/ElementX/Sources/Screens/Timeline/TimelineTableViewController.swift b/ElementX/Sources/Screens/Timeline/TimelineTableViewController.swift index cbe3ee14c..6a8ab1ec4 100644 --- a/ElementX/Sources/Screens/Timeline/TimelineTableViewController.swift +++ b/ElementX/Sources/Screens/Timeline/TimelineTableViewController.swift @@ -658,7 +658,7 @@ extension TimelineTableViewController { extension TimelineTableViewController { /// The sections of the table view used in the diffable data source. - enum TimelineSection { + nonisolated enum TimelineSection { case main case typingIndicator } diff --git a/ElementX/Sources/Screens/Timeline/TimelineViewModelProtocol.swift b/ElementX/Sources/Screens/Timeline/TimelineViewModelProtocol.swift index 1777242a8..031b2f127 100644 --- a/ElementX/Sources/Screens/Timeline/TimelineViewModelProtocol.swift +++ b/ElementX/Sources/Screens/Timeline/TimelineViewModelProtocol.swift @@ -10,7 +10,6 @@ import Combine import Foundation import SwiftUI -@MainActor protocol TimelineViewModelProtocol { var actions: AnyPublisher { get } var context: TimelineViewModel.Context { get } diff --git a/ElementX/Sources/Screens/Timeline/View/ItemMenu/TimelineItemMenu.swift b/ElementX/Sources/Screens/Timeline/View/ItemMenu/TimelineItemMenu.swift index 52192ab5e..77710c3ac 100644 --- a/ElementX/Sources/Screens/Timeline/View/ItemMenu/TimelineItemMenu.swift +++ b/ElementX/Sources/Screens/Timeline/View/ItemMenu/TimelineItemMenu.swift @@ -243,7 +243,6 @@ private struct VerifiedUserSendFailureView: View { } } -@MainActor private extension EncryptionAuthenticity { var foregroundStyle: SwiftUI.Color { switch color { diff --git a/ElementX/Sources/Screens/Timeline/View/ItemMenu/TimelineItemMenuAction.swift b/ElementX/Sources/Screens/Timeline/View/ItemMenu/TimelineItemMenuAction.swift index 6247181c9..3f40a206a 100644 --- a/ElementX/Sources/Screens/Timeline/View/ItemMenu/TimelineItemMenuAction.swift +++ b/ElementX/Sources/Screens/Timeline/View/ItemMenu/TimelineItemMenuAction.swift @@ -10,7 +10,6 @@ import OrderedCollections import SFSafeSymbols import SwiftUI -@MainActor struct TimelineItemMenuActions { let reactions: [TimelineItemMenuReaction] let actions: [TimelineItemMenuAction] diff --git a/ElementX/Sources/Screens/Timeline/View/ItemMenu/TimelineItemMenuActionProvider.swift b/ElementX/Sources/Screens/Timeline/View/ItemMenu/TimelineItemMenuActionProvider.swift index 4d44f0943..544ee3002 100644 --- a/ElementX/Sources/Screens/Timeline/View/ItemMenu/TimelineItemMenuActionProvider.swift +++ b/ElementX/Sources/Screens/Timeline/View/ItemMenu/TimelineItemMenuActionProvider.swift @@ -8,7 +8,6 @@ import Foundation -@MainActor struct TimelineItemMenuActionProvider { let timelineItem: RoomTimelineItemProtocol let canCurrentUserSendMessage: Bool diff --git a/ElementX/Sources/Screens/Timeline/View/Style/TimelineBubbleLayout.swift b/ElementX/Sources/Screens/Timeline/View/Style/TimelineBubbleLayout.swift index 55f6900e4..6f1a6b29a 100644 --- a/ElementX/Sources/Screens/Timeline/View/Style/TimelineBubbleLayout.swift +++ b/ElementX/Sources/Screens/Timeline/View/Style/TimelineBubbleLayout.swift @@ -12,7 +12,7 @@ import SwiftUI /// /// A custom layout is required as the embedded quote bubbles and code blocks should fill the entire /// width of the message bubble, without causing the width of the bubble to fill all of the available space. -struct TimelineBubbleLayout: Layout { +nonisolated struct TimelineBubbleLayout: Layout { struct Cache { var sizes = [Int: [ProposedViewSize: CGSize]]() } diff --git a/ElementX/Sources/Screens/Timeline/View/Style/TimelineItemBubbledStylerView.swift b/ElementX/Sources/Screens/Timeline/View/Style/TimelineItemBubbledStylerView.swift index 81df2a4b9..87328c894 100644 --- a/ElementX/Sources/Screens/Timeline/View/Style/TimelineItemBubbledStylerView.swift +++ b/ElementX/Sources/Screens/Timeline/View/Style/TimelineItemBubbledStylerView.swift @@ -231,7 +231,6 @@ struct TimelineItemBubbledStylerView: View { } } -@MainActor private extension EventBasedTimelineItemProtocol { var bubbleBackgroundColor: Color? { let defaultColor: Color = isOutgoing ? .compound._bgBubbleOutgoing : .compound._bgBubbleIncoming diff --git a/ElementX/Sources/Screens/Timeline/View/Style/TimelineItemSendInfoLabel.swift b/ElementX/Sources/Screens/Timeline/View/Style/TimelineItemSendInfoLabel.swift index 931097eee..5372a09d1 100644 --- a/ElementX/Sources/Screens/Timeline/View/Style/TimelineItemSendInfoLabel.swift +++ b/ElementX/Sources/Screens/Timeline/View/Style/TimelineItemSendInfoLabel.swift @@ -113,7 +113,6 @@ private struct TimelineItemSendInfoLabel: View { } /// All the data needed to render a timeline item's send info label. -@MainActor private struct TimelineItemSendInfo { enum Status { case sendingFailed @@ -200,7 +199,6 @@ private extension LiveLocationRoomTimelineItem { } } -@MainActor private extension EncryptionAuthenticity { var foregroundStyle: SwiftUI.Color { switch color { diff --git a/ElementX/Sources/Screens/Timeline/View/Supplementary/TimelineReactionsView.swift b/ElementX/Sources/Screens/Timeline/View/Supplementary/TimelineReactionsView.swift index 0a7ca42b0..8e3ac7870 100644 --- a/ElementX/Sources/Screens/Timeline/View/Supplementary/TimelineReactionsView.swift +++ b/ElementX/Sources/Screens/Timeline/View/Supplementary/TimelineReactionsView.swift @@ -9,7 +9,6 @@ import Compound import SwiftUI -@MainActor struct TimelineReactionsView: View { private let feedbackGenerator = UIImpactFeedbackGenerator(style: .heavy) @Environment(\.layoutDirection) private var layoutDirection: LayoutDirection diff --git a/ElementX/Sources/Screens/Timeline/View/TimelineItemViews/TextRoomTimelineView.swift b/ElementX/Sources/Screens/Timeline/View/TimelineItemViews/TextRoomTimelineView.swift index 379b7872d..072d3690c 100644 --- a/ElementX/Sources/Screens/Timeline/View/TimelineItemViews/TextRoomTimelineView.swift +++ b/ElementX/Sources/Screens/Timeline/View/TimelineItemViews/TextRoomTimelineView.swift @@ -55,18 +55,24 @@ struct TextRoomTimelineView: View, TextBasedRoomTimelineViewProtocol { return } + // Fetch the previews concurrently. The work stays on the main actor (the provider and + // its LPLinkMetadata are main actor bound) but each network fetch suspends, so they still + // overlap rather than running one after another. await withTaskGroup { taskGroup in for url in timelineItem.links.prefix(Self.maxLinkPreviewsToRender) { taskGroup.addTask { - if case let .success(metadata) = await context?.viewState.linkMetadataProvider?.fetchMetadataFor(url: url) { - await MainActor.run { - linkMetadata[url] = metadata - } - } + await fetchLinkPreview(for: url) } } } } + + @MainActor + private func fetchLinkPreview(for url: URL) async { + if case let .success(metadata) = await context?.viewState.linkMetadataProvider?.fetchMetadataFor(url: url) { + linkMetadata[url] = metadata + } + } } struct TextRoomTimelineView_Previews: PreviewProvider, TestablePreview { diff --git a/ElementX/Sources/Screens/Timeline/View/TimelineView.swift b/ElementX/Sources/Screens/Timeline/View/TimelineView.swift index 20cfc5e9e..e82a2a9c6 100644 --- a/ElementX/Sources/Screens/Timeline/View/TimelineView.swift +++ b/ElementX/Sources/Screens/Timeline/View/TimelineView.swift @@ -101,7 +101,6 @@ struct TimelineViewRepresentable: UIViewControllerRepresentable { // MARK: - Coordinator - @MainActor class Coordinator { let context: TimelineViewModel.Context diff --git a/ElementX/Sources/Screens/UserProfileScreen/UserProfileScreenViewModel.swift b/ElementX/Sources/Screens/UserProfileScreen/UserProfileScreenViewModel.swift index 9197f5db9..9d2e8de5d 100644 --- a/ElementX/Sources/Screens/UserProfileScreen/UserProfileScreenViewModel.swift +++ b/ElementX/Sources/Screens/UserProfileScreen/UserProfileScreenViewModel.swift @@ -74,9 +74,20 @@ class UserProfileScreenViewModel: UserProfileScreenViewModelType, UserProfileScr // MARK: - Private + // The proxies aren't Sendable, fetch through these helpers so that + // they never leave the main actor when running calls in parallel. + + private func fetchProfile() async -> Result { + await userSession.clientProxy.profile(for: state.userID) + } + + private func fetchUserIdentity() async -> Result { + await userSession.clientProxy.userIdentity(for: state.userID, fallBackToServer: true) + } + private func loadProfile() async { - async let profileResult = userSession.clientProxy.profile(for: state.userID) - async let identityResult = userSession.clientProxy.userIdentity(for: state.userID, fallBackToServer: true) + async let profileResult = fetchProfile() + async let identityResult = fetchUserIdentity() switch await profileResult { case .success(let userProfile): diff --git a/ElementX/Sources/Screens/UserProfileScreen/UserProfileScreenViewModelProtocol.swift b/ElementX/Sources/Screens/UserProfileScreen/UserProfileScreenViewModelProtocol.swift index 25aacc2bb..4ef37cbdb 100644 --- a/ElementX/Sources/Screens/UserProfileScreen/UserProfileScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/UserProfileScreen/UserProfileScreenViewModelProtocol.swift @@ -8,7 +8,6 @@ import Combine -@MainActor protocol UserProfileScreenViewModelProtocol { var actionsPublisher: AnyPublisher { get } var context: UserProfileScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Services/AlertTones/NotificationTone.swift b/ElementX/Sources/Services/AlertTones/NotificationTone.swift index 39bcc0322..88a37c0c2 100644 --- a/ElementX/Sources/Services/AlertTones/NotificationTone.swift +++ b/ElementX/Sources/Services/AlertTones/NotificationTone.swift @@ -8,7 +8,7 @@ import Foundation /// Represents a notification alert tone and its backing audio file location. -struct NotificationTone: Hashable, Comparable, Codable { +nonisolated struct NotificationTone: Hashable, Comparable, Codable { /// Display name for the tone, falling back to the filename stem. var label: String { labelOverride ?? URL(filePath: "/\(relativePath.last, default: "")").deletingPathExtension().lastPathComponent diff --git a/ElementX/Sources/Services/AlertTones/NotificationToneManager.swift b/ElementX/Sources/Services/AlertTones/NotificationToneManager.swift index f3aaf62b0..90386146d 100644 --- a/ElementX/Sources/Services/AlertTones/NotificationToneManager.swift +++ b/ElementX/Sources/Services/AlertTones/NotificationToneManager.swift @@ -10,7 +10,7 @@ import Foundation import UniformTypeIdentifiers /// Manages notification tone selection, import, conversion, and deletion. -struct NotificationToneManager: NotificationToneManagerProtocol { +nonisolated struct NotificationToneManager: NotificationToneManagerProtocol { @globalActor actor ConversionActor { static let shared = ConversionActor() @@ -44,7 +44,7 @@ struct NotificationToneManager: NotificationToneManagerProtocol { static let selectedToneFilename = "currentAlert.caf" /// Directory where user-imported custom tones are stored. - static let libraryLocation = URL.libraryDirectory.appending(components: "Sounds", "AvailableSounds", directoryHint: .isDirectory) + nonisolated static let libraryLocation = URL.libraryDirectory.appending(components: "Sounds", "AvailableSounds", directoryHint: .isDirectory) /// Creates the manager and ensures required library directories exist. init(appSettings: AppSettings) { diff --git a/ElementX/Sources/Services/AlertTones/NotificationToneManagerProtocol.swift b/ElementX/Sources/Services/AlertTones/NotificationToneManagerProtocol.swift index f5adea372..866647247 100644 --- a/ElementX/Sources/Services/AlertTones/NotificationToneManagerProtocol.swift +++ b/ElementX/Sources/Services/AlertTones/NotificationToneManagerProtocol.swift @@ -8,7 +8,7 @@ import Foundation // sourcery: AutoMockable -protocol NotificationToneManagerProtocol { +nonisolated protocol NotificationToneManagerProtocol: Sendable { @discardableResult func setSelectedTone(_ alertTone: NotificationTone) throws -> URL func customTones() -> [NotificationTone] diff --git a/ElementX/Sources/Services/AppLock/AppLockServiceProtocol.swift b/ElementX/Sources/Services/AppLock/AppLockServiceProtocol.swift index 818daaac5..c84666344 100644 --- a/ElementX/Sources/Services/AppLock/AppLockServiceProtocol.swift +++ b/ElementX/Sources/Services/AppLock/AppLockServiceProtocol.swift @@ -34,7 +34,6 @@ enum AppLockServiceBiometricResult { case interrupted } -@MainActor protocol AppLockServiceProtocol: AnyObject { /// The use of a PIN code is mandatory for this device. var isMandatory: Bool { get } diff --git a/ElementX/Sources/Services/AppLock/AppLockTimer.swift b/ElementX/Sources/Services/AppLock/AppLockTimer.swift index 03f6b95ad..1cd42c107 100644 --- a/ElementX/Sources/Services/AppLock/AppLockTimer.swift +++ b/ElementX/Sources/Services/AppLock/AppLockTimer.swift @@ -9,7 +9,7 @@ import Foundation /// A timer that adds a grace-period to the app before locking it. -class AppLockTimer { +final nonisolated class AppLockTimer { /// The amount of time the app should remain unlocked for whilst backgrounded. let gracePeriod: TimeInterval diff --git a/ElementX/Sources/Services/AppLock/LAContextMock.swift b/ElementX/Sources/Services/AppLock/LAContextMock.swift index 2ebc4ff8a..359eba741 100644 --- a/ElementX/Sources/Services/AppLock/LAContextMock.swift +++ b/ElementX/Sources/Services/AppLock/LAContextMock.swift @@ -12,7 +12,7 @@ import LocalAuthentication /// It works as the actual context does and won't update the return values of `biometryType` and /// `evaluatedPolicyDomainStateValue` until either `canEvaluatePolicy` or /// `evaluatePolicy` have been called. -class LAContextMock: LAContext { +nonisolated class LAContextMock: LAContext { var biometryTypeValue: LABiometryType! private var internalBiometryTypeValue: LABiometryType! override var biometryType: LABiometryType { diff --git a/ElementX/Sources/Services/Audio/AudioConverter.swift b/ElementX/Sources/Services/Audio/AudioConverter.swift index d26b16143..342757313 100644 --- a/ElementX/Sources/Services/Audio/AudioConverter.swift +++ b/ElementX/Sources/Services/Audio/AudioConverter.swift @@ -19,7 +19,7 @@ enum AudioConverterPreferredFileExtension: String { case ogg } -struct AudioConverter: AudioConverterProtocol { +nonisolated struct AudioConverter: AudioConverterProtocol { func convertToOpusOgg(sourceURL: URL, destinationURL: URL) throws { do { try OGGConverter.convertM4aFileToOpusOGG(src: sourceURL, dest: destinationURL) diff --git a/ElementX/Sources/Services/Audio/AudioConverterProtocol.swift b/ElementX/Sources/Services/Audio/AudioConverterProtocol.swift index b7d7b87ae..73dcb297b 100644 --- a/ElementX/Sources/Services/Audio/AudioConverterProtocol.swift +++ b/ElementX/Sources/Services/Audio/AudioConverterProtocol.swift @@ -8,7 +8,7 @@ import Foundation -protocol AudioConverterProtocol: Sendable { +nonisolated protocol AudioConverterProtocol: Sendable { func convertToOpusOgg(sourceURL: URL, destinationURL: URL) throws func convertToMPEG4AAC(sourceURL: URL, destinationURL: URL) throws } diff --git a/ElementX/Sources/Services/Audio/AudioSessionProtocol.swift b/ElementX/Sources/Services/Audio/AudioSessionProtocol.swift index cb5f00301..a7d9fd7a8 100644 --- a/ElementX/Sources/Services/Audio/AudioSessionProtocol.swift +++ b/ElementX/Sources/Services/Audio/AudioSessionProtocol.swift @@ -8,14 +8,14 @@ import AVFoundation -protocol AudioSessionProtocol: AnyObject { +nonisolated protocol AudioSessionProtocol: AnyObject, Sendable { func requestRecordPermission(_ response: @escaping (Bool) -> Void) func setAllowHapticsAndSystemSoundsDuringRecording(_ inValue: Bool) throws func setCategory(_ category: AVAudioSession.Category, mode: AVAudioSession.Mode, options: AVAudioSession.CategoryOptions) throws func setActive(_ active: Bool, options: AVAudioSession.SetActiveOptions) throws } -extension AudioSessionProtocol { +nonisolated extension AudioSessionProtocol { func setActive(_ active: Bool) throws { try setActive(active, options: []) } @@ -24,4 +24,4 @@ extension AudioSessionProtocol { // sourcery: AutoMockable extension AudioSessionProtocol { } -extension AVAudioSession: AudioSessionProtocol { } +nonisolated extension AVAudioSession: AudioSessionProtocol { } diff --git a/ElementX/Sources/Services/Audio/Player/AudioPlayer.swift b/ElementX/Sources/Services/Audio/Player/AudioPlayer.swift index 22b1591eb..e97fe1809 100644 --- a/ElementX/Sources/Services/Audio/Player/AudioPlayer.swift +++ b/ElementX/Sources/Services/Audio/Player/AudioPlayer.swift @@ -82,7 +82,7 @@ class AudioPlayer: NSObject, AudioPlayerProtocol { private var isStopped = true - deinit { + isolated deinit { deinitInProgress = true stop() unloadContent() @@ -184,31 +184,40 @@ class AudioPlayer: NSObject, AudioPlayerProtocol { return } - statusObserver = playerItem.observe(\.status, options: [.old, .new]) { [weak self] _, _ in - guard let self else { return } - - switch playerItem.status { - case .failed: - setInternalState(.error(playerItem.error ?? AudioPlayerError.genericError)) - case .readyToPlay: - guard state == .loading else { return } - setInternalState(.readyToPlay) - default: - break + statusObserver = playerItem.observe(\.status, options: [.old, .new]) { [weak self] item, _ in + // KVO fires on an arbitrary thread, hop to the main actor with the values we need. + let status = item.status + let error = item.error + Task { @MainActor [weak self] in + guard let self else { return } + + switch status { + case .failed: + setInternalState(.error(error ?? AudioPlayerError.genericError)) + case .readyToPlay: + guard state == .loading else { return } + setInternalState(.readyToPlay) + default: + break + } } } - rateObserver = internalAudioPlayer.observe(\.rate, options: [.old, .new]) { [weak self] _, _ in - guard let self else { return } - - if internalAudioPlayer.rate == 0 { - if isStopped { - setInternalState(.stopped) + rateObserver = internalAudioPlayer.observe(\.rate, options: [.old, .new]) { [weak self] player, _ in + // KVO fires on an arbitrary thread, hop to the main actor with the values we need. + let rate = player.rate + Task { @MainActor [weak self] in + guard let self else { return } + + if rate == 0 { + if isStopped { + setInternalState(.stopped) + } else { + setInternalState(.paused) + } } else { - setInternalState(.paused) + setInternalState(.playing) } - } else { - setInternalState(.playing) } } diff --git a/ElementX/Sources/Services/Audio/Player/AudioPlayerProtocol.swift b/ElementX/Sources/Services/Audio/Player/AudioPlayerProtocol.swift index e1dd16a13..cef3b57ca 100644 --- a/ElementX/Sources/Services/Audio/Player/AudioPlayerProtocol.swift +++ b/ElementX/Sources/Services/Audio/Player/AudioPlayerProtocol.swift @@ -16,7 +16,7 @@ enum AudioPlayerError: Error { /// There used to be a MediaPlayerProtocol that AudioPlayerProtocol inherited from. /// This should be called something else but we already have an AudioPlayerState, /// AudioPlayerPlaybackState and InternalAudioPlayerState so who knows what to call this. -enum MediaPlayerState { +nonisolated enum MediaPlayerState { case loading case playing case paused diff --git a/ElementX/Sources/Services/Audio/Player/AudioPlayerState.swift b/ElementX/Sources/Services/Audio/Player/AudioPlayerState.swift index b2a4e66b6..6b3c278bd 100644 --- a/ElementX/Sources/Services/Audio/Player/AudioPlayerState.swift +++ b/ElementX/Sources/Services/Audio/Player/AudioPlayerState.swift @@ -24,7 +24,6 @@ enum AudioPlayerStateIdentifier { case recorderPreview } -@MainActor class AudioPlayerState: ObservableObject, Identifiable { let id: AudioPlayerStateIdentifier let title: String diff --git a/ElementX/Sources/Services/Audio/Recorder/AudioRecorder.swift b/ElementX/Sources/Services/Audio/Recorder/AudioRecorder.swift index 377c6f36c..f3571bf23 100644 --- a/ElementX/Sources/Services/Audio/Recorder/AudioRecorder.swift +++ b/ElementX/Sources/Services/Audio/Recorder/AudioRecorder.swift @@ -12,14 +12,16 @@ import Combine import Foundation import UIKit -private enum InternalAudioRecorderState: Equatable { +private nonisolated enum InternalAudioRecorderState: Equatable { case recording case suspended case stopped case error(AudioRecorderError) } -class AudioRecorder: AudioRecorderProtocol { +/// All mutable state is confined to the serial `dispatchQueue` (with the realtime tap +/// reading converter/file that are set up before the engine starts), hence `@unchecked`. +nonisolated class AudioRecorder: AudioRecorderProtocol, @unchecked Sendable { private let audioSession: AudioSessionProtocol private var audioEngine: AVAudioEngine? private var mixer: AVAudioMixerNode? @@ -143,7 +145,7 @@ class AudioRecorder: AudioRecorderProtocol { return try AVAudioFile(forWriting: recordingURL, settings: settings) } - private func startRecording(audioFileURL: URL, completion: @escaping (Result) -> Void) { + private func startRecording(audioFileURL: URL, completion: @escaping @Sendable (Result) -> Void) { dispatchQueue.async { [weak self] in guard let self, !self.stopped else { completion(.failure(.recordingCancelled)) @@ -220,7 +222,7 @@ class AudioRecorder: AudioRecorderProtocol { } } - private func stopRecording(completion: @escaping () -> Void) { + private func stopRecording(completion: @escaping @Sendable () -> Void) { dispatchQueue.async { [weak self] in defer { completion() @@ -247,7 +249,7 @@ class AudioRecorder: AudioRecorderProtocol { releaseAudioSession() } - private func deleteRecording(completion: @escaping () -> Void) { + private func deleteRecording(completion: @escaping @Sendable () -> Void) { dispatchQueue.async { [weak self] in defer { completion() @@ -287,9 +289,12 @@ class AudioRecorder: AudioRecorderProtocol { } // Convert the buffer + // The block type is `@Sendable` but `convert(to:error:withInputFrom:)` + // invokes it synchronously on this same thread, the buffer never crosses. + nonisolated(unsafe) let inputBufferForConversion = buffer let inputBlock: AVAudioConverterInputBlock = { _, outStatus in outStatus.pointee = AVAudioConverterInputStatus.haveData - return buffer + return inputBufferForConversion } var conversionError: NSError? diff --git a/ElementX/Sources/Services/Audio/Recorder/AudioRecorderProtocol.swift b/ElementX/Sources/Services/Audio/Recorder/AudioRecorderProtocol.swift index 4b7871a88..161a607b5 100644 --- a/ElementX/Sources/Services/Audio/Recorder/AudioRecorderProtocol.swift +++ b/ElementX/Sources/Services/Audio/Recorder/AudioRecorderProtocol.swift @@ -9,7 +9,7 @@ import Combine import Foundation -enum AudioRecorderError: Error, Equatable { +nonisolated enum AudioRecorderError: Error, Equatable { case unsupportedAudioFormat case audioSessionFailure case audioEngineFailure @@ -19,13 +19,13 @@ enum AudioRecorderError: Error, Equatable { case recordPermissionNotGranted } -enum AudioRecorderAction { +nonisolated enum AudioRecorderAction { case didStartRecording case didStopRecording case didFailWithError(error: AudioRecorderError) } -protocol AudioRecorderProtocol: AnyObject { +nonisolated protocol AudioRecorderProtocol: AnyObject, Sendable { var actions: AnyPublisher { get } var currentTime: TimeInterval { get } var isRecording: Bool { get } diff --git a/ElementX/Sources/Services/Audio/Recorder/AudioRecorderState.swift b/ElementX/Sources/Services/Audio/Recorder/AudioRecorderState.swift index e6ead80cb..0dbfe4338 100644 --- a/ElementX/Sources/Services/Audio/Recorder/AudioRecorderState.swift +++ b/ElementX/Sources/Services/Audio/Recorder/AudioRecorderState.swift @@ -16,7 +16,6 @@ enum AudioRecorderRecordingState { case error } -@MainActor class AudioRecorderState: ObservableObject, Identifiable { let id = UUID() diff --git a/ElementX/Sources/Services/Authentication/AuthenticationService.swift b/ElementX/Sources/Services/Authentication/AuthenticationService.swift index c39a780ce..0226520db 100644 --- a/ElementX/Sources/Services/Authentication/AuthenticationService.swift +++ b/ElementX/Sources/Services/Authentication/AuthenticationService.swift @@ -198,8 +198,10 @@ class AuthenticationService: AuthenticationServiceProtocol { // n.b. We deliberatley don't check whether the received server is in our appSettings.accountProviders - let listener = SDKListener { progress in - guard let progress = QRLoginProgress(rustProgress: progress) else { return } + // The SDK calls the listener from arbitrary threads; onMainActor forwards the progress + // updates on the main actor in FIFO order. + let listener = SDKListener.onMainActor { rustProgress in + guard let progress = QRLoginProgress(rustProgress: rustProgress) else { return } progressSubject.send(progress) } diff --git a/ElementX/Sources/Services/Authentication/ClassicApp/ClassicAppMXAccount.swift b/ElementX/Sources/Services/Authentication/ClassicApp/ClassicAppMXAccount.swift index 2c1fd7237..7deabf12f 100644 --- a/ElementX/Sources/Services/Authentication/ClassicApp/ClassicAppMXAccount.swift +++ b/ElementX/Sources/Services/Authentication/ClassicApp/ClassicAppMXAccount.swift @@ -52,11 +52,11 @@ struct ClassicAppAccount: Equatable, CustomStringConvertible { final class ClassicAppMXAccount: NSObject, NSCoding { /// The obtained user ID. - var userID: String + let userID: String /// The access token to create a MXRestClient. - var accessToken: String + let accessToken: String /// The homeserver url (ex: "https://matrix.org"). - var homeserverURL: URL + let homeserverURL: URL /// Disable the account without logging out (NO by default). /// @@ -72,7 +72,7 @@ final class ClassicAppMXAccount: NSObject, NSCoding { } /// Override the existing `CustomStringConvertible` conformance. - override var description: String { + override nonisolated var description: String { "ClassicAppMXAccount(userID: \(userID), homeserverURL: \(homeserverURL), isDisabled: \(isDisabled), isSoftLogout: \(isSoftLogout))" } diff --git a/ElementX/Sources/Services/Authentication/ClassicApp/ClassicAppMediaLoader.swift b/ElementX/Sources/Services/Authentication/ClassicApp/ClassicAppMediaLoader.swift index 2a4cd4a38..87821486e 100644 --- a/ElementX/Sources/Services/Authentication/ClassicApp/ClassicAppMediaLoader.swift +++ b/ElementX/Sources/Services/Authentication/ClassicApp/ClassicAppMediaLoader.swift @@ -8,7 +8,7 @@ import SwiftUI /// A media provider that can download a `ClassicAppAccount`'s avatar image. -class ClassicAppMediaLoader: MediaLoaderProtocol { +final class ClassicAppMediaLoader: MediaLoaderProtocol { let classicAppAccount: ClassicAppAccount let urlSession: URLSession diff --git a/ElementX/Sources/Services/Authentication/LinkNewDeviceService.swift b/ElementX/Sources/Services/Authentication/LinkNewDeviceService.swift index cf4e95661..5bace9d10 100644 --- a/ElementX/Sources/Services/Authentication/LinkNewDeviceService.swift +++ b/ElementX/Sources/Services/Authentication/LinkNewDeviceService.swift @@ -52,16 +52,29 @@ class LinkNewDeviceService: LinkNewDeviceServiceProtocol { /// Links a new device by showing it a QR code. func linkMobileDevice() -> LinkMobileProgressPublisher { let progressSubject = CurrentValueSubject(.starting) + + // Bridge from the SDK's synchronous callback into Swift Concurrency. Yielding is safe from + // any thread; the single long-lived `for await` consumer forwards the progress updates on + // the main actor in FIFO order. + let (progressStream, progressContinuation) = AsyncStream.makeStream() + let listener = SDKListener { - do { - try progressSubject.send(.init(rustProgress: $0)) - } catch { - MXLog.error("Invalid GenerateProgress") - progressSubject.send(completion: .failure(.unknown)) + progressContinuation.yield($0) + } + + Task { + for await rustProgress in progressStream { + do { + try progressSubject.send(.init(rustProgress: rustProgress)) + } catch { + MXLog.error("Invalid GenerateProgress") + progressSubject.send(completion: .failure(.unknown)) + } } } Task { + defer { progressContinuation.finish() } do { // Note: The SDK doesn't provide us with a way to cancel the grant if the user hit the cancel button 🤷‍♂️ try await grantLoginHandler.generate(progressListener: listener) // The success state is handled by the listener. @@ -82,12 +95,22 @@ class LinkNewDeviceService: LinkNewDeviceServiceProtocol { /// Links a new device using a QR code generated by said device. func linkDesktopDevice(with scannedQRData: Data) -> LinkDesktopProgressPublisher { let progressSubject = CurrentValueSubject(.starting) + + // Same callback bridging as `linkMobileDevice()` above. + let (progressStream, progressContinuation) = AsyncStream.makeStream() + let listener = SDKListener { - do { - try progressSubject.send(.init(rustProgress: $0)) - } catch { - MXLog.error("Invalid ScanProgress") - progressSubject.send(completion: .failure(.unknown)) + progressContinuation.yield($0) + } + + Task { + for await rustProgress in progressStream { + do { + try progressSubject.send(.init(rustProgress: rustProgress)) + } catch { + MXLog.error("Invalid ScanProgress") + progressSubject.send(completion: .failure(.unknown)) + } } } @@ -97,6 +120,7 @@ class LinkNewDeviceService: LinkNewDeviceServiceProtocol { } catch { MXLog.error("QR code decode error: \(error)") progressSubject.send(completion: .failure(.invalidQRCode)) + progressContinuation.finish() return progressSubject.asCurrentValuePublisher() } @@ -104,6 +128,7 @@ class LinkNewDeviceService: LinkNewDeviceServiceProtocol { // Note the equivalent check will also happen for sign in with QR code in the AuthenticationService. Task { + defer { progressContinuation.finish() } do { // Note: The SDK doesn't provide us with a way to cancel the grant if the user hit the cancel button 🤷‍♂️ try await grantLoginHandler.scan(qrCodeData: qrCodeData, progressListener: listener) // The success state is handled by the listener. @@ -215,7 +240,7 @@ private extension QRCodeLoginError { } } -class CheckCodeSenderProxy: Equatable { +nonisolated class CheckCodeSenderProxy: Equatable { static func == (lhs: CheckCodeSenderProxy, rhs: CheckCodeSenderProxy) -> Bool { lhs.underlyingSender === rhs.underlyingSender } diff --git a/ElementX/Sources/Services/BugReport/BugReportService.swift b/ElementX/Sources/Services/BugReport/BugReportService.swift index d2410ba9e..261bb3db2 100644 --- a/ElementX/Sources/Services/BugReport/BugReportService.swift +++ b/ElementX/Sources/Services/BugReport/BugReportService.swift @@ -289,12 +289,14 @@ private enum MultipartFormDataType { case file(url: URL) } -extension BugReportService: URLSessionTaskDelegate { +nonisolated extension BugReportService: URLSessionTaskDelegate { + /// URLSession calls its delegate on a background queue, hop to the main actor + /// where the service lives. func urlSession(_ session: URLSession, didCreateTask task: URLSessionTask) { - task.progress.publisher(for: \.fractionCompleted) - .sink { [weak self] value in + Task { @MainActor [weak self] in + for await value in task.progress.publisher(for: \.fractionCompleted).values { self?.progressSubject.send(value) } - .store(in: &cancellables) + } } } diff --git a/ElementX/Sources/Services/BugReport/BugReportServiceProtocol.swift b/ElementX/Sources/Services/BugReport/BugReportServiceProtocol.swift index 019a170ef..583f32d14 100644 --- a/ElementX/Sources/Services/BugReport/BugReportServiceProtocol.swift +++ b/ElementX/Sources/Services/BugReport/BugReportServiceProtocol.swift @@ -10,7 +10,7 @@ import Combine import Foundation import UIKit -struct BugReport: Equatable { +nonisolated struct BugReport: Equatable { let userID: String? let deviceID: String? let ed25519: String? diff --git a/ElementX/Sources/Services/Client/ClientProxy.swift b/ElementX/Sources/Services/Client/ClientProxy.swift index 4dd1f63a5..11a52dc37 100644 --- a/ElementX/Sources/Services/Client/ClientProxy.swift +++ b/ElementX/Sources/Services/Client/ClientProxy.swift @@ -247,8 +247,11 @@ class ClientProxy: ClientProxyProtocol { roomListStateLoadingStateUpdateTaskHandle = createRoomListLoadingStateUpdateObserver(roomListService) delegateHandle = try client.setDelegate(delegate: ClientDelegateWrapper { [weak self] isSoftLogout in - self?.hasEncounteredAuthError = true - self?.actionsSubject.send(.receivedAuthError(isSoftLogout: isSoftLogout)) + // Called by the SDK from arbitrary threads, hop to the main actor where the proxy lives. + Task { @MainActor in + self?.hasEncounteredAuthError = true + self?.actionsSubject.send(.receivedAuthError(isSoftLogout: isSoftLogout)) + } } backgroundTaskErrorCallback: { error in switch error { case .panic(let message, let backtrace): @@ -628,7 +631,8 @@ class ClientProxy: ClientProxyProtocol { } if !staticRoomSummaryProvider.statePublisher.value.isLoaded { - _ = await staticRoomSummaryProvider.statePublisher.values.first { $0.isLoaded } + var iterator = staticRoomSummaryProvider.statePublisher.values.makeAsyncIterator() + while let state = await iterator.next(isolation: #isolation), !state.isLoaded { } } if shouldAwait { @@ -904,7 +908,7 @@ class ClientProxy: ClientProxyProtocol { } } - func recentlyVisitedRooms(filter: (JoinedRoomProxyProtocol) -> Bool) async -> [JoinedRoomProxyProtocol] { + func recentlyVisitedRooms(filter: @Sendable (JoinedRoomProxyProtocol) -> Bool) async -> [JoinedRoomProxyProtocol] { let maxResultsToReturn = 5 guard case let .success(roomIdentifiers) = await recentlyVisitedRoomIDs() else { @@ -1005,7 +1009,7 @@ class ClientProxy: ClientProxyProtocol { } .store(in: &cancellables) - ignoredUsersListenerTaskHandle = client.subscribeToIgnoredUsers(listener: SDKListener { [weak self] ignoredUsers in + ignoredUsersListenerTaskHandle = client.subscribeToIgnoredUsers(listener: SDKListener.onMainActor { [weak self] ignoredUsers in self?.ignoredUsersSubject.send(ignoredUsers) }) @@ -1014,12 +1018,12 @@ class ClientProxy: ClientProxyProtocol { Task { await self?.updateVerificationState(verificationState) } }) - sendQueueStatusListenerTaskHandle = client.subscribeToSendQueueStatus(listener: SDKListener { [weak self] roomID, error in + sendQueueStatusListenerTaskHandle = client.subscribeToSendQueueStatus(listener: SDKListener.onMainActor { [weak self] roomID, error in MXLog.error("Send queue failed in room: \(roomID) with error: \(error)") self?.sendQueueStatusSubject.send(false) }) - sendQueueUpdatesListenerTaskHandle = try? await client.subscribeToSendQueueUpdates(listener: SDKListener { [analyticsService] _, update in + sendQueueUpdatesListenerTaskHandle = try? await client.subscribeToSendQueueUpdates(listener: SDKListener.onMainActor { [analyticsService] _, update in switch update { case .newLocalEvent(let transactionID): analyticsService.signpost.startTransaction(.sendMessage(uuid: transactionID)) @@ -1172,7 +1176,7 @@ class ClientProxy: ClientProxyProtocol { } private func createSyncServiceStateObserver(_ syncService: SyncService) -> TaskHandle { - syncService.state(listener: SDKListener { [weak self] state in + syncService.state(listener: SDKListener.onMainActor { [weak self] state in guard let self else { return } MXLog.info("Received sync service update: \(state)") @@ -1190,7 +1194,7 @@ class ClientProxy: ClientProxyProtocol { private func createMediaPreviewConfigObserver() async -> TaskHandle? { do { - return try await client.subscribeToMediaPreviewConfig(listener: SDKListener { [weak self] config in + return try await client.subscribeToMediaPreviewConfig(listener: SDKListener.onMainActor { [weak self] config in guard let self else { return } if let config { @@ -1210,7 +1214,7 @@ class ClientProxy: ClientProxyProtocol { private func createLiveLocationOwnInfoUpdatesObserver() -> TaskHandle? { do { - return try client.subscribeToOwnBeaconInfoUpdates(listener: SDKListener { [weak self] update in + return try client.subscribeToOwnBeaconInfoUpdates(listener: SDKListener.onMainActor { [weak self] update in guard let self else { return } let appUpdate = LiveLocationOwnInfoUpdate(roomID: update.roomId, eventID: update.eventId, @@ -1224,7 +1228,7 @@ class ClientProxy: ClientProxyProtocol { } private func createRoomListServiceObserver(_ roomListService: RoomListService) -> TaskHandle { - roomListService.state(listener: SDKListener { [weak self] state in + roomListService.state(listener: SDKListener.onMainActor { [weak self] state in guard let self else { return } MXLog.info("Received room list update: \(state)") @@ -1246,7 +1250,7 @@ class ClientProxy: ClientProxyProtocol { } private func createRoomListLoadingStateUpdateObserver(_ roomListService: RoomListService) -> TaskHandle { - roomListService.syncIndicator(delayBeforeShowingInMs: 1000, delayBeforeHidingInMs: 0, listener: SDKListener { [weak self] state in + roomListService.syncIndicator(delayBeforeShowingInMs: 1000, delayBeforeHidingInMs: 0, listener: SDKListener.onMainActor { [weak self] state in guard let self else { return } switch state { diff --git a/ElementX/Sources/Services/Client/ClientProxyProtocol.swift b/ElementX/Sources/Services/Client/ClientProxyProtocol.swift index fcfd5b337..6746b1609 100644 --- a/ElementX/Sources/Services/Client/ClientProxyProtocol.swift +++ b/ElementX/Sources/Services/Client/ClientProxyProtocol.swift @@ -260,7 +260,7 @@ protocol ClientProxyProtocol: AnyObject { func trackRecentlyVisitedRoom(_ roomID: String) async -> Result - func recentlyVisitedRooms(filter: (JoinedRoomProxyProtocol) -> Bool) async -> [JoinedRoomProxyProtocol] + func recentlyVisitedRooms(filter: @Sendable (JoinedRoomProxyProtocol) -> Bool) async -> [JoinedRoomProxyProtocol] func recentConversationCounterparts() async -> [UserProfileProxy] // MARK: - Crypto diff --git a/ElementX/Sources/Services/ElementCall/ElementCallService.swift b/ElementX/Sources/Services/ElementCall/ElementCallService.swift index 98ec5c461..9218b7838 100644 --- a/ElementX/Sources/Services/ElementCall/ElementCallService.swift +++ b/ElementX/Sources/Services/ElementCall/ElementCallService.swift @@ -220,14 +220,19 @@ class ElementCallService: NSObject, ElementCallServiceProtocol, PKPushRegistryDe // https://stackoverflow.com/a/41230020/730924 update.remoteHandle = .init(type: .generic, value: roomID) + // The push registry uses the main queue so the completion is main actor bound, + // whereas CallKit invokes its completion on a background queue. + let mainActorCompletion = { @MainActor @Sendable in completion() } callProvider.reportNewIncomingCall(with: callID.callKitID, update: update) { [weak self] error in if let error { MXLog.error("Failed reporting new incoming call with error: \(error)") } - self?.actionsSubject.send(.receivedIncomingCallRequest) - - completion() + Task { @MainActor in + self?.actionsSubject.send(.receivedIncomingCallRequest) + + mainActorCompletion() + } } endUnansweredCallTask = Task { [weak self] in @@ -351,8 +356,6 @@ class ElementCallService: NSObject, ElementCallServiceProtocol, PKPushRegistryDe private func reportImmediatelyEndedCall(reason: CXCallEndedReason, callerInfo: (roomID: String, roomDisplayName: String?)? = nil, completion: @escaping () -> Void) { - let provider = callProvider - let callID = UUID() let update = CXCallUpdate() // Never answered through CallKit, so the hasVideo workaround for #5335 isn't needed. @@ -363,14 +366,18 @@ class ElementCallService: NSObject, ElementCallServiceProtocol, PKPushRegistryDe update.remoteHandle = .init(type: .generic, value: callerInfo.roomID) } - provider.reportNewIncomingCall(with: callID, update: update) { error in + // CallKit invokes the completion on a background queue, so hop back to the main actor + // to report the ended call and to run the (main actor bound) completion. + let mainActorCompletion = { @MainActor @Sendable in completion() } + callProvider.reportNewIncomingCall(with: callID, update: update) { [weak self] error in if let error { MXLog.error("Failed reporting immediately ended call with error: \(error)") } - provider.reportCall(with: callID, endedAt: nil, reason: reason) - - completion() + Task { @MainActor in + self?.callProvider.reportCall(with: callID, endedAt: nil, reason: reason) + mainActorCompletion() + } } } @@ -443,7 +450,7 @@ class ElementCallService: NSObject, ElementCallServiceProtocol, PKPushRegistryDe MXLog.info("Observe decline events for notification \(rtcNotificationID)") - let listener: CallDeclineListener = SDKListener { [weak self] senderID in + let listener: CallDeclineListener = SDKListener.onMainActor { [weak self] senderID in guard let self else { return } MXLog.debug("Call declined event received from \(senderID)") diff --git a/ElementX/Sources/Services/ElementCall/ElementCallServiceConstants.swift b/ElementX/Sources/Services/ElementCall/ElementCallServiceConstants.swift index 231aa9c97..cf4c31a95 100644 --- a/ElementX/Sources/Services/ElementCall/ElementCallServiceConstants.swift +++ b/ElementX/Sources/Services/ElementCall/ElementCallServiceConstants.swift @@ -8,7 +8,7 @@ import Foundation -enum ElementCallServiceNotificationKey: String { +nonisolated enum ElementCallServiceNotificationKey: String { case roomID case roomDisplayName /// When an incoming call is set to ring, there will be a `m.rtc.notification`event (MSC4075). @@ -19,4 +19,4 @@ enum ElementCallServiceNotificationKey: String { case isVoiceCall } -let ElementCallServiceNotificationDiscardDelta = 15.0 +nonisolated let ElementCallServiceNotificationDiscardDelta = 15.0 diff --git a/ElementX/Sources/Services/ElementCall/ElementCallWidgetDriver.swift b/ElementX/Sources/Services/ElementCall/ElementCallWidgetDriver.swift index 26ae34549..d2e52ce97 100644 --- a/ElementX/Sources/Services/ElementCall/ElementCallWidgetDriver.swift +++ b/ElementX/Sources/Services/ElementCall/ElementCallWidgetDriver.swift @@ -129,7 +129,7 @@ final class ElementCallWidgetDriver: WidgetCapabilitiesProvider, ElementCallWidg self.widgetDriver = widgetDriver - Task.detached { [weak self, widgetDriver, messagePublisher] in + Task.detached { [weak self, widgetDriver] in MXLog.debug("Started message receiving loop") defer { @@ -141,10 +141,9 @@ final class ElementCallWidgetDriver: WidgetCapabilitiesProvider, ElementCallWidg return } - messagePublisher.send(receivedMessage) MXLog.debug("Received message: \(receivedMessage)") - self?.handleMessageIfNeeded(receivedMessage) + await self?.receiveMessage(receivedMessage) } } @@ -177,12 +176,18 @@ final class ElementCallWidgetDriver: WidgetCapabilitiesProvider, ElementCallWidg // MARK: - WidgetCapabilitiesProvider - func acquireCapabilities(capabilities: WidgetCapabilities) -> WidgetCapabilities { + /// Called by the SDK from arbitrary threads, only touches Sendable state. + nonisolated func acquireCapabilities(capabilities: WidgetCapabilities) -> WidgetCapabilities { getElementCallRequiredPermissions(ownUserId: room.ownUserId(), ownDeviceId: deviceID) } // MARK: - Private + private func receiveMessage(_ message: String) { + messagePublisher.send(message) + handleMessageIfNeeded(message) + } + func handleMessageIfNeeded(_ message: String) { guard let data = message.data(using: .utf8) else { return diff --git a/ElementX/Sources/Services/Emojis/EmojiProvider.swift b/ElementX/Sources/Services/Emojis/EmojiProvider.swift index 14c166cc4..0815e0df9 100644 --- a/ElementX/Sources/Services/Emojis/EmojiProvider.swift +++ b/ElementX/Sources/Services/Emojis/EmojiProvider.swift @@ -6,7 +6,7 @@ // Please see LICENSE files in the repository root for full details. // -import Emojibase +@preconcurrency import Emojibase import Foundation class EmojiProvider: EmojiProviderProtocol { @@ -114,7 +114,7 @@ class EmojiProvider: EmojiProviderProtocol { } } -extension EmojibaseDatasource: EmojiLoaderProtocol { +nonisolated extension EmojibaseDatasource: EmojiLoaderProtocol { func load() async -> [EmojiCategory] { do { let store: EmojibaseStore = try await load() diff --git a/ElementX/Sources/Services/Emojis/EmojiProviderProtocol.swift b/ElementX/Sources/Services/Emojis/EmojiProviderProtocol.swift index 236ab5944..1aa0c8b77 100644 --- a/ElementX/Sources/Services/Emojis/EmojiProviderProtocol.swift +++ b/ElementX/Sources/Services/Emojis/EmojiProviderProtocol.swift @@ -32,7 +32,6 @@ enum EmojiProviderState { case loaded([EmojiCategory]) } -@MainActor protocol EmojiProviderProtocol { var state: EmojiProviderState { get } diff --git a/ElementX/Sources/Services/Keychain/KeychainController.swift b/ElementX/Sources/Services/Keychain/KeychainController.swift index 32f805402..ecb97e34f 100644 --- a/ElementX/Sources/Services/Keychain/KeychainController.swift +++ b/ElementX/Sources/Services/Keychain/KeychainController.swift @@ -10,7 +10,7 @@ import Foundation @preconcurrency import KeychainAccess import MatrixRustSDK -enum KeychainControllerService: String { +nonisolated enum KeychainControllerService: String { case sessions case tests @@ -23,7 +23,9 @@ enum KeychainControllerService: String { } } -final class KeychainController: KeychainControllerProtocol { +/// The SDK calls the `ClientSessionDelegate` methods from arbitrary threads and the +/// underlying `Keychain` is thread-safe, so the controller doesn't need an actor. +final nonisolated class KeychainController: KeychainControllerProtocol { /// The keychain responsible for storing account restoration tokens (keyed by userID). private let restorationTokenKeychain: Keychain /// The keychain responsible for storing all other secrets in the app (keyed by `Key`s). diff --git a/ElementX/Sources/Services/Keychain/KeychainControllerProtocol.swift b/ElementX/Sources/Services/Keychain/KeychainControllerProtocol.swift index 481abcec2..00615b66a 100644 --- a/ElementX/Sources/Services/Keychain/KeychainControllerProtocol.swift +++ b/ElementX/Sources/Services/Keychain/KeychainControllerProtocol.swift @@ -15,7 +15,7 @@ struct KeychainCredentials { } // sourcery: AutoMockable -protocol KeychainControllerProtocol: ClientSessionDelegate { +nonisolated protocol KeychainControllerProtocol: ClientSessionDelegate { // MARK: Restoration Tokens func setRestorationToken(_ restorationToken: RestorationToken, forUsername: String) diff --git a/ElementX/Sources/Services/Location/LiveLocationManager.swift b/ElementX/Sources/Services/Location/LiveLocationManager.swift index c326ed03c..cc96eae46 100644 --- a/ElementX/Sources/Services/Location/LiveLocationManager.swift +++ b/ElementX/Sources/Services/Location/LiveLocationManager.swift @@ -41,7 +41,6 @@ class LiveLocationManager: NSObject, LiveLocationManagerProtocol, CLLocationMana private var lastLocation: CLLocationCoordinate2D? - @MainActor init(clientProxy: ClientProxyProtocol, appSettings: AppSettings, locationManager: @autoclosure @MainActor () -> CLLocationManagerProtocol = CLLocationManager()) { diff --git a/ElementX/Sources/Services/Location/RoomLiveLocationService.swift b/ElementX/Sources/Services/Location/RoomLiveLocationService.swift index b4a3b7c87..7ad4a469a 100644 --- a/ElementX/Sources/Services/Location/RoomLiveLocationService.swift +++ b/ElementX/Sources/Services/Location/RoomLiveLocationService.swift @@ -20,15 +20,34 @@ final class RoomLiveLocationService: RoomLiveLocationServiceProtocol { liveLocationsSubject.asCurrentValuePublisher() } + /// Bridge from the SDK's synchronous callback into Swift Concurrency. Yielding is safe from any + /// thread; a single long-lived `for await` consumer (set up in `init`) applies the updates on the + /// main actor in FIFO order, guaranteeing one in-flight update at a time. + private let updatesContinuation: AsyncStream<[LiveLocationShareUpdate]>.Continuation + + deinit { + updatesContinuation.finish() + } + init(liveLocationsObserver: LiveLocationsObserver) { self.liveLocationsObserver = liveLocationsObserver - observationToken = liveLocationsObserver - .subscribe(listener: SDKListener { [weak self] updates in + + let (updatesStream, updatesContinuation) = AsyncStream<[LiveLocationShareUpdate]>.makeStream() + self.updatesContinuation = updatesContinuation + + Task { [weak self] in + for await updates in updatesStream { guard let self else { return } MXLog.info("Received live location shares update") let updatedShares = handleLiveLocationShareUpdates(updates) liveLocationsSubject.send(updatedShares) + } + } + + observationToken = liveLocationsObserver + .subscribe(listener: SDKListener { updates in + updatesContinuation.yield(updates) }) } diff --git a/ElementX/Sources/Services/Location/RoomLiveLocationServiceProtocol.swift b/ElementX/Sources/Services/Location/RoomLiveLocationServiceProtocol.swift index 5ae07cfb7..0bf178ce8 100644 --- a/ElementX/Sources/Services/Location/RoomLiveLocationServiceProtocol.swift +++ b/ElementX/Sources/Services/Location/RoomLiveLocationServiceProtocol.swift @@ -9,6 +9,6 @@ import Combine import Foundation // sourcery: AutoMockable -protocol RoomLiveLocationServiceProtocol { +protocol RoomLiveLocationServiceProtocol: Sendable { var liveLocationsPublisher: CurrentValuePublisher<[LiveLocationShare], Never> { get } } diff --git a/ElementX/Sources/Services/Media/Provider/MediaFileHandleProxy.swift b/ElementX/Sources/Services/Media/Provider/MediaFileHandleProxy.swift index 30177ff95..b52c080e8 100644 --- a/ElementX/Sources/Services/Media/Provider/MediaFileHandleProxy.swift +++ b/ElementX/Sources/Services/Media/Provider/MediaFileHandleProxy.swift @@ -12,7 +12,7 @@ import Foundation /// A wrapper around Rust's `MediaFileHandle` type that provides us with a /// media file that is stored unencrypted in a temporary location for previewing. -final class MediaFileHandleProxy: Sendable { +final nonisolated class MediaFileHandleProxy: Sendable { /// The underlying handle for the file. private let handle: MediaFileHandleProtocol diff --git a/ElementX/Sources/Services/Media/Provider/MediaLoader.swift b/ElementX/Sources/Services/Media/Provider/MediaLoader.swift index b28c1cbf2..aa815b5f2 100644 --- a/ElementX/Sources/Services/Media/Provider/MediaLoader.swift +++ b/ElementX/Sources/Services/Media/Provider/MediaLoader.swift @@ -12,7 +12,7 @@ import UIKit @preconcurrency import MatrixRustSDK -private final class MediaRequest { +private final nonisolated class MediaRequest { var continuations: [CheckedContinuation] = [] } diff --git a/ElementX/Sources/Services/Media/Provider/MediaLoaderProtocol.swift b/ElementX/Sources/Services/Media/Provider/MediaLoaderProtocol.swift index ec1dea1ff..b01d3e5ac 100644 --- a/ElementX/Sources/Services/Media/Provider/MediaLoaderProtocol.swift +++ b/ElementX/Sources/Services/Media/Provider/MediaLoaderProtocol.swift @@ -16,7 +16,7 @@ enum MediaLoaderError: Error { } // sourcery: AutoMockable -protocol MediaLoaderProtocol: Sendable { +nonisolated protocol MediaLoaderProtocol: Sendable { func loadMediaContentForSource(_ source: MediaSourceProxy) async throws -> Data func loadMediaThumbnailForSource(_ source: MediaSourceProxy, width: UInt, height: UInt) async throws -> Data diff --git a/ElementX/Sources/Services/Media/Provider/MediaProvider.swift b/ElementX/Sources/Services/Media/Provider/MediaProvider.swift index af78fe0d7..2b8a7ad46 100644 --- a/ElementX/Sources/Services/Media/Provider/MediaProvider.swift +++ b/ElementX/Sources/Services/Media/Provider/MediaProvider.swift @@ -10,7 +10,7 @@ import Combine import Kingfisher import UIKit -struct MediaProvider: MediaProviderProtocol { +nonisolated struct MediaProvider: MediaProviderProtocol { private let mediaLoader: MediaLoaderProtocol private let imageCache: Kingfisher.ImageCache private let homeserverReachabilityPublisher: CurrentValuePublisher? diff --git a/ElementX/Sources/Services/Media/Provider/MediaProviderProtocol.swift b/ElementX/Sources/Services/Media/Provider/MediaProviderProtocol.swift index 32c8e3616..b1450ff1a 100644 --- a/ElementX/Sources/Services/Media/Provider/MediaProviderProtocol.swift +++ b/ElementX/Sources/Services/Media/Provider/MediaProviderProtocol.swift @@ -18,7 +18,7 @@ enum MediaProviderError: Error { } // sourcery: AutoMockable -protocol MediaProviderProtocol { +nonisolated protocol MediaProviderProtocol: Sendable { func imageFromSource(_ source: MediaSourceProxy?, size: CGSize?) -> UIImage? func loadImageFromSource(_ source: MediaSourceProxy, size: CGSize?) async -> Result func loadImageDataFromSource(_ source: MediaSourceProxy) async -> Result diff --git a/ElementX/Sources/Services/Media/Provider/MediaSourceProxy.swift b/ElementX/Sources/Services/Media/Provider/MediaSourceProxy.swift index 5872751ad..8ffa1bab0 100644 --- a/ElementX/Sources/Services/Media/Provider/MediaSourceProxy.swift +++ b/ElementX/Sources/Services/Media/Provider/MediaSourceProxy.swift @@ -9,7 +9,7 @@ import Foundation @preconcurrency import MatrixRustSDK -struct MediaSourceProxy: Hashable { +nonisolated struct MediaSourceProxy: Hashable { /// The media source provided by Rust. let underlyingSource: MediaSource /// The media's mime type, used when loading the media's file. diff --git a/ElementX/Sources/Services/MediaPlayer/MediaPlayerProviderProtocol.swift b/ElementX/Sources/Services/MediaPlayer/MediaPlayerProviderProtocol.swift index 09bc067cc..da1ef7731 100644 --- a/ElementX/Sources/Services/MediaPlayer/MediaPlayerProviderProtocol.swift +++ b/ElementX/Sources/Services/MediaPlayer/MediaPlayerProviderProtocol.swift @@ -12,7 +12,6 @@ enum MediaPlayerProviderError: Error { case unsupportedMediaType } -@MainActor protocol MediaPlayerProviderProtocol { var player: AudioPlayerProtocol { get } diff --git a/ElementX/Sources/Services/Notification/Manager/NotificationManager.swift b/ElementX/Sources/Services/Notification/Manager/NotificationManager.swift index 9c674fbec..9eeed354b 100644 --- a/ElementX/Sources/Services/Notification/Manager/NotificationManager.swift +++ b/ElementX/Sources/Services/Notification/Manager/NotificationManager.swift @@ -169,15 +169,15 @@ final class NotificationManager: NSObject, NotificationManagerProtocol { locArgs: [])), pusherNotificationClientIdentifier: clientProxy.pusherNotificationClientIdentifier) - let configuration = try await PusherConfiguration(identifiers: .init(pushkey: deviceToken.base64EncodedString(), - appId: appSettings.pusherAppID), - kind: .http(data: .init(url: appSettings.pushGatewayNotifyEndpoint.absoluteString, - format: .eventIdOnly, - defaultPayload: defaultPayload.toJsonString())), - appDisplayName: "\(InfoPlistReader.main.bundleDisplayName) (iOS)", - deviceDisplayName: UIDevice.current.name, - profileTag: pusherProfileTag(), - lang: Bundle.app.preferredLocalizations.first ?? "en") + let configuration = try PusherConfiguration(identifiers: .init(pushkey: deviceToken.base64EncodedString(), + appId: appSettings.pusherAppID), + kind: .http(data: .init(url: appSettings.pushGatewayNotifyEndpoint.absoluteString, + format: .eventIdOnly, + defaultPayload: defaultPayload.toJsonString())), + appDisplayName: "\(InfoPlistReader.main.bundleDisplayName) (iOS)", + deviceDisplayName: UIDevice.current.name, + profileTag: pusherProfileTag(), + lang: Bundle.app.preferredLocalizations.first ?? "en") try await clientProxy.setPusher(with: configuration) MXLog.info("Set pusher succeeded") return true @@ -232,7 +232,6 @@ extension NotificationManager: UNUserNotificationCenterDelegate { return [.badge, .sound, .list, .banner] } - @MainActor func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse) async { switch response.actionIdentifier { diff --git a/ElementX/Sources/Services/Notification/NotificationConstants.swift b/ElementX/Sources/Services/Notification/NotificationConstants.swift index d35fb41be..71972daf5 100644 --- a/ElementX/Sources/Services/Notification/NotificationConstants.swift +++ b/ElementX/Sources/Services/Notification/NotificationConstants.swift @@ -8,7 +8,7 @@ import Foundation -enum NotificationConstants { +nonisolated enum NotificationConstants { enum UserInfoKey { static let roomIdentifier = "room_id" static let eventIdentifier = "event_id" diff --git a/ElementX/Sources/Services/NotificationSettings/NotificationSettingsProxy.swift b/ElementX/Sources/Services/NotificationSettings/NotificationSettingsProxy.swift index 4d436d660..d7b94370e 100644 --- a/ElementX/Sources/Services/NotificationSettings/NotificationSettingsProxy.swift +++ b/ElementX/Sources/Services/NotificationSettings/NotificationSettingsProxy.swift @@ -11,17 +11,18 @@ import Foundation import MatrixRustSDK private final class WeakNotificationSettingsProxy: NotificationSettingsDelegate { - private weak var proxy: NotificationSettingsProxy? + @MainActor private weak var proxy: NotificationSettingsProxy? - init(proxy: NotificationSettingsProxy) { + @MainActor init(proxy: NotificationSettingsProxy) { self.proxy = proxy } // MARK: - NotificationSettingsDelegate + /// Called by the SDK from arbitrary threads, hop to the main actor where the proxy lives. func settingsDidChange() { - Task { - await proxy?.settingsDidChange() + Task { @MainActor in + self.proxy?.settingsDidChange() } } } @@ -119,12 +120,18 @@ final class NotificationSettingsProxy: NotificationSettingsProxyProtocol { func updatedSettings() async { // The timeout avoids having to wait indefinitely. This can happen when setting a mode that is already the current mode, // as in this case no API call is made by the RustSDK and the push rules are therefore not updated. - _ = await callbacks + var iterator = callbacks .timeout(.seconds(2.0), scheduler: DispatchQueue.main, options: nil, customError: nil) - .values.first { $0 == .settingsDidChange } + .values + .makeAsyncIterator() + + while let callback = await iterator.next(isolation: #isolation) { + if callback == .settingsDidChange { + break + } + } } - @MainActor func settingsDidChange() { callbacks.send(.settingsDidChange) } diff --git a/ElementX/Sources/Services/NotificationSettings/RoomNotificationModeProxy.swift b/ElementX/Sources/Services/NotificationSettings/RoomNotificationModeProxy.swift index c51911172..3d99196ff 100644 --- a/ElementX/Sources/Services/NotificationSettings/RoomNotificationModeProxy.swift +++ b/ElementX/Sources/Services/NotificationSettings/RoomNotificationModeProxy.swift @@ -9,13 +9,13 @@ import Foundation import MatrixRustSDK -enum RoomNotificationModeProxy: String, CaseIterable, Equatable { +nonisolated enum RoomNotificationModeProxy: String, CaseIterable, Equatable { case allMessages case mentionsAndKeywordsOnly case mute } -extension RoomNotificationModeProxy { +nonisolated extension RoomNotificationModeProxy { static func from(roomNotificationMode: RoomNotificationMode) -> Self { switch roomNotificationMode { case .allMessages: diff --git a/ElementX/Sources/Services/NotificationSettings/RoomNotificationSettingsProxyProtocol.swift b/ElementX/Sources/Services/NotificationSettings/RoomNotificationSettingsProxyProtocol.swift index 301d48327..1235011b2 100644 --- a/ElementX/Sources/Services/NotificationSettings/RoomNotificationSettingsProxyProtocol.swift +++ b/ElementX/Sources/Services/NotificationSettings/RoomNotificationSettingsProxyProtocol.swift @@ -10,7 +10,7 @@ import Foundation import MatrixRustSDK // sourcery: AutoMockable -protocol RoomNotificationSettingsProxyProtocol { +protocol RoomNotificationSettingsProxyProtocol: Sendable { var mode: RoomNotificationModeProxy { get } var isDefault: Bool { get } } diff --git a/ElementX/Sources/Services/Room/JoinRule.swift b/ElementX/Sources/Services/Room/JoinRule.swift index 9cc36adf9..4fec6109a 100644 --- a/ElementX/Sources/Services/Room/JoinRule.swift +++ b/ElementX/Sources/Services/Room/JoinRule.swift @@ -9,7 +9,7 @@ import Foundation import MatrixRustSDK /// The rule used for users wishing to join a room. -public enum JoinRule: Equatable, Hashable, Sendable { +public nonisolated enum JoinRule: Equatable, Hashable, Sendable { /// Anyone can join the room without any prior action. case `public` /// A user who wishes to join the room must first receive an invite. @@ -52,7 +52,7 @@ public enum JoinRule: Equatable, Hashable, Sendable { } /// An allow rule which defines a condition that allows joining a room. -public enum AllowRule: Equatable, Hashable, Sendable { +public nonisolated enum AllowRule: Equatable, Hashable, Sendable { /// Only a member of the `room_id` Room can join the one this rule is used in. case roomMembership(roomID: String) /// A custom allow rule implementation, containing its JSON representation as a `String`. diff --git a/ElementX/Sources/Services/Room/JoinedRoomProxy.swift b/ElementX/Sources/Services/Room/JoinedRoomProxy.swift index 700fd3e90..94aa5db47 100644 --- a/ElementX/Sources/Services/Room/JoinedRoomProxy.swift +++ b/ElementX/Sources/Services/Room/JoinedRoomProxy.swift @@ -146,7 +146,7 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol { return } - roomInfoObservationToken = room.subscribeToRoomInfoUpdates(listener: SDKListener { [weak self] roomInfo in + roomInfoObservationToken = room.subscribeToRoomInfoUpdates(listener: SDKListener.onMainActor { [weak self] roomInfo in MXLog.info("Received room info update") self?.infoSubject.send(RoomInfoProxy(roomInfo: roomInfo)) }) @@ -794,7 +794,7 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol { // MARK: - Private private func subscribeToTypingNotifications() { - typingNotificationObservationToken = room.subscribeToTypingNotifications(listener: SDKListener { [weak self] typingUserIDs in + typingNotificationObservationToken = room.subscribeToTypingNotifications(listener: SDKListener.onMainActor { [weak self] typingUserIDs in guard let self else { return } MXLog.info("Received typing notification update, typingUsers: \(typingUserIDs)") @@ -813,7 +813,7 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol { private func subscribeToIdentityStatusChanges() async { do { - identityStatusChangesObservationToken = try await room.subscribeToIdentityStatusChanges(listener: SDKListener { [weak self] changes in + identityStatusChangesObservationToken = try await room.subscribeToIdentityStatusChanges(listener: SDKListener.onMainActor { [weak self] changes in guard let self else { return } MXLog.info("Received identity status changes: \(changes)") @@ -827,7 +827,7 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol { private func subscribeToKnockRequests() async { do { - knockRequestsChangesObservationToken = try await room.subscribeToKnockRequests(listener: SDKListener { [weak self] requests in + knockRequestsChangesObservationToken = try await room.subscribeToKnockRequests(listener: SDKListener.onMainActor { [weak self] requests in guard let self else { return } MXLog.info("Received requests to join update, requests id: \(requests.map(\.eventId))") diff --git a/ElementX/Sources/Services/Room/KnockRequestProxy.swift b/ElementX/Sources/Services/Room/KnockRequestProxy.swift index bb5f6d5d1..bbf2ce4c7 100644 --- a/ElementX/Sources/Services/Room/KnockRequestProxy.swift +++ b/ElementX/Sources/Services/Room/KnockRequestProxy.swift @@ -9,7 +9,7 @@ import Foundation import MatrixRustSDK -struct KnockRequestProxy: KnockRequestProxyProtocol { +nonisolated struct KnockRequestProxy: KnockRequestProxyProtocol { private let knockRequest: KnockRequest init(knockRequest: KnockRequest) { diff --git a/ElementX/Sources/Services/Room/KnockRequestProxyProtocol.swift b/ElementX/Sources/Services/Room/KnockRequestProxyProtocol.swift index 6f354013c..70085a52c 100644 --- a/ElementX/Sources/Services/Room/KnockRequestProxyProtocol.swift +++ b/ElementX/Sources/Services/Room/KnockRequestProxyProtocol.swift @@ -8,12 +8,12 @@ import Foundation -enum KnockRequestProxyError: Error { +nonisolated enum KnockRequestProxyError: Error { case sdkError(Error) } // sourcery: AutoMockable -protocol KnockRequestProxyProtocol { +nonisolated protocol KnockRequestProxyProtocol: Sendable { var eventID: String { get } var userID: String { get } var displayName: String? { get } diff --git a/ElementX/Sources/Services/Room/RoomInfoProxy.swift b/ElementX/Sources/Services/Room/RoomInfoProxy.swift index d87da7a6e..79f9373d5 100644 --- a/ElementX/Sources/Services/Room/RoomInfoProxy.swift +++ b/ElementX/Sources/Services/Room/RoomInfoProxy.swift @@ -9,7 +9,7 @@ import Foundation import MatrixRustSDK -struct RoomInfoProxy: RoomInfoProxyProtocol { +nonisolated struct RoomInfoProxy: RoomInfoProxyProtocol { let roomInfo: RoomInfo var id: String { @@ -166,7 +166,7 @@ struct RoomInfoProxy: RoomInfoProxyProtocol { } } -struct RoomPreviewInfoProxy: BaseRoomInfoProxyProtocol { +nonisolated struct RoomPreviewInfoProxy: BaseRoomInfoProxyProtocol { let roomPreviewInfo: RoomPreviewInfo let successor: SuccessorRoom? = nil diff --git a/ElementX/Sources/Services/Room/RoomInfoProxyProtocol.swift b/ElementX/Sources/Services/Room/RoomInfoProxyProtocol.swift index 32201488d..eb0f0043c 100644 --- a/ElementX/Sources/Services/Room/RoomInfoProxyProtocol.swift +++ b/ElementX/Sources/Services/Room/RoomInfoProxyProtocol.swift @@ -9,7 +9,7 @@ import Foundation import MatrixRustSDK -protocol BaseRoomInfoProxyProtocol { +nonisolated protocol BaseRoomInfoProxyProtocol: Sendable { var id: String { get } var displayName: String? { get } var topic: String? { get } @@ -25,7 +25,7 @@ protocol BaseRoomInfoProxyProtocol { } // sourcery: AutoMockable -protocol RoomInfoProxyProtocol: BaseRoomInfoProxyProtocol { +nonisolated protocol RoomInfoProxyProtocol: BaseRoomInfoProxyProtocol { var id: String { get } var creators: [String] { get } var displayName: String? { get } diff --git a/ElementX/Sources/Services/Room/RoomMember/RoomMemberDetails.swift b/ElementX/Sources/Services/Room/RoomMember/RoomMemberDetails.swift index 4afb7799f..096ac9161 100644 --- a/ElementX/Sources/Services/Room/RoomMember/RoomMemberDetails.swift +++ b/ElementX/Sources/Services/Room/RoomMember/RoomMemberDetails.swift @@ -9,7 +9,7 @@ import Foundation import MatrixRustSDK -struct RoomMemberDetails: Identifiable, Hashable { +nonisolated struct RoomMemberDetails: Identifiable, Hashable { let id: String let name: String? let avatarURL: URL? @@ -29,7 +29,7 @@ struct RoomMemberDetails: Identifiable, Hashable { } } -extension RoomMemberDetails { +nonisolated extension RoomMemberDetails { init(withProxy proxy: RoomMemberProxyProtocol) { id = proxy.userID name = proxy.displayName diff --git a/ElementX/Sources/Services/Room/RoomMember/RoomMemberProxy.swift b/ElementX/Sources/Services/Room/RoomMember/RoomMemberProxy.swift index a3e2a6e11..f0eb7508f 100644 --- a/ElementX/Sources/Services/Room/RoomMember/RoomMemberProxy.swift +++ b/ElementX/Sources/Services/Room/RoomMember/RoomMemberProxy.swift @@ -9,7 +9,7 @@ import Foundation import MatrixRustSDK -final class RoomMemberProxy: RoomMemberProxyProtocol { +final nonisolated class RoomMemberProxy: RoomMemberProxyProtocol { private let member: RoomMember init(member: RoomMember) { diff --git a/ElementX/Sources/Services/Room/RoomMember/RoomMemberProxyProtocol.swift b/ElementX/Sources/Services/Room/RoomMember/RoomMemberProxyProtocol.swift index 59084c414..de250e3f6 100644 --- a/ElementX/Sources/Services/Room/RoomMember/RoomMemberProxyProtocol.swift +++ b/ElementX/Sources/Services/Room/RoomMember/RoomMemberProxyProtocol.swift @@ -10,7 +10,7 @@ import Foundation import MatrixRustSDK // sourcery: AutoMockable -protocol RoomMemberProxyProtocol: AnyObject { +nonisolated protocol RoomMemberProxyProtocol: AnyObject, Sendable { var userID: String { get } var displayName: String? { get } @@ -29,7 +29,7 @@ protocol RoomMemberProxyProtocol: AnyObject { var isServiceMember: Bool { get } } -extension RoomMemberProxyProtocol { +nonisolated extension RoomMemberProxyProtocol { /// The member is active in the room (joined or invited). var isActive: Bool { membership == .join || membership == .invite || membership == .knock @@ -47,7 +47,7 @@ extension RoomMemberProxyProtocol { } } -extension [RoomMemberProxyProtocol] { +nonisolated extension [RoomMemberProxyProtocol] { /// The members, sorted first by power-level, and then alphabetically within each power-level. func sorted() -> Self { sorted { lhs, rhs in @@ -60,7 +60,7 @@ extension [RoomMemberProxyProtocol] { } } -extension RoomMemberProxyProtocol { +nonisolated extension RoomMemberProxyProtocol { var role: RoomRole { .init(powerLevel: powerLevel) } diff --git a/ElementX/Sources/Services/Room/RoomPermissions.swift b/ElementX/Sources/Services/Room/RoomPermissions.swift index 6bc6dd435..6691d75f4 100644 --- a/ElementX/Sources/Services/Room/RoomPermissions.swift +++ b/ElementX/Sources/Services/Room/RoomPermissions.swift @@ -74,7 +74,7 @@ struct RoomPermissionsSetting: Identifiable { } } -struct RoomPermissions { +nonisolated struct RoomPermissions { /// The level required to ban a user. var ban: Int64 /// The level required to invite a user. diff --git a/ElementX/Sources/Services/Room/RoomPowerLevel.swift b/ElementX/Sources/Services/Room/RoomPowerLevel.swift index 6eb342061..625a19307 100644 --- a/ElementX/Sources/Services/Room/RoomPowerLevel.swift +++ b/ElementX/Sources/Services/Room/RoomPowerLevel.swift @@ -8,7 +8,7 @@ import MatrixRustSDK -enum RoomPowerLevel: Hashable, Comparable { +nonisolated enum RoomPowerLevel: Hashable, Comparable { case value(Int) case infinite @@ -36,7 +36,7 @@ enum RoomPowerLevel: Hashable, Comparable { } } -extension PowerLevel { +nonisolated extension PowerLevel { var toRoomPowerLevel: RoomPowerLevel { switch self { case .infinite: .infinite diff --git a/ElementX/Sources/Services/Room/RoomPowerLevelProxyProtocol.swift b/ElementX/Sources/Services/Room/RoomPowerLevelProxyProtocol.swift index 4a9d32623..266d5accd 100644 --- a/ElementX/Sources/Services/Room/RoomPowerLevelProxyProtocol.swift +++ b/ElementX/Sources/Services/Room/RoomPowerLevelProxyProtocol.swift @@ -9,7 +9,7 @@ import MatrixRustSDK // sourcery: AutoMockable -protocol RoomPowerLevelsProxyProtocol { +protocol RoomPowerLevelsProxyProtocol: Sendable { var values: RoomPowerLevelsValues { get } var userPowerLevels: [String: Int64] { get } diff --git a/ElementX/Sources/Services/Room/RoomPowerLevelsProxy.swift b/ElementX/Sources/Services/Room/RoomPowerLevelsProxy.swift index 45fa56f5b..d823793a4 100644 --- a/ElementX/Sources/Services/Room/RoomPowerLevelsProxy.swift +++ b/ElementX/Sources/Services/Room/RoomPowerLevelsProxy.swift @@ -8,7 +8,7 @@ import MatrixRustSDK -struct RoomPowerLevelsProxy: RoomPowerLevelsProxyProtocol { +nonisolated struct RoomPowerLevelsProxy: RoomPowerLevelsProxyProtocol { private let powerLevels: RoomPowerLevels init?(_ powerLevels: RoomPowerLevels?) { diff --git a/ElementX/Sources/Services/Room/RoomPreview/RoomPreviewProxyProtocol.swift b/ElementX/Sources/Services/Room/RoomPreview/RoomPreviewProxyProtocol.swift index 5eb450b9b..85d49c342 100644 --- a/ElementX/Sources/Services/Room/RoomPreview/RoomPreviewProxyProtocol.swift +++ b/ElementX/Sources/Services/Room/RoomPreview/RoomPreviewProxyProtocol.swift @@ -9,7 +9,7 @@ import Foundation /// A preview object for the Room. useful to get all the possible info for rooms to which the user is not invited to -protocol RoomPreviewProxyProtocol { +protocol RoomPreviewProxyProtocol: Sendable { var info: RoomPreviewInfoProxy { get } var ownMembershipDetails: RoomMembershipDetailsProxyProtocol? { get async } } diff --git a/ElementX/Sources/Services/Room/RoomProxyProtocol.swift b/ElementX/Sources/Services/Room/RoomProxyProtocol.swift index 59126316c..e345cedd9 100644 --- a/ElementX/Sources/Services/Room/RoomProxyProtocol.swift +++ b/ElementX/Sources/Services/Room/RoomProxyProtocol.swift @@ -33,7 +33,7 @@ enum RoomProxyType { } // sourcery: AutoMockable -protocol RoomProxyProtocol { +protocol RoomProxyProtocol: Sendable { var id: String { get } var ownUserID: String { get } } diff --git a/ElementX/Sources/Services/Room/RoomRole.swift b/ElementX/Sources/Services/Room/RoomRole.swift index d2c4b439f..cfa5196d6 100644 --- a/ElementX/Sources/Services/Room/RoomRole.swift +++ b/ElementX/Sources/Services/Room/RoomRole.swift @@ -8,7 +8,7 @@ import MatrixRustSDK -enum RoomRole: Comparable { +nonisolated enum RoomRole: Comparable { /// Default role PL 0...49 case user /// Able to perform room moderation actions PL 50...99 @@ -21,7 +21,7 @@ enum RoomRole: Comparable { case creator } -extension RoomRole { +nonisolated extension RoomRole { init(powerLevel: RoomPowerLevel) { do { let role = try suggestedRoleForPowerLevel(powerLevel: powerLevel.rustPowerLevel) @@ -69,7 +69,7 @@ extension RoomRole { } } -extension RoomRole { +nonisolated extension RoomRole { init(powerLevelValue: Int64) { // Also this is not great, and should be handled by a `suggestedRoleForPowerLevelValue` function from the SDK guard powerLevelValue < 150 else { diff --git a/ElementX/Sources/Services/Room/RoomSummary/RoomEventStringBuilder.swift b/ElementX/Sources/Services/Room/RoomSummary/RoomEventStringBuilder.swift index 1bb3f75a5..a37669660 100644 --- a/ElementX/Sources/Services/Room/RoomSummary/RoomEventStringBuilder.swift +++ b/ElementX/Sources/Services/Room/RoomSummary/RoomEventStringBuilder.swift @@ -9,7 +9,7 @@ import Foundation import MatrixRustSDK -struct RoomEventStringBuilder { +nonisolated struct RoomEventStringBuilder { let stateEventStringBuilder: RoomStateEventStringBuilder let messageEventStringBuilder: RoomMessageEventStringBuilder let shouldPrefixSenderName: Bool diff --git a/ElementX/Sources/Services/Room/RoomSummary/RoomMessageEventStringBuilder.swift b/ElementX/Sources/Services/Room/RoomSummary/RoomMessageEventStringBuilder.swift index 8ae35985e..62aac98de 100644 --- a/ElementX/Sources/Services/Room/RoomSummary/RoomMessageEventStringBuilder.swift +++ b/ElementX/Sources/Services/Room/RoomSummary/RoomMessageEventStringBuilder.swift @@ -9,7 +9,7 @@ import Foundation import MatrixRustSDK -struct RoomMessageEventStringBuilder { +nonisolated struct RoomMessageEventStringBuilder { enum Style { /// Plain: no prefix, no special text treatment /// Shown in push notifications and thread lists diff --git a/ElementX/Sources/Services/Room/RoomSummary/RoomSummary.swift b/ElementX/Sources/Services/Room/RoomSummary/RoomSummary.swift index 52e08b662..6f7d4345d 100644 --- a/ElementX/Sources/Services/Room/RoomSummary/RoomSummary.swift +++ b/ElementX/Sources/Services/Room/RoomSummary/RoomSummary.swift @@ -10,7 +10,7 @@ import Foundation import MatrixRustSDK /// A quick summary of a Room, useful to describe and give quick informations for the room list -struct RoomSummary { +nonisolated struct RoomSummary { enum JoinRequestType { case invite(inviter: RoomMemberProxyProtocol?) case knock diff --git a/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift b/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift index 2ab3adfb4..13b85a7bc 100644 --- a/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift +++ b/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift @@ -20,8 +20,6 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol { private let roomListPageSize: UInt32 - private let serialDispatchQueue: DispatchQueue - private let visibleItemRangePublisher = CurrentValueSubject, Never>(0..<0) // periphery:ignore - retaining purpose @@ -35,7 +33,13 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol { private let roomListSubject = CurrentValueSubject<[RoomSummary], Never>([]) private let stateSubject = CurrentValueSubject(.notLoaded) - private let diffsPublisher = PassthroughSubject<[RoomListEntriesUpdate], Never>() + /// Bridge from the SDK's synchronous callback into Swift Concurrency. Yielding is safe from any + /// thread; a single long-lived `for await` consumer (set up in `init`) applies the diffs on the + /// main actor in FIFO order, guaranteeing one in-flight update at a time. + private let diffsContinuation: AsyncStream<[RoomListEntriesUpdate]>.Continuation + + /// Same bridging pattern as `diffsContinuation`, for the room list loading state. + private let loadingStateContinuation: AsyncStream.Continuation var roomListPublisher: CurrentValuePublisher<[RoomSummary], Never> { roomListSubject.asCurrentValuePublisher() @@ -64,7 +68,6 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol { notificationSettings: NotificationSettingsProxyProtocol, appSettings: AppSettings) { self.roomListService = roomListService - serialDispatchQueue = DispatchQueue(label: "io.element.elementx.room_summary_provider", qos: .default) self.eventStringBuilder = eventStringBuilder self.name = name self.shouldUpdateVisibleRange = shouldUpdateVisibleRange @@ -72,16 +75,35 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol { self.appSettings = appSettings self.roomListPageSize = roomListPageSize - diffsPublisher - .receive(on: serialDispatchQueue) - .sink { [weak self] in self?.updateRoomsWithDiffs($0) } - .store(in: &cancellables) + let (diffsStream, diffsContinuation) = AsyncStream<[RoomListEntriesUpdate]>.makeStream() + self.diffsContinuation = diffsContinuation + + let (loadingStateStream, loadingStateContinuation) = AsyncStream.makeStream() + self.loadingStateContinuation = loadingStateContinuation + + Task { [weak self] in + for await diffs in diffsStream { + await self?.updateRoomsWithDiffs(diffs) + } + } + + Task { [weak self, name] in + for await state in loadingStateStream { + MXLog.info("\(name): Received state update: \(state)") + self?.stateSubject.send(RoomSummaryProviderState(roomListState: state)) + } + } setupVisibleRangeObservers() setupNotificationSettingsSubscription() } + deinit { + diffsContinuation.finish() + loadingStateContinuation.finish() + } + func setRoomList(_ roomList: RoomList) { guard stateUpdatesTaskHandle == nil else { return @@ -91,18 +113,15 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol { do { listUpdatesSubscriptionResult = roomList.entriesWithDynamicAdapters(pageSize: UInt32(roomListPageSize), - listener: SDKListener { [weak self] updates in - guard let self else { return } - diffsPublisher.send(updates) + listener: SDKListener { [diffsContinuation] updates in + diffsContinuation.yield(updates) }) // Forces the listener above to be called with the current state setFilter(.all(filters: [])) - let stateUpdatesSubscriptionResult = try roomList.loadingState(listener: SDKListener { [weak self] state in - guard let self else { return } - MXLog.info("\(name): Received state update: \(state)") - stateSubject.send(RoomSummaryProviderState(roomListState: state)) + let stateUpdatesSubscriptionResult = try roomList.loadingState(listener: SDKListener { [loadingStateContinuation] state in + loadingStateContinuation.yield(state) }) stateUpdatesTaskHandle = stateUpdatesSubscriptionResult.stateStream @@ -208,20 +227,33 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol { .store(in: &cancellables) } - fileprivate func updateRoomsWithDiffs(_ diffs: [RoomListEntriesUpdate]) { + fileprivate func updateRoomsWithDiffs(_ diffs: [RoomListEntriesUpdate]) async { + // Building the room summaries (SDK fetches + string building) and applying the + // CollectionDifference can be expensive, so compute off the main actor and only + // hop back to publish the result. + rooms = await Self.updatedRooms(from: diffs, on: rooms, eventStringBuilder: eventStringBuilder, name: name) + } + + @concurrent + private static func updatedRooms(from diffs: [RoomListEntriesUpdate], + on currentRooms: [RoomSummary], + eventStringBuilder: RoomEventStringBuilder, + name: String) async -> [RoomSummary] { let span = MXLog.createSpan("\(name).process_room_list_diffs") span.enter() defer { span.exit() } - rooms = diffs.reduce(rooms) { currentItems, diff in - processDiff(diff, on: currentItems) + var updatedRooms = currentRooms + for diff in diffs { + updatedRooms = await processDiff(diff, on: updatedRooms, eventStringBuilder: eventStringBuilder, name: name) } + return updatedRooms } - private func processDiff(_ diff: RoomListEntriesUpdate, on currentItems: [RoomSummary]) -> [RoomSummary] { - guard let collectionDiff = buildDiff(from: diff, on: currentItems) else { + private nonisolated static func processDiff(_ diff: RoomListEntriesUpdate, on currentItems: [RoomSummary], eventStringBuilder: RoomEventStringBuilder, name: String) async -> [RoomSummary] { + guard let collectionDiff = await buildDiff(from: diff, on: currentItems, eventStringBuilder: eventStringBuilder) else { MXLog.error("\(name): Failed building CollectionDifference from \(diff)") return currentItems } @@ -234,30 +266,19 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol { return updatedItems } - private func fetchRoomDetails(from room: Room) -> (roomInfo: RoomInfo?, latestEvent: LatestEventValue?) { - class FetchResult { - var roomInfo: RoomInfo? - var latestEvent: LatestEventValue? + private nonisolated static func fetchRoomDetails(from room: Room) async -> (roomInfo: RoomInfo?, latestEvent: LatestEventValue?) { + do { + let latestEvent = await room.latestEvent() + let roomInfo = try await room.roomInfo() + return (roomInfo, latestEvent) + } catch { + MXLog.error("Failed fetching room info with error: \(error)") + return (nil, nil) } - - let semaphore = DispatchSemaphore(value: 0) - let result = FetchResult() - - Task { - do { - result.latestEvent = await room.latestEvent() - result.roomInfo = try await room.roomInfo() - } catch { - MXLog.error("Failed fetching room info with error: \(error)") - } - semaphore.signal() - } - semaphore.wait() - return (result.roomInfo, result.latestEvent) } - private func buildRoomSummary(from room: Room) -> RoomSummary { - let roomDetails = fetchRoomDetails(from: room) + private nonisolated static func buildRoomSummary(from room: Room, eventStringBuilder: RoomEventStringBuilder) async -> RoomSummary { + let roomDetails = await fetchRoomDetails(from: room) guard let roomInfo = roomDetails.roomInfo else { fatalError("Missing room info for \(room.id())") @@ -347,13 +368,13 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol { isTombstoned: roomInfo.successorRoom != nil) } - private func buildDiff(from diff: RoomListEntriesUpdate, on rooms: [RoomSummary]) -> CollectionDifference? { + private nonisolated static func buildDiff(from diff: RoomListEntriesUpdate, on rooms: [RoomSummary], eventStringBuilder: RoomEventStringBuilder) async -> CollectionDifference? { var changes = [CollectionDifference.Change]() switch diff { case .append(let values): for (index, value) in values.enumerated() { - let summary = buildRoomSummary(from: value) + let summary = await buildRoomSummary(from: value, eventStringBuilder: eventStringBuilder) changes.append(.insert(offset: rooms.count + index, element: summary, associatedWith: nil)) } case .clear: @@ -361,7 +382,7 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol { changes.append(.remove(offset: index, element: value, associatedWith: nil)) } case .insert(let index, let value): - let summary = buildRoomSummary(from: value) + let summary = await buildRoomSummary(from: value, eventStringBuilder: eventStringBuilder) changes.append(.insert(offset: Int(index), element: summary, associatedWith: nil)) case .popBack: guard let value = rooms.last else { @@ -373,10 +394,10 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol { let summary = rooms[0] changes.append(.remove(offset: 0, element: summary, associatedWith: nil)) case .pushBack(let value): - let summary = buildRoomSummary(from: value) + let summary = await buildRoomSummary(from: value, eventStringBuilder: eventStringBuilder) changes.append(.insert(offset: rooms.count, element: summary, associatedWith: nil)) case .pushFront(let value): - let summary = buildRoomSummary(from: value) + let summary = await buildRoomSummary(from: value, eventStringBuilder: eventStringBuilder) changes.append(.insert(offset: 0, element: summary, associatedWith: nil)) case .remove(let index): let summary = rooms[Int(index)] @@ -387,10 +408,10 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol { } for (index, value) in values.enumerated() { - changes.append(.insert(offset: index, element: buildRoomSummary(from: value), associatedWith: nil)) + await changes.append(.insert(offset: index, element: buildRoomSummary(from: value, eventStringBuilder: eventStringBuilder), associatedWith: nil)) } case .set(let index, let value): - let summary = buildRoomSummary(from: value) + let summary = await buildRoomSummary(from: value, eventStringBuilder: eventStringBuilder) changes.append(.remove(offset: Int(index), element: summary, associatedWith: nil)) changes.append(.insert(offset: Int(index), element: summary, associatedWith: nil)) case .truncate(let length): @@ -408,32 +429,40 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol { private func setupNotificationSettingsSubscription() { notificationSettings.callbacks - .receive(on: serialDispatchQueue) + .receive(on: DispatchQueue.main) .dropFirst() // drop the first one to avoid rebuilding the summaries during the first synchronization .sink { [weak self] callback in guard let self else { return } switch callback { case .settingsDidChange: - self.rebuildRoomSummaries() + Task { await self.rebuildRoomSummaries() } } } .store(in: &cancellables) } - private func rebuildRoomSummaries() { + private func rebuildRoomSummaries() async { + MXLog.info("\(name): Rebuilding room summaries for \(rooms.count) rooms") + + rooms = await Self.rebuiltRoomSummaries(from: rooms, eventStringBuilder: eventStringBuilder, name: name) + + MXLog.info("\(name): Finished rebuilding room summaries (\(rooms.count) rooms)") + } + + @concurrent + private static func rebuiltRoomSummaries(from rooms: [RoomSummary], eventStringBuilder: RoomEventStringBuilder, name: String) async -> [RoomSummary] { let span = MXLog.createSpan("\(name).rebuild_room_summaries") span.enter() defer { span.exit() } - MXLog.info("\(name): Rebuilding room summaries for \(rooms.count) rooms") - - rooms = rooms.map { - self.buildRoomSummary(from: $0.room) + var rebuiltRooms = [RoomSummary]() + rebuiltRooms.reserveCapacity(rooms.count) + for room in rooms { + await rebuiltRooms.append(buildRoomSummary(from: room.room, eventStringBuilder: eventStringBuilder)) } - - MXLog.info("\(name): Finished rebuilding room summaries (\(rooms.count) rooms)") + return rebuiltRooms } } diff --git a/ElementX/Sources/Services/Room/RoomThreadListServiceProxy.swift b/ElementX/Sources/Services/Room/RoomThreadListServiceProxy.swift index 0e31dd4b4..49b179419 100644 --- a/ElementX/Sources/Services/Room/RoomThreadListServiceProxy.swift +++ b/ElementX/Sources/Services/Room/RoomThreadListServiceProxy.swift @@ -20,23 +20,32 @@ class RoomThreadListProxy: RoomThreadListServiceProxyProtocol { } private var paginationStateHandle: TaskHandle? - let paginationStatePublisher: CurrentValuePublisher + private let paginationStateSubject: CurrentValueSubject + var paginationStatePublisher: CurrentValuePublisher { + paginationStateSubject.asCurrentValuePublisher() + } init(threadListService: ThreadListServiceProtocol, eventStringBuilder: RoomEventStringBuilder, paginationToken: String? = nil) { self.threadListService = threadListService self.eventStringBuilder = eventStringBuilder - let paginationStateSubject = CurrentValueSubject(.init(sdkState: threadListService.paginationState())) - paginationStatePublisher = paginationStateSubject.asCurrentValuePublisher() + paginationStateSubject = CurrentValueSubject(.init(sdkState: threadListService.paginationState())) - paginationStateHandle = threadListService.subscribeToPaginationStateUpdates(listener: SDKListener { state in - paginationStateSubject.send(.init(sdkState: state)) + // The listeners are called by the SDK from arbitrary threads, hop to the + // main actor where this proxy lives. + + paginationStateHandle = threadListService.subscribeToPaginationStateUpdates(listener: SDKListener { [weak self] state in + Task { @MainActor in + self?.paginationStateSubject.send(.init(sdkState: state)) + } }) updateItems() itemUpdatesHandle = self.threadListService.subscribeToItemsUpdates(listener: SDKListener { [weak self] _ in - self?.updateItems() + Task { @MainActor in + self?.updateItems() + } }) } diff --git a/ElementX/Sources/Services/RoomDirectorySearch/RoomDirectorySearchProxy.swift b/ElementX/Sources/Services/RoomDirectorySearch/RoomDirectorySearchProxy.swift index 5410f47d3..3f9ebccdc 100644 --- a/ElementX/Sources/Services/RoomDirectorySearch/RoomDirectorySearchProxy.swift +++ b/ElementX/Sources/Services/RoomDirectorySearch/RoomDirectorySearchProxy.swift @@ -12,7 +12,6 @@ import MatrixRustSDK final class RoomDirectorySearchProxy: RoomDirectorySearchProxyProtocol { private let roomDirectorySearch: RoomDirectorySearchProtocol - private let serialDispatchQueue = DispatchQueue(label: "io.element.elementx.room_directory_search_proxy", qos: .default) private let resultsSubject = CurrentValueSubject<[RoomDirectorySearchResult], Never>([]) @@ -25,22 +24,32 @@ final class RoomDirectorySearchProxy: RoomDirectorySearchProxyProtocol { set { resultsSubject.send(newValue) } } - private let diffsPublisher = PassthroughSubject<[RoomDirectorySearchEntryUpdate], Never>() + /// Bridge from the SDK's synchronous callback into Swift Concurrency. Yielding is safe from any + /// thread; a single long-lived `for await` consumer (set up in `init`) applies the updates on the + /// main actor in FIFO order, guaranteeing one in-flight update at a time. + private let updatesContinuation: AsyncStream<[RoomDirectorySearchEntryUpdate]>.Continuation private var searchEntriesSubscription: TaskHandle? - private var cancellables = Set() + deinit { + updatesContinuation.finish() + } init(roomDirectorySearch: RoomDirectorySearchProtocol) { self.roomDirectorySearch = roomDirectorySearch - diffsPublisher - .receive(on: serialDispatchQueue) - .sink { [weak self] in self?.updateResultsWithDiffs($0) } - .store(in: &cancellables) + + let (updatesStream, updatesContinuation) = AsyncStream<[RoomDirectorySearchEntryUpdate]>.makeStream() + self.updatesContinuation = updatesContinuation + + Task { [weak self] in + for await updates in updatesStream { + await self?.updateResultsWithDiffs(updates) + } + } Task { - searchEntriesSubscription = await roomDirectorySearch.results(listener: SDKListener { [weak self] updates in - self?.diffsPublisher.send(updates) + searchEntriesSubscription = await roomDirectorySearch.results(listener: SDKListener { updates in + updatesContinuation.yield(updates) }) } } @@ -63,13 +72,21 @@ final class RoomDirectorySearchProxy: RoomDirectorySearchProxyProtocol { } } - private func updateResultsWithDiffs(_ updates: [RoomDirectorySearchEntryUpdate]) { - results = updates.reduce(results) { currentItems, diff in + private func updateResultsWithDiffs(_ updates: [RoomDirectorySearchEntryUpdate]) async { + // Building the results and applying the CollectionDifference can be expensive for large + // search batches, so compute off the main actor and only hop back to publish. + results = await Self.updatedResults(from: updates, on: results) + } + + @concurrent + private static func updatedResults(from updates: [RoomDirectorySearchEntryUpdate], + on currentResults: [RoomDirectorySearchResult]) async -> [RoomDirectorySearchResult] { + updates.reduce(currentResults) { currentItems, diff in processDiff(diff, on: currentItems) } } - private func processDiff(_ diff: RoomDirectorySearchEntryUpdate, on currentItems: [RoomDirectorySearchResult]) -> [RoomDirectorySearchResult] { + private nonisolated static func processDiff(_ diff: RoomDirectorySearchEntryUpdate, on currentItems: [RoomDirectorySearchResult]) -> [RoomDirectorySearchResult] { guard let collectionDiff = buildDiff(from: diff, on: currentItems) else { return currentItems } @@ -81,42 +98,42 @@ final class RoomDirectorySearchProxy: RoomDirectorySearchProxyProtocol { return updatedItems } - private func buildDiff(from diff: RoomDirectorySearchEntryUpdate, on currentItems: [RoomDirectorySearchResult]) -> CollectionDifference? { + private nonisolated static func buildDiff(from diff: RoomDirectorySearchEntryUpdate, on currentItems: [RoomDirectorySearchResult]) -> CollectionDifference? { var changes = [CollectionDifference.Change]() switch diff { case .append(let values): for (index, value) in values.enumerated() { let result = buildResultForRoomDescription(value) - changes.append(.insert(offset: results.count + index, element: result, associatedWith: nil)) + changes.append(.insert(offset: currentItems.count + index, element: result, associatedWith: nil)) } case .clear: - for (index, value) in results.enumerated() { + for (index, value) in currentItems.enumerated() { changes.append(.remove(offset: index, element: value, associatedWith: nil)) } case .insert(let index, let value): let result = buildResultForRoomDescription(value) changes.append(.insert(offset: Int(index), element: result, associatedWith: nil)) case .popBack: - guard let value = results.last else { + guard let value = currentItems.last else { fatalError() } - changes.append(.remove(offset: results.count - 1, element: value, associatedWith: nil)) + changes.append(.remove(offset: currentItems.count - 1, element: value, associatedWith: nil)) case .popFront: - let result = results[0] + let result = currentItems[0] changes.append(.remove(offset: 0, element: result, associatedWith: nil)) case .pushBack(let value): let result = buildResultForRoomDescription(value) - changes.append(.insert(offset: results.count, element: result, associatedWith: nil)) + changes.append(.insert(offset: currentItems.count, element: result, associatedWith: nil)) case .pushFront(let value): let result = buildResultForRoomDescription(value) changes.append(.insert(offset: 0, element: result, associatedWith: nil)) case .remove(let index): - let result = results[Int(index)] + let result = currentItems[Int(index)] changes.append(.remove(offset: Int(index), element: result, associatedWith: nil)) case .reset(let values): - for (index, result) in results.enumerated() { + for (index, result) in currentItems.enumerated() { changes.append(.remove(offset: index, element: result, associatedWith: nil)) } @@ -128,7 +145,7 @@ final class RoomDirectorySearchProxy: RoomDirectorySearchProxyProtocol { changes.append(.remove(offset: Int(index), element: result, associatedWith: nil)) changes.append(.insert(offset: Int(index), element: result, associatedWith: nil)) case .truncate(let length): - for (index, value) in results.enumerated() { + for (index, value) in currentItems.enumerated() { if index < length { continue } @@ -140,7 +157,7 @@ final class RoomDirectorySearchProxy: RoomDirectorySearchProxyProtocol { return CollectionDifference(changes) } - private func buildResultForRoomDescription(_ value: RoomDescription) -> RoomDirectorySearchResult { + private nonisolated static func buildResultForRoomDescription(_ value: RoomDescription) -> RoomDirectorySearchResult { RoomDirectorySearchResult(id: value.roomId, alias: value.alias, name: value.name, diff --git a/ElementX/Sources/Services/RoomDirectorySearch/RoomDirectorySearchProxyProtocol.swift b/ElementX/Sources/Services/RoomDirectorySearch/RoomDirectorySearchProxyProtocol.swift index e26c1ad6e..86195ce85 100644 --- a/ElementX/Sources/Services/RoomDirectorySearch/RoomDirectorySearchProxyProtocol.swift +++ b/ElementX/Sources/Services/RoomDirectorySearch/RoomDirectorySearchProxyProtocol.swift @@ -21,7 +21,7 @@ enum RoomDirectorySearchError: Error { case nextPageQueryFailed } -struct RoomDirectorySearchResult: Identifiable { +nonisolated struct RoomDirectorySearchResult: Identifiable { let id: String let alias: String? let name: String? diff --git a/ElementX/Sources/Services/SecureBackup/SecureBackupController.swift b/ElementX/Sources/Services/SecureBackup/SecureBackupController.swift index 16c79e9e4..c8eca8a85 100644 --- a/ElementX/Sources/Services/SecureBackup/SecureBackupController.swift +++ b/ElementX/Sources/Services/SecureBackup/SecureBackupController.swift @@ -9,6 +9,7 @@ import Combine import Foundation import MatrixRustSDK +import Synchronization class SecureBackupController: SecureBackupControllerProtocol { private let encryption: Encryption @@ -36,7 +37,7 @@ class SecureBackupController: SecureBackupControllerProtocol { init(encryption: Encryption) { self.encryption = encryption - backupStateListenerTaskHandle = encryption.backupStateListener(listener: SDKListener { [weak self] state in + backupStateListenerTaskHandle = encryption.backupStateListener(listener: SDKListener.onMainActor { [weak self] state in guard let self else { return } switch state { @@ -63,7 +64,7 @@ class SecureBackupController: SecureBackupControllerProtocol { } }) - recoveryStateListenerTaskHandle = encryption.recoveryStateListener(listener: SDKListener { [weak self] state in + recoveryStateListenerTaskHandle = encryption.recoveryStateListener(listener: SDKListener.onMainActor { [weak self] state in guard let self else { return } switch state { @@ -118,10 +119,10 @@ class SecureBackupController: SecureBackupControllerProtocol { MXLog.info("Resetting recovery key") } - var keyUploadErrored = false + let keyUploadErrored = Mutex(false) // Note: `enableRecovery` also handles the reset case (equivalent to `resetRecoveryKey`). // Despite the name, it is the correct call for both initial setup and key rotation. - let recoveryKey = try await encryption.enableRecovery(waitForBackupsToUpload: false, passphrase: passphrase, progressListener: SDKListener { [weak self] state in + let recoveryKey = try await encryption.enableRecovery(waitForBackupsToUpload: false, passphrase: passphrase, progressListener: SDKListener.onMainActor { [weak self] state in guard let self else { return } switch state { @@ -131,11 +132,11 @@ class SecureBackupController: SecureBackupControllerProtocol { recoveryStateSubject.send(.enabled) case .roomKeyUploadError: MXLog.error("Failed enabling recovery: room key upload error") - keyUploadErrored = true + keyUploadErrored.withLock { $0 = true } } }) - return keyUploadErrored ? .failure(.failedGeneratingRecoveryKey) : .success(recoveryKey) + return keyUploadErrored.withLock { $0 } ? .failure(.failedGeneratingRecoveryKey) : .success(recoveryKey) } catch { MXLog.error("Failed generating recovery key with error: \(error)") @@ -157,7 +158,7 @@ class SecureBackupController: SecureBackupControllerProtocol { func waitForKeyBackupUpload(uploadStateSubject: CurrentValueSubject) async -> Result { do { MXLog.info("Waiting for backup upload steady state") - try await encryption.waitForBackupUploadSteadyState(progressListener: SDKListener { state in + try await encryption.waitForBackupUploadSteadyState(progressListener: SDKListener.onMainActor { state in let uploadState: SecureBackupSteadyState = switch state { case .waiting: .waiting case .uploading(let backedUpCount, let totalCount): .uploading(uploadedKeyCount: Int(backedUpCount), totalKeyCount: Int(totalCount)) diff --git a/ElementX/Sources/Services/SecureBackup/SecureBackupControllerProtocol.swift b/ElementX/Sources/Services/SecureBackup/SecureBackupControllerProtocol.swift index 6143a85e8..d67d19c97 100644 --- a/ElementX/Sources/Services/SecureBackup/SecureBackupControllerProtocol.swift +++ b/ElementX/Sources/Services/SecureBackup/SecureBackupControllerProtocol.swift @@ -9,7 +9,7 @@ import Combine import Foundation -enum SecureBackupRecoveryState { +nonisolated enum SecureBackupRecoveryState { case unknown case disabled case enabled @@ -19,7 +19,7 @@ enum SecureBackupRecoveryState { case settingUp } -enum SecureBackupKeyBackupState { +nonisolated enum SecureBackupKeyBackupState { /// Any state where backups couldn't have been enabled but we didn't explicitly disable them on this client. /// For all intents and purposes, within the client, this can be treated as `disabled`. case unknown diff --git a/ElementX/Sources/Services/Session/UserSessionProtocol.swift b/ElementX/Sources/Services/Session/UserSessionProtocol.swift index fb55e189f..a04cdbeb9 100644 --- a/ElementX/Sources/Services/Session/UserSessionProtocol.swift +++ b/ElementX/Sources/Services/Session/UserSessionProtocol.swift @@ -19,7 +19,7 @@ struct SessionSecurityState: Equatable { } // sourcery: AutoMockable -protocol UserSessionProtocol { +protocol UserSessionProtocol: Sendable { var clientProxy: ClientProxyProtocol { get } var mediaProvider: MediaProviderProtocol { get } var voiceMessageMediaManager: VoiceMessageMediaManagerProtocol { get } diff --git a/ElementX/Sources/Services/SessionVerification/SessionVerificationControllerProxy.swift b/ElementX/Sources/Services/SessionVerification/SessionVerificationControllerProxy.swift index f3ed06711..83caa0a8f 100644 --- a/ElementX/Sources/Services/SessionVerification/SessionVerificationControllerProxy.swift +++ b/ElementX/Sources/Services/SessionVerification/SessionVerificationControllerProxy.swift @@ -11,46 +11,63 @@ import Foundation import MatrixRustSDK private final class WeakSessionVerificationControllerProxy: SessionVerificationControllerDelegate { - private weak var proxy: SessionVerificationControllerProxy? + @MainActor private weak var proxy: SessionVerificationControllerProxy? - init(proxy: SessionVerificationControllerProxy) { + @MainActor init(proxy: SessionVerificationControllerProxy) { self.proxy = proxy } // MARK: - SessionVerificationControllerDelegate + // The delegate methods are called by the SDK from arbitrary threads, + // hop to the main actor where the proxy lives. + func didReceiveVerificationRequest(details: MatrixRustSDK.SessionVerificationRequestDetails) { - proxy?.didReceiveVerificationRequest(details: details) + Task { @MainActor in + self.proxy?.didReceiveVerificationRequest(details: details) + } } func didReceiveVerificationData(data: MatrixRustSDK.SessionVerificationData) { switch data { // We can handle only emojis for now case .emojis(let emojis, _): - proxy?.didReceiveData(emojis) + Task { @MainActor in + self.proxy?.didReceiveData(emojis) + } default: break } } func didAcceptVerificationRequest() { - proxy?.didAcceptVerificationRequest() + Task { @MainActor in + self.proxy?.didAcceptVerificationRequest() + } } func didStartSasVerification() { - proxy?.didStartSasVerification() + Task { @MainActor in + self.proxy?.didStartSasVerification() + } } func didFail() { - proxy?.didFail() + Task { @MainActor in + self.proxy?.didFail() + } } func didCancel() { - proxy?.didCancel() + Task { @MainActor in + self.proxy?.didCancel() + } } func didFinish() { - proxy?.didFinish() + Task { @MainActor in + self.proxy?.didFinish() + } } } diff --git a/ElementX/Sources/Services/Spaces/SpaceRoomListProxy.swift b/ElementX/Sources/Services/Spaces/SpaceRoomListProxy.swift index 16f11d58e..65568d7d4 100644 --- a/ElementX/Sources/Services/Spaces/SpaceRoomListProxy.swift +++ b/ElementX/Sources/Services/Spaces/SpaceRoomListProxy.swift @@ -28,27 +28,31 @@ class SpaceRoomListProxy: SpaceRoomListProxyProtocol { spaceRoomsSubject.asCurrentValuePublisher() } - private let paginationStateHandle: TaskHandle - let paginationStatePublisher: CurrentValuePublisher + private var paginationStateHandle: TaskHandle? + private let paginationStateSubject: CurrentValueSubject + var paginationStatePublisher: CurrentValuePublisher { + paginationStateSubject.asCurrentValuePublisher() + } init(_ spaceRoomList: SpaceRoomListProtocol) async throws { guard let spaceRoom = spaceRoomList.space() else { throw SpaceRoomListProxyError.missingSpace } self.spaceRoomList = spaceRoomList spaceServiceRoomSubject = .init(SpaceServiceRoom(spaceRoom: spaceRoom)) + paginationStateSubject = .init(spaceRoomList.paginationState()) - let paginationStateSubject = CurrentValueSubject(spaceRoomList.paginationState()) - paginationStatePublisher = paginationStateSubject.asCurrentValuePublisher() - - paginationStateHandle = spaceRoomList.subscribeToPaginationStateUpdates(listener: SDKListener { paginationState in - paginationStateSubject.send(paginationState) + // The SDK calls listeners from arbitrary threads; onMainActor applies the updates on the + // main actor in FIFO order. The subscriptions (and so the listeners) live as long as their + // handles, which are released when this proxy is deallocated. + paginationStateHandle = spaceRoomList.subscribeToPaginationStateUpdates(listener: SDKListener.onMainActor { [weak self] paginationState in + self?.paginationStateSubject.send(paginationState) }) - spaceRoomsHandle = await spaceRoomList.subscribeToRoomUpdate(listener: SDKListener { [weak self] updates in + spaceRoomsHandle = await spaceRoomList.subscribeToRoomUpdate(listener: SDKListener.onMainActor { [weak self] updates in self?.handleUpdates(updates) }) - spaceServiceRoomHandle = spaceRoomList.subscribeToSpaceUpdates(listener: SDKListener { [weak self] spaceRoom in + spaceServiceRoomHandle = spaceRoomList.subscribeToSpaceUpdates(listener: SDKListener.onMainActor { [weak self] spaceRoom in guard let spaceRoom else { return } self?.spaceServiceRoomSubject.send(SpaceServiceRoom(spaceRoom: spaceRoom)) }) diff --git a/ElementX/Sources/Services/Spaces/SpaceRoomListProxyProtocol.swift b/ElementX/Sources/Services/Spaces/SpaceRoomListProxyProtocol.swift index bad02b771..d1ae5c5d4 100644 --- a/ElementX/Sources/Services/Spaces/SpaceRoomListProxyProtocol.swift +++ b/ElementX/Sources/Services/Spaces/SpaceRoomListProxyProtocol.swift @@ -14,7 +14,7 @@ enum SpaceRoomListProxyError: Error { } // sourcery: AutoMockable -protocol SpaceRoomListProxyProtocol { +protocol SpaceRoomListProxyProtocol: Sendable { var id: String { get } var spaceServiceRoomPublisher: CurrentValuePublisher { get } diff --git a/ElementX/Sources/Services/Spaces/SpaceServiceProxy.swift b/ElementX/Sources/Services/Spaces/SpaceServiceProxy.swift index 9a5e1fb28..8f9acf4dc 100644 --- a/ElementX/Sources/Services/Spaces/SpaceServiceProxy.swift +++ b/ElementX/Sources/Services/Spaces/SpaceServiceProxy.swift @@ -25,19 +25,48 @@ class SpaceServiceProxy: SpaceServiceProxyProtocol { spaceFilterSubject.asCurrentValuePublisher() } + // Bridges from the SDK's synchronous callbacks into Swift Concurrency. Yielding is safe from + // any thread; single long-lived `for await` consumers (set up in `init`) apply the updates on + // the main actor in FIFO order, guaranteeing one in-flight update at a time. + private let spaceListUpdatesContinuation: AsyncStream<[SpaceListUpdate]>.Continuation + private let spaceFilterUpdatesContinuation: AsyncStream<[SpaceFilterUpdate]>.Continuation + + deinit { + spaceListUpdatesContinuation.finish() + spaceFilterUpdatesContinuation.finish() + } + init(spaceService: SpaceServiceProtocol) { self.spaceService = spaceService + let (spaceListUpdates, spaceListUpdatesContinuation) = AsyncStream<[SpaceListUpdate]>.makeStream() + self.spaceListUpdatesContinuation = spaceListUpdatesContinuation + + let (spaceFilterUpdates, spaceFilterUpdatesContinuation) = AsyncStream<[SpaceFilterUpdate]>.makeStream() + self.spaceFilterUpdatesContinuation = spaceFilterUpdatesContinuation + + Task { [weak self] in + for await updates in spaceListUpdates { + self?.handleSpaceListUpdates(updates) + } + } + + Task { [weak self] in + for await updates in spaceFilterUpdates { + self?.handleSpaceFilterUpdates(updates) + } + } + Task { await setupSubscriptions() } } private func setupSubscriptions() async { - topLevelSpacesHandle = await spaceService.subscribeToTopLevelJoinedSpaces(listener: SDKListener { [weak self] updates in - self?.handleSpaceListUpdates(updates) + topLevelSpacesHandle = await spaceService.subscribeToTopLevelJoinedSpaces(listener: SDKListener { [spaceListUpdatesContinuation] updates in + spaceListUpdatesContinuation.yield(updates) }) - spaceFilterHandle = await spaceService.subscribeToSpaceFilters(listener: SDKListener { [weak self] updates in - self?.handleSpaceFilterUpdates(updates) + spaceFilterHandle = await spaceService.subscribeToSpaceFilters(listener: SDKListener { [spaceFilterUpdatesContinuation] updates in + spaceFilterUpdatesContinuation.yield(updates) }) } diff --git a/ElementX/Sources/Services/Timeline/GeoURI.swift b/ElementX/Sources/Services/Timeline/GeoURI.swift index 4e6034107..8c03ea28d 100644 --- a/ElementX/Sources/Services/Timeline/GeoURI.swift +++ b/ElementX/Sources/Services/Timeline/GeoURI.swift @@ -10,7 +10,7 @@ import CoreLocation import Foundation /// A structure that parses a geo URI (i.e. geo:53.99803101552848,-8.25347900390625;u=10) and constructs their constituent parts. -struct GeoURI: Hashable { +nonisolated struct GeoURI: Hashable { // MARK: - Properties let latitude: Double @@ -69,8 +69,11 @@ struct GeoURI: Hashable { // swiftlint:disable:next large_tuple private typealias RegexGeoURI = Regex<(Substring, latitude: Substring, longitude: Substring, uncertainty: Substring?)> -private extension RegexGeoURI { - static let standard: Self = /geo:(?-?\d+(?:\.\d+)?),(?-?\d+(?:\.\d+)?)(?:,-?\d+(?:\.\d+)?)?(?:;u=(?\d+(?:\.\d+)?))?/ +private nonisolated extension RegexGeoURI { + /// A computed property as `Regex` isn't Sendable. + static var standard: Self { + /geo:(?-?\d+(?:\.\d+)?),(?-?\d+(?:\.\d+)?)(?:,-?\d+(?:\.\d+)?)?(?:;u=(?\d+(?:\.\d+)?))?/ + } } extension GeoURI { @@ -79,7 +82,7 @@ extension GeoURI { } } -private extension NumberFormatter { +private nonisolated extension NumberFormatter { static let decimal: NumberFormatter = { let numberFormatter = NumberFormatter() numberFormatter.locale = Locale(identifier: "en_US_POSIX") diff --git a/ElementX/Sources/Services/Timeline/TimelineController/TimelineController.swift b/ElementX/Sources/Services/Timeline/TimelineController/TimelineController.swift index 91e783b23..e045efbdc 100644 --- a/ElementX/Sources/Services/Timeline/TimelineController/TimelineController.swift +++ b/ElementX/Sources/Services/Timeline/TimelineController/TimelineController.swift @@ -574,10 +574,14 @@ class TimelineController: TimelineControllerProtocol { switch timelineItem.properties.replyDetails { case .notLoaded: - activeTimeline.fetchDetails(for: eventID) + Task { @MainActor in + activeTimeline.fetchDetails(for: eventID) + } case .error: if refetchOnError { - activeTimeline.fetchDetails(for: eventID) + Task { @MainActor in + activeTimeline.fetchDetails(for: eventID) + } } default: break @@ -653,7 +657,7 @@ class TimelineController: TimelineControllerProtocol { } } -private extension TimelineItemProxy { +private nonisolated extension TimelineItemProxy { var isItemCollapsible: Bool { if case let .event(eventItem) = self { switch eventItem.content { diff --git a/ElementX/Sources/Services/Timeline/TimelineController/TimelineControllerFactoryProtocol.swift b/ElementX/Sources/Services/Timeline/TimelineController/TimelineControllerFactoryProtocol.swift index 9eb2bacbd..019d8b132 100644 --- a/ElementX/Sources/Services/Timeline/TimelineController/TimelineControllerFactoryProtocol.swift +++ b/ElementX/Sources/Services/Timeline/TimelineController/TimelineControllerFactoryProtocol.swift @@ -13,7 +13,6 @@ enum TimelineFactoryControllerError: Error { case roomProxyError(RoomProxyError) } -@MainActor protocol TimelineControllerFactoryProtocol { func buildTimelineController(roomProxy: JoinedRoomProxyProtocol, initialFocussedEventID: String?, diff --git a/ElementX/Sources/Services/Timeline/TimelineItemContent/AggregratedReaction.swift b/ElementX/Sources/Services/Timeline/TimelineItemContent/AggregratedReaction.swift index 45d566a9e..489a1779c 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItemContent/AggregratedReaction.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItemContent/AggregratedReaction.swift @@ -9,7 +9,7 @@ import Foundation /// Represents all reactions of the same type for a single event. -struct AggregatedReaction: Hashable, Identifiable { +nonisolated struct AggregatedReaction: Hashable, Identifiable { /// Length at which we ellipsize a reaction key for display /// Reactions can be free text, so we need to limit the length /// displayed on screen. @@ -28,14 +28,14 @@ struct AggregatedReaction: Hashable, Identifiable { } /// Details of who sent the reaction -struct ReactionSender: Hashable, Identifiable { +nonisolated struct ReactionSender: Hashable, Identifiable { /// The id of the user who sent the reaction let id: String /// The time that the reaction was received on the original homeserver let timestamp: Date } -extension AggregatedReaction { +nonisolated extension AggregatedReaction { /// The number of times this reactions was sent. var count: Int { senders.count diff --git a/ElementX/Sources/Services/Timeline/TimelineItemContent/EncryptionAuthenticity.swift b/ElementX/Sources/Services/Timeline/TimelineItemContent/EncryptionAuthenticity.swift index 92cfdaa00..514b9858a 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItemContent/EncryptionAuthenticity.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItemContent/EncryptionAuthenticity.swift @@ -13,7 +13,7 @@ import SwiftUI /// Represents an issue with a timeline item's authenticity such as coming from an /// unsigned session or being sent unencrypted in an encrypted room. See Rust's /// `ShieldStateCode` for more information about the meaning of the cases. -enum EncryptionAuthenticity: Hashable { +nonisolated enum EncryptionAuthenticity: Hashable { enum Color { case red, gray } case notGuaranteed(color: Color) @@ -65,7 +65,7 @@ enum EncryptionAuthenticity: Hashable { } } -extension EncryptionAuthenticity { +nonisolated extension EncryptionAuthenticity { init?(shieldState: ShieldState) { switch shieldState { case .red(let code): diff --git a/ElementX/Sources/Services/Timeline/TimelineItemContent/ReadReceipt.swift b/ElementX/Sources/Services/Timeline/TimelineItemContent/ReadReceipt.swift index 935f8db18..7996b6e2b 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItemContent/ReadReceipt.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItemContent/ReadReceipt.swift @@ -8,12 +8,12 @@ import Foundation -struct ReadReceipt: Hashable { +nonisolated struct ReadReceipt: Hashable { let userID: String let formattedTimestamp: String? } -extension ReadReceipt: Identifiable { +nonisolated extension ReadReceipt: Identifiable { var id: String { userID } diff --git a/ElementX/Sources/Services/Timeline/TimelineItemContent/RoomTimelineItemProperties.swift b/ElementX/Sources/Services/Timeline/TimelineItemContent/RoomTimelineItemProperties.swift index d72e41c54..0a2c55883 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItemContent/RoomTimelineItemProperties.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItemContent/RoomTimelineItemProperties.swift @@ -9,7 +9,7 @@ import Foundation /// Properties of a matrix event that are common between all timeline items. -struct RoomTimelineItemProperties: Hashable { +nonisolated struct RoomTimelineItemProperties: Hashable { /// Information on the item this one replying to var replyDetails: TimelineItemReplyDetails? /// Whether it's part of a thread or not diff --git a/ElementX/Sources/Services/Timeline/TimelineItemContent/TimelineEventContent.swift b/ElementX/Sources/Services/Timeline/TimelineItemContent/TimelineEventContent.swift index 7983eaa2f..04d53e91e 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItemContent/TimelineEventContent.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItemContent/TimelineEventContent.swift @@ -8,7 +8,7 @@ import Foundation -enum TimelineEventContent: Hashable { +nonisolated enum TimelineEventContent: Hashable { case message(EventBasedMessageTimelineItemContentType) case poll(question: String) case liveLocation diff --git a/ElementX/Sources/Services/Timeline/TimelineItemContent/TimelineItemKeyForwarder.swift b/ElementX/Sources/Services/Timeline/TimelineItemContent/TimelineItemKeyForwarder.swift index 3f4a4b766..88d47a1a2 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItemContent/TimelineItemKeyForwarder.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItemContent/TimelineItemKeyForwarder.swift @@ -8,7 +8,7 @@ import MatrixRustSDK import SwiftUI -struct TimelineItemKeyForwarder: Identifiable, Hashable { +nonisolated struct TimelineItemKeyForwarder: Identifiable, Hashable { let id: String let displayName: String? diff --git a/ElementX/Sources/Services/Timeline/TimelineItemContent/TimelineItemReplyDetails.swift b/ElementX/Sources/Services/Timeline/TimelineItemContent/TimelineItemReplyDetails.swift index 4c27c1962..77859447d 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItemContent/TimelineItemReplyDetails.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItemContent/TimelineItemReplyDetails.swift @@ -8,12 +8,12 @@ import Foundation -struct TimelineItemReply { +nonisolated struct TimelineItemReply { let details: TimelineItemReplyDetails let isThreaded: Bool } -enum TimelineItemReplyDetails: Hashable { +nonisolated enum TimelineItemReplyDetails: Hashable { case notLoaded(eventID: String) case loading(eventID: String) case loaded(sender: TimelineItemSender, eventID: String, eventContent: TimelineEventContent) diff --git a/ElementX/Sources/Services/Timeline/TimelineItemContent/TimelineItemThreadSummary.swift b/ElementX/Sources/Services/Timeline/TimelineItemContent/TimelineItemThreadSummary.swift index bc47d442d..0c8eedae5 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItemContent/TimelineItemThreadSummary.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItemContent/TimelineItemThreadSummary.swift @@ -6,7 +6,7 @@ // Please see LICENSE files in the repository root for full details. // -enum TimelineItemThreadSummary: Hashable { +nonisolated enum TimelineItemThreadSummary: Hashable { case notLoaded case loading case loaded(senderID: String, sender: TimelineItemSender, latestEventContent: TimelineEventContent, numberOfReplies: Int) diff --git a/ElementX/Sources/Services/Timeline/TimelineItemIdentifier.swift b/ElementX/Sources/Services/Timeline/TimelineItemIdentifier.swift index 328eb23c7..c76053a23 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItemIdentifier.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItemIdentifier.swift @@ -14,7 +14,7 @@ import Foundation /// Its value is consistent only per timeline instance, it should **not** be used to identify an item across timeline instances. /// - eventOrTransactionID: Contains the 2 possible identifiers of an event, either it has a remote event id or /// a local transaction id, never both or none. -enum TimelineItemIdentifier: Hashable { +nonisolated enum TimelineItemIdentifier: Hashable { struct UniqueID: Hashable { let value: String @@ -77,7 +77,7 @@ enum TimelineItemIdentifier: Hashable { // MARK: - Mocks -extension TimelineItemIdentifier { +nonisolated extension TimelineItemIdentifier { static var randomEvent: Self { .event(uniqueID: .init(UUID().uuidString), eventOrTransactionID: .eventID(UUID().uuidString)) } diff --git a/ElementX/Sources/Services/Timeline/TimelineItemProvider.swift b/ElementX/Sources/Services/Timeline/TimelineItemProvider.swift index 725e8447c..45df11153 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItemProvider.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItemProvider.swift @@ -68,7 +68,7 @@ class TimelineItemProvider: TimelineItemProviderProtocol { // The stream also allows to handle the sendable items in the listener. Task { [weak self] in for await diffs in diffStream { - self?.updateItemsWithDiffs(diffs) + await self?.applyDiffs(diffs) } } @@ -81,17 +81,34 @@ class TimelineItemProvider: TimelineItemProviderProtocol { // MARK: - Private - private func updateItemsWithDiffs(_ diffs: [TimelineDiff]) { - let span = MXLog.createSpan("process_timeline_list_diffs:\(kind)") + private func applyDiffs(_ diffs: [TimelineDiff]) async { + MXLog.verbose("Received diffs: \(diffs)") + + // Building the item proxies and computing/applying the CollectionDifference can be + // expensive, so run it off the main actor and only hop back to publish the result. + let result = await Self.processDiffs(diffs, on: itemProxies, spanName: "process_timeline_list_diffs:\(kind)") + + itemProxies = result.itemProxies + + if result.hasMembershipChange { + membershipChangeSubject.send(()) + } + } + + @concurrent + private static func processDiffs(_ diffs: [TimelineDiff], + on currentItems: [TimelineItemProxy], + spanName: String) async -> (itemProxies: [TimelineItemProxy], hasMembershipChange: Bool) { + let span = MXLog.createSpan(spanName) span.enter() defer { span.exit() } - MXLog.verbose("Received diffs: \(diffs)") + var hasMembershipChange = false - itemProxies = diffs.reduce(itemProxies) { currentItems, diff in - guard let collectionDiff = buildDiff(from: diff, on: currentItems) else { + let itemProxies = diffs.reduce(currentItems) { currentItems, diff in + guard let collectionDiff = buildDiff(from: diff, on: currentItems, hasMembershipChange: &hasMembershipChange) else { MXLog.error("Failed building CollectionDifference from \(diff)") return currentItems } @@ -103,9 +120,11 @@ class TimelineItemProvider: TimelineItemProviderProtocol { return updatedItems } + + return (itemProxies, hasMembershipChange) } - private func buildDiff(from diff: TimelineDiff, on itemProxies: [TimelineItemProxy]) -> CollectionDifference? { + private nonisolated static func buildDiff(from diff: TimelineDiff, on itemProxies: [TimelineItemProxy], hasMembershipChange: inout Bool) -> CollectionDifference? { var changes = [CollectionDifference.Change]() switch diff { @@ -114,7 +133,7 @@ class TimelineItemProvider: TimelineItemProviderProtocol { let itemProxy = TimelineItemProxy(item: item) if itemProxy.isMembershipChange { - membershipChangeSubject.send(()) + hasMembershipChange = true } changes.append(.insert(offset: Int(itemProxies.count) + index, element: itemProxy, associatedWith: nil)) @@ -138,7 +157,7 @@ class TimelineItemProvider: TimelineItemProviderProtocol { let itemProxy = TimelineItemProxy(item: item) if itemProxy.isMembershipChange { - membershipChangeSubject.send(()) + hasMembershipChange = true } changes.append(.insert(offset: Int(itemProxies.count), element: itemProxy, associatedWith: nil)) @@ -170,7 +189,7 @@ class TimelineItemProvider: TimelineItemProviderProtocol { } } -private extension TimelineItemProxy { +private nonisolated extension TimelineItemProxy { var isMembershipChange: Bool { switch self { case .event(let eventTimelineItemProxy): diff --git a/ElementX/Sources/Services/Timeline/TimelineItemProviderProtocol.swift b/ElementX/Sources/Services/Timeline/TimelineItemProviderProtocol.swift index 67359a8e2..ce9881c60 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItemProviderProtocol.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItemProviderProtocol.swift @@ -10,10 +10,10 @@ import Combine import Foundation import MatrixRustSDK -struct TimelinePaginationState: Equatable { +nonisolated struct TimelinePaginationState: Equatable { /// An initial state that is used to prevent pagination whilst loading the timeline. /// Once the initial items are loaded the TimelineProxy will publish the correct value. - static var initial = TimelinePaginationState(backward: .endReached, forward: .endReached) + static let initial = TimelinePaginationState(backward: .endReached, forward: .endReached) let backward: PaginationState let forward: PaginationState } @@ -21,7 +21,6 @@ struct TimelinePaginationState: Equatable { /// Entities implementing this protocol are responsible for processings diffs coming from the rust timeline /// and converting them into an array of Element X specific ``TimelineItemProxy``s that will be /// published as an array together with the pagination state through the ``updatePublisher``. -@MainActor protocol TimelineItemProviderProtocol { /// A publisher that signals when ``itemProxies`` or ``paginationState`` are changed. var updatePublisher: AnyPublisher<([TimelineItemProxy], TimelinePaginationState), Never> { get } diff --git a/ElementX/Sources/Services/Timeline/TimelineItemProxy.swift b/ElementX/Sources/Services/Timeline/TimelineItemProxy.swift index 02ed60743..ac81b5a8d 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItemProxy.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItemProxy.swift @@ -11,7 +11,7 @@ import MatrixRustSDK import MatrixRustSDKMocks /// A light wrapper around timeline items returned from Rust. -enum TimelineItemProxy { +nonisolated enum TimelineItemProxy { case event(EventTimelineItemProxy) case virtual(MatrixRustSDK.VirtualTimelineItem, uniqueID: TimelineItemIdentifier.UniqueID) case unknown(MatrixRustSDK.TimelineItem) @@ -37,7 +37,7 @@ enum TimelineItemProxy { } /// The delivery status for the item. -enum TimelineItemDeliveryStatus: Hashable { +nonisolated enum TimelineItemDeliveryStatus: Hashable { case sending case sent case sendingFailed(TimelineItemSendFailure) @@ -51,7 +51,7 @@ enum TimelineItemDeliveryStatus: Hashable { } /// The reason a timeline item failed to send. -enum TimelineItemSendFailure: Hashable { +nonisolated enum TimelineItemSendFailure: Hashable { enum VerifiedUser: Hashable { case hasUnsignedDevice(devices: [String: [String]]) case changedIdentity(users: [String]) @@ -69,7 +69,11 @@ enum TimelineItemSendFailure: Hashable { } /// A light wrapper around event timeline items returned from Rust. -class EventTimelineItemProxy { +/// +/// The proxy is shared between the main actor and the background timeline item +/// building, so it's stateless and forwards everything to the underlying +/// (internally synchronised) Rust object. +final nonisolated class EventTimelineItemProxy: Sendable { let item: MatrixRustSDK.EventTimelineItem let id: TimelineItemIdentifier @@ -79,13 +83,13 @@ class EventTimelineItemProxy { id = .event(uniqueID: uniqueID, eventOrTransactionID: .init(rustValue: item.eventOrTransactionId)) } - lazy var deliveryStatus: TimelineItemDeliveryStatus? = { + var deliveryStatus: TimelineItemDeliveryStatus? { guard let localSendState = item.localSendState else { return nil } switch localSendState { - case .sendingFailed(let error, let isRecoverable): + case .sendingFailed(let error, _): switch error { case .identityViolations(let users): return .sendingFailed(.verifiedUser(.changedIdentity(users: users))) @@ -99,42 +103,62 @@ class EventTimelineItemProxy { case .sent: return .sent } - }() + } - lazy var canBeRepliedTo = item.canBeRepliedTo + var canBeRepliedTo: Bool { + item.canBeRepliedTo + } - lazy var content = item.content + var content: TimelineItemContent { + item.content + } - lazy var isOwn = item.isOwn + var isOwn: Bool { + item.isOwn + } - lazy var isEditable = item.isEditable + var isEditable: Bool { + item.isEditable + } - lazy var sender = TimelineItemSender(senderID: item.sender, senderProfile: item.senderProfile) + var sender: TimelineItemSender { + TimelineItemSender(senderID: item.sender, senderProfile: item.senderProfile) + } - lazy var forwarder: TimelineItemKeyForwarder? = { + var forwarder: TimelineItemKeyForwarder? { guard let forwarderID = item.forwarder, let forwarderProfile = item.forwarderProfile else { return nil } return TimelineItemKeyForwarder(forwarderID: forwarderID, forwarderProfile: forwarderProfile) - }() + } - lazy var timestamp = Date(timeIntervalSince1970: TimeInterval(item.timestamp / 1000)) + var timestamp: Date { + Date(timeIntervalSince1970: TimeInterval(item.timestamp / 1000)) + } - lazy var debugInfo: TimelineItemDebugInfo = { + var debugInfo: TimelineItemDebugInfo { let debugInfo = item.lazyProvider.debugInfo() return TimelineItemDebugInfo(model: debugInfo.model, originalJSON: debugInfo.originalJson, latestEditJSON: debugInfo.latestEditJson) - }() + } - lazy var shieldState = item.lazyProvider.getShields(strict: false) + var shieldState: ShieldState? { + item.lazyProvider.getShields(strict: false) + } - lazy var sendHandle = item.lazyProvider.getSendHandle() + var sendHandle: SendHandle? { + item.lazyProvider.getSendHandle() + } - lazy var shouldBoost = item.lazyProvider.containsOnlyEmojis() + var shouldBoost: Bool { + item.lazyProvider.containsOnlyEmojis() + } - lazy var readReceipts = item.readReceipts + var readReceipts: [String: Receipt] { + item.readReceipts + } } -struct TimelineItemDebugInfo: Identifiable, CustomStringConvertible { +nonisolated struct TimelineItemDebugInfo: Identifiable, CustomStringConvertible { let id = UUID() let model: String let originalJSON: String? @@ -175,7 +199,7 @@ struct TimelineItemDebugInfo: Identifiable, CustomStringConvertible { } } -struct SendHandleProxy: Hashable { +nonisolated struct SendHandleProxy: Hashable { enum Error: Swift.Error { case sdkError(Swift.Error) } @@ -209,7 +233,7 @@ struct SendHandleProxy: Hashable { } } -struct VideoInfoProxy: Hashable { +nonisolated struct VideoInfoProxy: Hashable { let source: MediaSourceProxy private(set) var duration: TimeInterval private(set) var size: CGSize? @@ -253,7 +277,7 @@ struct VideoInfoProxy: Hashable { } } -struct ImageInfoProxy: Hashable { +nonisolated struct ImageInfoProxy: Hashable { let source: MediaSourceProxy private(set) var size: CGSize? private(set) var aspectRatio: CGFloat? @@ -317,7 +341,7 @@ struct ImageInfoProxy: Hashable { } } -private struct MediaInfoProxy: Hashable { +private nonisolated struct MediaInfoProxy: Hashable { private(set) var size: CGSize? private(set) var mimeType: String? private(set) var aspectRatio: CGFloat? diff --git a/ElementX/Sources/Services/Timeline/TimelineItemSender.swift b/ElementX/Sources/Services/Timeline/TimelineItemSender.swift index 6eb11f1f4..98ca01305 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItemSender.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItemSender.swift @@ -9,7 +9,7 @@ import MatrixRustSDK import SwiftUI -struct TimelineItemSender: Identifiable, Hashable { +nonisolated struct TimelineItemSender: Identifiable, Hashable { static let test = TimelineItemSender(id: "@test.matrix.org") let id: String diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/DecorationTimelineItemProtocol.swift b/ElementX/Sources/Services/Timeline/TimelineItems/DecorationTimelineItemProtocol.swift index 869f76d21..4c5f4db10 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/DecorationTimelineItemProtocol.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/DecorationTimelineItemProtocol.swift @@ -9,4 +9,4 @@ import Foundation // periphery: ignore - markdown protocol -protocol DecorationTimelineItemProtocol: RoomTimelineItemProtocol { } +nonisolated protocol DecorationTimelineItemProtocol: RoomTimelineItemProtocol { } diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/EventBasedMessageTimelineItemProtocol.swift b/ElementX/Sources/Services/Timeline/TimelineItems/EventBasedMessageTimelineItemProtocol.swift index a31cd9dcc..eb446aa15 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/EventBasedMessageTimelineItemProtocol.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/EventBasedMessageTimelineItemProtocol.swift @@ -8,7 +8,7 @@ import Foundation -enum EventBasedMessageTimelineItemContentType: Hashable { +nonisolated enum EventBasedMessageTimelineItemContentType: Hashable { case audio(AudioRoomTimelineItemContent) case emote(EmoteRoomTimelineItemContent) case file(FileRoomTimelineItemContent) @@ -20,11 +20,11 @@ enum EventBasedMessageTimelineItemContentType: Hashable { case voice(AudioRoomTimelineItemContent) } -protocol EventBasedMessageTimelineItemProtocol: EventBasedTimelineItemProtocol { +nonisolated protocol EventBasedMessageTimelineItemProtocol: EventBasedTimelineItemProtocol { var contentType: EventBasedMessageTimelineItemContentType { get } } -extension EventBasedMessageTimelineItemProtocol { +nonisolated extension EventBasedMessageTimelineItemProtocol { var supportsMediaCaption: Bool { switch contentType { case .audio, .file, .image, .video: diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/EventBasedTimelineItemProtocol.swift b/ElementX/Sources/Services/Timeline/TimelineItems/EventBasedTimelineItemProtocol.swift index 49f79fb2c..93c6a11d4 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/EventBasedTimelineItemProtocol.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/EventBasedTimelineItemProtocol.swift @@ -9,7 +9,7 @@ import Foundation import UIKit -protocol EventBasedTimelineItemProtocol: RoomTimelineItemProtocol, CustomStringConvertible { +nonisolated protocol EventBasedTimelineItemProtocol: RoomTimelineItemProtocol, CustomStringConvertible { var timestamp: Date { get } var isOutgoing: Bool { get } var isEditable: Bool { get } @@ -22,7 +22,7 @@ protocol EventBasedTimelineItemProtocol: RoomTimelineItemProtocol, CustomStringC var properties: RoomTimelineItemProperties { get } } -extension EventBasedTimelineItemProtocol { +nonisolated extension EventBasedTimelineItemProtocol { var description: String { "\(String(describing: Self.self)): id: \(id), timestamp: \(timestamp), isOutgoing: \(isOutgoing), properties: \(properties)" } diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/AudioRoomTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/AudioRoomTimelineItem.swift index 4a99b68ba..e7c22c30e 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/AudioRoomTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/AudioRoomTimelineItem.swift @@ -8,7 +8,7 @@ import Foundation -struct AudioRoomTimelineItem: EventBasedMessageTimelineItemProtocol, Equatable { +nonisolated struct AudioRoomTimelineItem: EventBasedMessageTimelineItemProtocol, Equatable { let id: TimelineItemIdentifier let timestamp: Date let isOutgoing: Bool diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/AudioRoomTimelineItemContent.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/AudioRoomTimelineItemContent.swift index 9074858a8..4d49bde2b 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/AudioRoomTimelineItemContent.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/AudioRoomTimelineItemContent.swift @@ -9,7 +9,7 @@ import UIKit import UniformTypeIdentifiers -struct AudioRoomTimelineItemContent: Hashable { +nonisolated struct AudioRoomTimelineItemContent: Hashable { let filename: String var caption: String? var formattedCaption: AttributedString? diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/EmoteRoomTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/EmoteRoomTimelineItem.swift index d14250592..a07722fdb 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/EmoteRoomTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/EmoteRoomTimelineItem.swift @@ -8,7 +8,7 @@ import UIKit -struct EmoteRoomTimelineItem: TextBasedRoomTimelineItem, Equatable { +nonisolated struct EmoteRoomTimelineItem: TextBasedRoomTimelineItem, Equatable { let id: TimelineItemIdentifier let timestamp: Date let isOutgoing: Bool diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/EmoteRoomTimelineItemContent.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/EmoteRoomTimelineItemContent.swift index 9a3b07c93..51962202b 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/EmoteRoomTimelineItemContent.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/EmoteRoomTimelineItemContent.swift @@ -8,7 +8,7 @@ import UIKit -struct EmoteRoomTimelineItemContent: Hashable { +nonisolated struct EmoteRoomTimelineItemContent: Hashable { let body: String var formattedBody: AttributedString? /// The original textual representation of the formatted body directly from the event (usually HTML code) diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/FileRoomTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/FileRoomTimelineItem.swift index c4257300d..c560f68ea 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/FileRoomTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/FileRoomTimelineItem.swift @@ -9,7 +9,7 @@ import UIKit import UniformTypeIdentifiers -struct FileRoomTimelineItem: EventBasedMessageTimelineItemProtocol, Equatable { +nonisolated struct FileRoomTimelineItem: EventBasedMessageTimelineItemProtocol, Equatable { let id: TimelineItemIdentifier let timestamp: Date let isOutgoing: Bool diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/FileRoomTimelineItemContent.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/FileRoomTimelineItemContent.swift index 606da9a14..a65a13fa9 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/FileRoomTimelineItemContent.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/FileRoomTimelineItemContent.swift @@ -9,7 +9,7 @@ import Foundation import UniformTypeIdentifiers -struct FileRoomTimelineItemContent: Hashable { +nonisolated struct FileRoomTimelineItemContent: Hashable { let filename: String var caption: String? var formattedCaption: AttributedString? diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/ImageRoomTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/ImageRoomTimelineItem.swift index 88bb28aee..9d158b74c 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/ImageRoomTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/ImageRoomTimelineItem.swift @@ -9,7 +9,7 @@ import UIKit import UniformTypeIdentifiers -struct ImageRoomTimelineItem: EventBasedMessageTimelineItemProtocol, Equatable { +nonisolated struct ImageRoomTimelineItem: EventBasedMessageTimelineItemProtocol, Equatable { let id: TimelineItemIdentifier let timestamp: Date let isOutgoing: Bool diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/ImageRoomTimelineItemContent.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/ImageRoomTimelineItemContent.swift index 77e27c54a..b927ac900 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/ImageRoomTimelineItemContent.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/ImageRoomTimelineItemContent.swift @@ -9,7 +9,7 @@ import Foundation import UniformTypeIdentifiers -struct ImageRoomTimelineItemContent: Hashable { +nonisolated struct ImageRoomTimelineItemContent: Hashable { let filename: String var caption: String? var formattedCaption: AttributedString? diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/LiveLocationRoomTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/LiveLocationRoomTimelineItem.swift index f138f4c2b..644637140 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/LiveLocationRoomTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/LiveLocationRoomTimelineItem.swift @@ -8,7 +8,7 @@ import Foundation import MatrixRustSDK -struct LiveLocationRoomTimelineItem: EventBasedTimelineItemProtocol, Equatable { +nonisolated struct LiveLocationRoomTimelineItem: EventBasedTimelineItemProtocol, Equatable { let id: TimelineItemIdentifier /// Always empty just here for protocol conformance var body: String { @@ -25,14 +25,14 @@ struct LiveLocationRoomTimelineItem: EventBasedTimelineItemProtocol, Equatable { var properties = RoomTimelineItemProperties() } -struct LiveLocationRoomTimelineItemContent: Equatable { +nonisolated struct LiveLocationRoomTimelineItemContent: Equatable { let isLive: Bool let timeoutDate: Date let lastGeoURI: GeoURI? } -extension LiveLocationRoomTimelineItemContent { +nonisolated extension LiveLocationRoomTimelineItemContent { init(from content: MatrixRustSDK.LiveLocationContent, timestamp: Date) { isLive = content.isLive timeoutDate = timestamp.addingTimeInterval(Double(content.timeoutMs) / 1000) diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/LocationRoomTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/LocationRoomTimelineItem.swift index d02da8e99..c4a11f8d2 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/LocationRoomTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/LocationRoomTimelineItem.swift @@ -8,7 +8,7 @@ import Foundation -struct LocationRoomTimelineItem: EventBasedMessageTimelineItemProtocol, Equatable { +nonisolated struct LocationRoomTimelineItem: EventBasedMessageTimelineItemProtocol, Equatable { let id: TimelineItemIdentifier let timestamp: Date let isOutgoing: Bool diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/LocationRoomTimelineItemContent.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/LocationRoomTimelineItemContent.swift index fc6d94ef5..c75576f92 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/LocationRoomTimelineItemContent.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/LocationRoomTimelineItemContent.swift @@ -8,7 +8,7 @@ import MatrixRustSDK -struct LocationRoomTimelineItemContent: Hashable { +nonisolated struct LocationRoomTimelineItemContent: Hashable { let body: String let geoURI: GeoURI? let kind: StaticLocationKind @@ -22,7 +22,7 @@ struct LocationRoomTimelineItemContent: Hashable { } } -enum StaticLocationKind { +nonisolated enum StaticLocationKind { case sender case pin diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/NoticeRoomTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/NoticeRoomTimelineItem.swift index 4bfcffb15..0e944dac7 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/NoticeRoomTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/NoticeRoomTimelineItem.swift @@ -8,7 +8,7 @@ import UIKit -struct NoticeRoomTimelineItem: TextBasedRoomTimelineItem, Equatable { +nonisolated struct NoticeRoomTimelineItem: TextBasedRoomTimelineItem, Equatable { let id: TimelineItemIdentifier let timestamp: Date let isOutgoing: Bool diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/NoticeRoomTimelineItemContent.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/NoticeRoomTimelineItemContent.swift index 208dbc7db..a43034e95 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/NoticeRoomTimelineItemContent.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/NoticeRoomTimelineItemContent.swift @@ -8,7 +8,7 @@ import UIKit -struct NoticeRoomTimelineItemContent: Hashable { +nonisolated struct NoticeRoomTimelineItemContent: Hashable { let body: String var formattedBody: AttributedString? } diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/TextRoomTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/TextRoomTimelineItem.swift index eb6b91556..0c2772618 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/TextRoomTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/TextRoomTimelineItem.swift @@ -9,7 +9,7 @@ import Algorithms import UIKit -struct TextRoomTimelineItem: TextBasedRoomTimelineItem, Equatable { +nonisolated struct TextRoomTimelineItem: TextBasedRoomTimelineItem, Equatable { let id: TimelineItemIdentifier let timestamp: Date let isOutgoing: Bool diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/TextRoomTimelineItemContent.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/TextRoomTimelineItemContent.swift index 2c2791b85..333a8b8a1 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/TextRoomTimelineItemContent.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/TextRoomTimelineItemContent.swift @@ -8,7 +8,7 @@ import UIKit -struct TextRoomTimelineItemContent: Hashable { +nonisolated struct TextRoomTimelineItemContent: Hashable { let body: String var formattedBody: AttributedString? /// The original textual representation of the formatted body directly from the event (usually HTML code) diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/VideoRoomTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/VideoRoomTimelineItem.swift index e2c1c9f84..ff66752f8 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/VideoRoomTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/VideoRoomTimelineItem.swift @@ -9,7 +9,7 @@ import UIKit import UniformTypeIdentifiers -struct VideoRoomTimelineItem: EventBasedMessageTimelineItemProtocol, Equatable { +nonisolated struct VideoRoomTimelineItem: EventBasedMessageTimelineItemProtocol, Equatable { let id: TimelineItemIdentifier let timestamp: Date let isOutgoing: Bool diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/VideoRoomTimelineItemContent.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/VideoRoomTimelineItemContent.swift index 724d4e4fa..d20678e17 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/VideoRoomTimelineItemContent.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/VideoRoomTimelineItemContent.swift @@ -9,7 +9,7 @@ import Foundation import UniformTypeIdentifiers -struct VideoRoomTimelineItemContent: Hashable { +nonisolated struct VideoRoomTimelineItemContent: Hashable { let filename: String var caption: String? var formattedCaption: AttributedString? diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/VoiceMessageRoomTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/VoiceMessageRoomTimelineItem.swift index bdb0cbbdc..47977da26 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/VoiceMessageRoomTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/VoiceMessageRoomTimelineItem.swift @@ -8,7 +8,7 @@ import Foundation -struct VoiceMessageRoomTimelineItem: EventBasedMessageTimelineItemProtocol, Equatable { +nonisolated struct VoiceMessageRoomTimelineItem: EventBasedMessageTimelineItemProtocol, Equatable { let id: TimelineItemIdentifier let timestamp: Date let isOutgoing: Bool diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/CallInviteRoomTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/CallInviteRoomTimelineItem.swift index f78530a46..54b75a7ea 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/CallInviteRoomTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/CallInviteRoomTimelineItem.swift @@ -8,7 +8,7 @@ import Foundation -struct CallInviteRoomTimelineItem: RoomTimelineItemProtocol, Equatable { +nonisolated struct CallInviteRoomTimelineItem: RoomTimelineItemProtocol, Equatable { let id: TimelineItemIdentifier let timestamp: Date let isEditable: Bool diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/CallNotificationRoomTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/CallNotificationRoomTimelineItem.swift index 95aa75a13..97b7f6dd1 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/CallNotificationRoomTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/CallNotificationRoomTimelineItem.swift @@ -8,7 +8,7 @@ import Foundation -struct CallNotificationRoomTimelineItem: RoomTimelineItemProtocol, Equatable { +nonisolated struct CallNotificationRoomTimelineItem: RoomTimelineItemProtocol, Equatable { let id: TimelineItemIdentifier let timestamp: Date let isEditable: Bool diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/CollapsibleTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/CollapsibleTimelineItem.swift index 742f13d7a..f7d3bfe1f 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/CollapsibleTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/CollapsibleTimelineItem.swift @@ -8,7 +8,7 @@ import Foundation -struct CollapsibleTimelineItem: RoomTimelineItemProtocol, Equatable { +nonisolated struct CollapsibleTimelineItem: RoomTimelineItemProtocol, Equatable { let id: TimelineItemIdentifier let items: [RoomTimelineItemProtocol] let itemIDs: [TimelineItemIdentifier] diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/EncryptedRoomTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/EncryptedRoomTimelineItem.swift index 7de19031d..b3015a626 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/EncryptedRoomTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/EncryptedRoomTimelineItem.swift @@ -8,7 +8,7 @@ import UIKit -struct EncryptedRoomTimelineItem: EventBasedTimelineItemProtocol, Equatable { +nonisolated struct EncryptedRoomTimelineItem: EventBasedTimelineItemProtocol, Equatable { enum EncryptionType: Hashable { case megolmV1AesSha2(sessionID: String, cause: UTDCause) case olmV1Curve25519AesSha2(senderKey: String) diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/PollRoomTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/PollRoomTimelineItem.swift index 0c1a22986..3ee0e4f0c 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/PollRoomTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/PollRoomTimelineItem.swift @@ -8,7 +8,7 @@ import Foundation -struct PollRoomTimelineItem: Equatable, EventBasedTimelineItemProtocol { +nonisolated struct PollRoomTimelineItem: Equatable, EventBasedTimelineItemProtocol { let id: TimelineItemIdentifier let poll: Poll let body: String @@ -20,7 +20,7 @@ struct PollRoomTimelineItem: Equatable, EventBasedTimelineItemProtocol { var properties: RoomTimelineItemProperties } -struct Poll: Hashable { +nonisolated struct Poll: Hashable { let question: String let kind: Kind let maxSelections: Int diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/RedactedRoomTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/RedactedRoomTimelineItem.swift index 675eb2c29..075ccfff2 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/RedactedRoomTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/RedactedRoomTimelineItem.swift @@ -9,7 +9,7 @@ import Foundation import UIKit -struct RedactedRoomTimelineItem: EventBasedTimelineItemProtocol, Equatable { +nonisolated struct RedactedRoomTimelineItem: EventBasedTimelineItemProtocol, Equatable { let id: TimelineItemIdentifier let body: String let timestamp: Date diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/StateRoomTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/StateRoomTimelineItem.swift index 0dd623963..232df0a9d 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/StateRoomTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/StateRoomTimelineItem.swift @@ -8,7 +8,7 @@ import UIKit -struct StateRoomTimelineItem: EventBasedTimelineItemProtocol, Equatable { +nonisolated struct StateRoomTimelineItem: EventBasedTimelineItemProtocol, Equatable { let id: TimelineItemIdentifier let body: String let timestamp: Date diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/StickerRoomTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/StickerRoomTimelineItem.swift index c25f75af1..c943589ff 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/StickerRoomTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/StickerRoomTimelineItem.swift @@ -8,7 +8,7 @@ import UIKit -struct StickerRoomTimelineItem: EventBasedTimelineItemProtocol, Equatable { +nonisolated struct StickerRoomTimelineItem: EventBasedTimelineItemProtocol, Equatable { let id: TimelineItemIdentifier let body: String let timestamp: Date diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/UnsupportedRoomTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/UnsupportedRoomTimelineItem.swift index 39a3f7b20..2680213a7 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/UnsupportedRoomTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/UnsupportedRoomTimelineItem.swift @@ -8,7 +8,7 @@ import UIKit -struct UnsupportedRoomTimelineItem: EventBasedTimelineItemProtocol, Equatable { +nonisolated struct UnsupportedRoomTimelineItem: EventBasedTimelineItemProtocol, Equatable { let id: TimelineItemIdentifier let body: String diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Virtual/PaginationIndicatorRoomTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Virtual/PaginationIndicatorRoomTimelineItem.swift index a62c50c6b..3ad032875 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Virtual/PaginationIndicatorRoomTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Virtual/PaginationIndicatorRoomTimelineItem.swift @@ -8,7 +8,7 @@ import Foundation -struct PaginationIndicatorRoomTimelineItem: DecorationTimelineItemProtocol, Equatable { +nonisolated struct PaginationIndicatorRoomTimelineItem: DecorationTimelineItemProtocol, Equatable { let id: TimelineItemIdentifier enum Position { diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Virtual/ReadMarkerRoomTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Virtual/ReadMarkerRoomTimelineItem.swift index 15820a257..227a12216 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Virtual/ReadMarkerRoomTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Virtual/ReadMarkerRoomTimelineItem.swift @@ -8,6 +8,6 @@ import Foundation -struct ReadMarkerRoomTimelineItem: DecorationTimelineItemProtocol, Equatable { +nonisolated struct ReadMarkerRoomTimelineItem: DecorationTimelineItemProtocol, Equatable { let id: TimelineItemIdentifier } diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Virtual/SeparatorRoomTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Virtual/SeparatorRoomTimelineItem.swift index 7c32787f5..22b603dee 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Virtual/SeparatorRoomTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Virtual/SeparatorRoomTimelineItem.swift @@ -8,7 +8,7 @@ import Foundation -struct SeparatorRoomTimelineItem: DecorationTimelineItemProtocol, Equatable { +nonisolated struct SeparatorRoomTimelineItem: DecorationTimelineItemProtocol, Equatable { let id: TimelineItemIdentifier let timestamp: Date } diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Virtual/TimelineStartRoomTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Virtual/TimelineStartRoomTimelineItem.swift index bd026fe06..68e6d1e4d 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Virtual/TimelineStartRoomTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Virtual/TimelineStartRoomTimelineItem.swift @@ -8,7 +8,7 @@ import Foundation -struct TimelineStartRoomTimelineItem: DecorationTimelineItemProtocol, Equatable { +nonisolated struct TimelineStartRoomTimelineItem: DecorationTimelineItemProtocol, Equatable { // Using a static identifier makes the animations consistent in SwiftUI let id: TimelineItemIdentifier = .virtual(uniqueID: .init("TimelineStart")) let name: String? diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/RoomStateEventStringBuilder.swift b/ElementX/Sources/Services/Timeline/TimelineItems/RoomStateEventStringBuilder.swift index b9411a991..c2db635e5 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/RoomStateEventStringBuilder.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/RoomStateEventStringBuilder.swift @@ -9,7 +9,7 @@ import MatrixRustSDK import UIKit -struct RoomStateEventStringBuilder { +nonisolated struct RoomStateEventStringBuilder { let userID: String func buildString(for change: MembershipChange?, diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/RoomTimelineItemFactory.swift b/ElementX/Sources/Services/Timeline/TimelineItems/RoomTimelineItemFactory.swift index 84694db09..91e7f0400 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/RoomTimelineItemFactory.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/RoomTimelineItemFactory.swift @@ -10,7 +10,7 @@ import MatrixRustSDK import UIKit import UniformTypeIdentifiers -struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol { +nonisolated struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol { private let attributedStringBuilder: AttributedStringBuilderProtocol private let stateEventStringBuilder: RoomStateEventStringBuilder @@ -927,7 +927,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol { } } -private extension EmbeddedEventDetails { +private nonisolated extension EmbeddedEventDetails { var isThreaded: Bool { switch self { case .ready(.msgLike(let messageLikeContent), _, _, _, _): @@ -938,7 +938,7 @@ private extension EmbeddedEventDetails { } } -private extension Receipt { +private nonisolated extension Receipt { var dateTimestamp: Date? { guard let timestamp else { return nil diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/RoomTimelineItemFactoryProtocol.swift b/ElementX/Sources/Services/Timeline/TimelineItems/RoomTimelineItemFactoryProtocol.swift index 33309b73a..f13d56d9b 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/RoomTimelineItemFactoryProtocol.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/RoomTimelineItemFactoryProtocol.swift @@ -9,7 +9,7 @@ import Foundation import MatrixRustSDK -protocol RoomTimelineItemFactoryProtocol { +nonisolated protocol RoomTimelineItemFactoryProtocol: Sendable { func buildTimelineItem(for eventItemProxy: EventTimelineItemProxy, isDM: Bool) -> RoomTimelineItemProtocol? func buildTimelineItemReply(_ details: MatrixRustSDK.InReplyToDetails) -> TimelineItemReply } diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/RoomTimelineItemProtocol.swift b/ElementX/Sources/Services/Timeline/TimelineItems/RoomTimelineItemProtocol.swift index e63a1f5dd..9efcfd0a6 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/RoomTimelineItemProtocol.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/RoomTimelineItemProtocol.swift @@ -9,11 +9,11 @@ import Foundation import UIKit -protocol RoomTimelineItemProtocol { +nonisolated protocol RoomTimelineItemProtocol: Sendable { var id: TimelineItemIdentifier { get } } -extension RoomTimelineItemProtocol { +nonisolated extension RoomTimelineItemProtocol { var isReactable: Bool { guard let eventItem = self as? EventBasedTimelineItemProtocol else { return false } return !eventItem.isRedacted && !eventItem.hasFailedToSend && !eventItem.hasFailedDecryption diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/TextBasedRoomTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/TextBasedRoomTimelineItem.swift index 90394bf62..4fc218c17 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/TextBasedRoomTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/TextBasedRoomTimelineItem.swift @@ -8,4 +8,4 @@ import Foundation -protocol TextBasedRoomTimelineItem: EventBasedMessageTimelineItemProtocol { } +nonisolated protocol TextBasedRoomTimelineItem: EventBasedMessageTimelineItemProtocol { } diff --git a/ElementX/Sources/Services/Timeline/TimelineProxy.swift b/ElementX/Sources/Services/Timeline/TimelineProxy.swift index f893bcad6..4ecd46c5b 100644 --- a/ElementX/Sources/Services/Timeline/TimelineProxy.swift +++ b/ElementX/Sources/Services/Timeline/TimelineProxy.swift @@ -31,12 +31,32 @@ final class TimelineProxy: TimelineProxyProtocol { } deinit { + backPaginationStatusContinuation.finish() backPaginationStateObservationToken?.cancel() } + /// Bridge from the SDK's synchronous callback into Swift Concurrency. Yielding is safe from any + /// thread; a single long-lived `for await` consumer (set up in `init`) applies the status updates + /// on the main actor in FIFO order. + private let backPaginationStatusContinuation: AsyncStream.Continuation + init(timeline: Timeline, kind: TimelineKind) { self.timeline = timeline self.kind = kind + + let (backPaginationStatusStream, backPaginationStatusContinuation) = AsyncStream.makeStream() + self.backPaginationStatusContinuation = backPaginationStatusContinuation + + Task { [weak self] in + for await status in backPaginationStatusStream { + switch status { + case .idle(let hitStartOfTimeline): + self?.backPaginationStateSubject.send(hitStartOfTimeline ? .endReached : .idle) + case .paginating: + self?.backPaginationStateSubject.send(.paginating) + } + } + } } func subscribeForUpdates() async { @@ -52,7 +72,7 @@ final class TimelineProxy: TimelineProxyProtocol { await subscribeToPagination() - let provider = await TimelineItemProvider(timeline: timeline, kind: kind, paginationStatePublisher: paginationStatePublisher) + let provider = TimelineItemProvider(timeline: timeline, kind: kind, paginationStatePublisher: paginationStatePublisher) innerTimelineItemProvider = provider @@ -74,7 +94,7 @@ final class TimelineProxy: TimelineProxyProtocol { } func messageEventContent(for timelineItemID: TimelineItemIdentifier) async -> RoomMessageEventContentWithoutRelation? { - guard let content = await timelineItemProvider.itemProxies.firstEventTimelineItemUsingStableID(timelineItemID)?.content, + guard let content = timelineItemProvider.itemProxies.firstEventTimelineItemUsingStableID(timelineItemID)?.content, case let .msgLike(messageLikeContent) = content, case let .message(messageContent) = messageLikeContent.kind else { return nil @@ -236,7 +256,7 @@ final class TimelineProxy: TimelineProxyProtocol { inReplyTo: nil), audioInfo: audioInfo) - await requestHandle(handle) + requestHandle(handle) try await handle.join() MXLog.info("Finished sending audio") @@ -262,7 +282,7 @@ final class TimelineProxy: TimelineProxyProtocol { inReplyTo: nil), fileInfo: fileInfo) - await requestHandle(handle) + requestHandle(handle) try await handle.join() MXLog.info("Finished sending file") @@ -290,7 +310,7 @@ final class TimelineProxy: TimelineProxyProtocol { thumbnailSource: .file(filename: thumbnailURL.path(percentEncoded: false)), imageInfo: imageInfo) - await requestHandle(handle) + requestHandle(handle) try await handle.join() MXLog.info("Finished sending image") @@ -342,7 +362,7 @@ final class TimelineProxy: TimelineProxyProtocol { thumbnailSource: .file(filename: thumbnailURL.path(percentEncoded: false)), videoInfo: videoInfo) - await requestHandle(handle) + requestHandle(handle) try await handle.join() MXLog.info("Finished sending video") @@ -369,7 +389,7 @@ final class TimelineProxy: TimelineProxyProtocol { audioInfo: audioInfo, waveform: waveform) - await requestHandle(handle) + requestHandle(handle) try await handle.join() MXLog.info("Finished sending voice message") @@ -582,17 +602,8 @@ final class TimelineProxy: TimelineProxyProtocol { private func subscribeToPagination() async { switch kind { case .live: - let backPaginationListener = SDKListener { [weak self] status in - guard let self else { - return - } - - switch status { - case .idle(let hitStartOfTimeline): - backPaginationStateSubject.send(hitStartOfTimeline ? .endReached : .idle) - case .paginating: - backPaginationStateSubject.send(.paginating) - } + let backPaginationListener = SDKListener { [backPaginationStatusContinuation] status in + backPaginationStatusContinuation.yield(status) } do { diff --git a/ElementX/Sources/Services/Timeline/TimelineProxyProtocol.swift b/ElementX/Sources/Services/Timeline/TimelineProxyProtocol.swift index 17eaaa9ef..79bb4b4e5 100644 --- a/ElementX/Sources/Services/Timeline/TimelineProxyProtocol.swift +++ b/ElementX/Sources/Services/Timeline/TimelineProxyProtocol.swift @@ -53,7 +53,7 @@ enum TimelineProxyError: Error { /// Element X proxies generally wrap the counterpart RustSDK objects while providing platform specific /// interfaces. In this case it composes methods for interacting with a room's timeline and should be used alongside /// the ``TimelineItemProviderProtocol`` which offers a reactive interface to timeline changes. -protocol TimelineProxyProtocol { +protocol TimelineProxyProtocol: Sendable { var timelineItemProvider: TimelineItemProviderProtocol { get } func subscribeForUpdates() async diff --git a/ElementX/Sources/Services/UserSession/RestorationToken.swift b/ElementX/Sources/Services/UserSession/RestorationToken.swift index 22acbbd00..6c4248c38 100644 --- a/ElementX/Sources/Services/UserSession/RestorationToken.swift +++ b/ElementX/Sources/Services/UserSession/RestorationToken.swift @@ -13,7 +13,7 @@ enum RestorationTokenError: Error { case slidingSyncProxyNotSupported } -struct RestorationToken: Equatable { +nonisolated struct RestorationToken: Equatable { let session: MatrixRustSDK.Session let sessionDirectories: SessionDirectories let passphrase: String @@ -28,7 +28,7 @@ struct RestorationToken: Equatable { } } -extension RestorationToken: Codable { +nonisolated extension RestorationToken: Codable { init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) diff --git a/ElementX/Sources/Services/UserSession/SessionDirectories.swift b/ElementX/Sources/Services/UserSession/SessionDirectories.swift index f96ddfacb..9f59d0c0c 100644 --- a/ElementX/Sources/Services/UserSession/SessionDirectories.swift +++ b/ElementX/Sources/Services/UserSession/SessionDirectories.swift @@ -8,7 +8,7 @@ import Foundation -struct SessionDirectories: Hashable, Codable { +nonisolated struct SessionDirectories: Hashable, Codable { let dataDirectory: URL let cacheDirectory: URL @@ -73,7 +73,7 @@ struct SessionDirectories: Hashable, Codable { } } -extension SessionDirectories { +nonisolated extension SessionDirectories { /// Creates a fresh set of session directories for a new user. init() { let sessionDirectoryName = UUID().uuidString @@ -88,7 +88,7 @@ extension SessionDirectories { } } -extension SessionDirectories: CustomStringConvertible { +nonisolated extension SessionDirectories: CustomStringConvertible { var description: String { "Data: \(dataPath) Caches: \(cachePath)" } diff --git a/ElementX/Sources/Services/UserSession/UserSessionStore.swift b/ElementX/Sources/Services/UserSession/UserSessionStore.swift index ffa139886..2849a463d 100644 --- a/ElementX/Sources/Services/UserSession/UserSessionStore.swift +++ b/ElementX/Sources/Services/UserSession/UserSessionStore.swift @@ -128,7 +128,7 @@ class UserSessionStore: UserSessionStoreProtocol { } let homeserverURL = credentials.restorationToken.session.homeserverUrl - await appHooks.remoteSettingsHook.loadCache(forHomeserver: homeserverURL, applyingTo: appSettings) + appHooks.remoteSettingsHook.loadCache(forHomeserver: homeserverURL, applyingTo: appSettings) let builder = ClientBuilder .baseBuilder(httpProxy: URL(string: homeserverURL)?.globalProxy, diff --git a/ElementX/Sources/Services/Users/UserDiscoveryService.swift b/ElementX/Sources/Services/Users/UserDiscoveryService.swift index c936bd6fa..52e0dfe85 100644 --- a/ElementX/Sources/Services/Users/UserDiscoveryService.swift +++ b/ElementX/Sources/Services/Users/UserDiscoveryService.swift @@ -19,8 +19,8 @@ final class UserDiscoveryService: UserDiscoveryServiceProtocol { async let queriedProfile = profileIfPossible(with: searchQuery) do { - async let searchedUsers = clientProxy.searchUsers(searchTerm: searchQuery, limit: 10).get() - let users = try await merge(queriedProfile: queriedProfile, searchResults: searchedUsers) + let searchedUsers = try await clientProxy.searchUsers(searchTerm: searchQuery, limit: 10).get() + let users = await merge(queriedProfile: queriedProfile, searchResults: searchedUsers) return .success(filterAccountOwner(users)) } catch { // we want to show the profile (if any) even if the search fails diff --git a/ElementX/Sources/Services/Users/UserIdentityProxy.swift b/ElementX/Sources/Services/Users/UserIdentityProxy.swift index a1b7cb6ec..8bfe04bd4 100644 --- a/ElementX/Sources/Services/Users/UserIdentityProxy.swift +++ b/ElementX/Sources/Services/Users/UserIdentityProxy.swift @@ -8,7 +8,7 @@ import MatrixRustSDK -class UserIdentityProxy: UserIdentityProxyProtocol { +final nonisolated class UserIdentityProxy: UserIdentityProxyProtocol { private let userIdentity: UserIdentity init(userIdentity: UserIdentity) { diff --git a/ElementX/Sources/Services/Users/UserIdentityProxyProtocol.swift b/ElementX/Sources/Services/Users/UserIdentityProxyProtocol.swift index b16790aa4..fe2a5d1dd 100644 --- a/ElementX/Sources/Services/Users/UserIdentityProxyProtocol.swift +++ b/ElementX/Sources/Services/Users/UserIdentityProxyProtocol.swift @@ -6,13 +6,13 @@ // Please see LICENSE files in the repository root for full details. // -enum UserIdentityVerificationState { +nonisolated enum UserIdentityVerificationState { case notVerified case verified case verificationViolation } // sourcery: AutoMockable -protocol UserIdentityProxyProtocol { +nonisolated protocol UserIdentityProxyProtocol: Sendable { var verificationState: UserIdentityVerificationState { get } } diff --git a/ElementX/Sources/Services/Users/UserProfileProxy.swift b/ElementX/Sources/Services/Users/UserProfileProxy.swift index b4e544fad..de126c3c4 100644 --- a/ElementX/Sources/Services/Users/UserProfileProxy.swift +++ b/ElementX/Sources/Services/Users/UserProfileProxy.swift @@ -9,7 +9,7 @@ import Foundation import MatrixRustSDK -struct UserProfileProxy: Equatable, Hashable { +nonisolated struct UserProfileProxy: Equatable, Hashable { let userID: String let displayName: String? let avatarURL: URL? diff --git a/ElementX/Sources/Services/VoiceMessage/VoiceMessageCache.swift b/ElementX/Sources/Services/VoiceMessage/VoiceMessageCache.swift index ab79322d4..3e100ee48 100644 --- a/ElementX/Sources/Services/VoiceMessage/VoiceMessageCache.swift +++ b/ElementX/Sources/Services/VoiceMessage/VoiceMessageCache.swift @@ -8,7 +8,7 @@ import Foundation -class VoiceMessageCache: VoiceMessageCacheProtocol { +final nonisolated class VoiceMessageCache: VoiceMessageCacheProtocol { private let preferredFileExtension = "m4a" private var temporaryFilesFolderURL: URL { FileManager.default.temporaryDirectory.appendingPathComponent("media/voice-message") diff --git a/ElementX/Sources/Services/VoiceMessage/VoiceMessageCacheProtocol.swift b/ElementX/Sources/Services/VoiceMessage/VoiceMessageCacheProtocol.swift index 586af014a..a1262b2fd 100644 --- a/ElementX/Sources/Services/VoiceMessage/VoiceMessageCacheProtocol.swift +++ b/ElementX/Sources/Services/VoiceMessage/VoiceMessageCacheProtocol.swift @@ -8,12 +8,12 @@ import Foundation -enum VoiceMessageCacheError: Error { +nonisolated enum VoiceMessageCacheError: Error { case invalidFileExtension case failedStoringFileInCache } -protocol VoiceMessageCacheProtocol { +nonisolated protocol VoiceMessageCacheProtocol: Sendable { /// URL to use for recording var urlForRecording: URL { get } diff --git a/ElementX/Sources/Services/VoiceMessage/VoiceMessageMediaManager.swift b/ElementX/Sources/Services/VoiceMessage/VoiceMessageMediaManager.swift index 607283133..1a651deb3 100644 --- a/ElementX/Sources/Services/VoiceMessage/VoiceMessageMediaManager.swift +++ b/ElementX/Sources/Services/VoiceMessage/VoiceMessageMediaManager.swift @@ -38,6 +38,7 @@ class VoiceMessageMediaManager: VoiceMessageMediaManagerProtocol { } deinit { + // The cache is nonisolated and the proxies it uses are Sendable, safe from any context. voiceMessageCache.clearCache() } @@ -82,7 +83,7 @@ class VoiceMessageMediaManager: VoiceMessageMediaManagerProtocol { // MARK: - Private - private func enqueueVoiceMessageConversionRequest(forSource source: MediaSourceProxy, operation: @escaping () throws -> URL) async throws -> URL { + private func enqueueVoiceMessageConversionRequest(forSource source: MediaSourceProxy, operation: @escaping @Sendable () throws -> URL) async throws -> URL { if let conversionRequests = conversionRequests[source] { return try await withCheckedThrowingContinuation { continuation in conversionRequests.continuations.append(continuation) diff --git a/ElementX/Sources/Services/VoiceMessage/VoiceMessageRecorder.swift b/ElementX/Sources/Services/VoiceMessage/VoiceMessageRecorder.swift index 7c95affa1..3a9e87556 100644 --- a/ElementX/Sources/Services/VoiceMessage/VoiceMessageRecorder.swift +++ b/ElementX/Sources/Services/VoiceMessage/VoiceMessageRecorder.swift @@ -51,7 +51,7 @@ class VoiceMessageRecorder: VoiceMessageRecorderProtocol { addObservers() } - deinit { + isolated deinit { removeObservers() } @@ -98,8 +98,8 @@ class VoiceMessageRecorder: VoiceMessageRecorderProtocol { return .failure(.previewNotAvailable) } - if await !previewAudioPlayerState.isAttached { - await previewAudioPlayerState.attachAudioPlayer(audioPlayer) + if !previewAudioPlayerState.isAttached { + previewAudioPlayerState.attachAudioPlayer(audioPlayer) } if audioPlayer.playbackURL == url { @@ -119,7 +119,7 @@ class VoiceMessageRecorder: VoiceMessageRecorderProtocol { guard let previewAudioPlayerState else { return } - await previewAudioPlayerState.detachAudioPlayer() + previewAudioPlayerState.detachAudioPlayer() previewAudioPlayer?.stop() } @@ -222,7 +222,7 @@ class VoiceMessageRecorder: VoiceMessageRecorderProtocol { actionsSubject.send(.didFailWithError(error: VoiceMessageRecorderError.previewNotAvailable)) return } - await mediaPlayerProvider.register(audioPlayerState: previewAudioPlayerState) + mediaPlayerProvider.register(audioPlayerState: previewAudioPlayerState) actionsSubject.send(.didStopRecording(previewState: previewAudioPlayerState, url: recordingURL)) } } @@ -239,10 +239,10 @@ class VoiceMessageRecorder: VoiceMessageRecorderProtocol { } // Build the preview audio player state - previewAudioPlayerState = await AudioPlayerState(id: .recorderPreview, title: L10n.commonVoiceMessage, duration: recordingDuration, waveform: EstimatedWaveform(data: [])) + previewAudioPlayerState = AudioPlayerState(id: .recorderPreview, title: L10n.commonVoiceMessage, duration: recordingDuration, waveform: EstimatedWaveform(data: [])) // Build the preview audio player - let audioPlayer = await mediaPlayerProvider.player + let audioPlayer = mediaPlayerProvider.player previewAudioPlayer = audioPlayer return .success(()) diff --git a/ElementX/Sources/UITests/UITestsAppCoordinator.swift b/ElementX/Sources/UITests/UITestsAppCoordinator.swift index 0f6b181be..e7fcd03b7 100644 --- a/ElementX/Sources/UITests/UITestsAppCoordinator.swift +++ b/ElementX/Sources/UITests/UITestsAppCoordinator.swift @@ -107,7 +107,6 @@ class UITestsAppCoordinator: AppCoordinatorProtocol, SecureWindowManagerDelegate } } -@MainActor class MockScreen: Identifiable { let id: UITestsScreenIdentifier let windowManager: SecureWindowManagerProtocol @@ -624,7 +623,7 @@ class MockScreen: Identifiable { deviceID: "MOCKCLIENT", roomSummaryProvider: RoomSummaryProviderMock(.init(state: .loaded(roomSummaries))), spaceServiceConfiguration: .init(topLevelSpaces: .mockSpaceList.filter(\.isSpace) + .mockSingleRoom), - roomPreviews: [SpaceServiceRoom].mockSpaceList.map(RoomPreviewProxyMock.init), + roomPreviews: [SpaceServiceRoom].mockSpaceList.map { RoomPreviewProxyMock(spaceServiceRoom: $0) }, defaultRoomMembers: .allMembersAsAdmin)) clientProxy.recentlyVisitedRoomsFilterReturnValue = .mockRooms diff --git a/ElementX/Sources/UITests/UITestsNotificationCenter.swift b/ElementX/Sources/UITests/UITestsNotificationCenter.swift index 2c3e7a409..7911668b3 100644 --- a/ElementX/Sources/UITests/UITestsNotificationCenter.swift +++ b/ElementX/Sources/UITests/UITestsNotificationCenter.swift @@ -17,6 +17,10 @@ import SwiftUI /// - Send the notification from the tests you would like posted in the app. @MainActor class UITestsNotificationCenter: NotificationCenter, @unchecked Sendable { + override nonisolated init() { + super.init() + } + // periphery:ignore - retaining purpose private var client: UITestsSignalling.Client? private var signalCancellable: AnyCancellable? diff --git a/ElementX/Sources/UITests/UITestsSignalling.swift b/ElementX/Sources/UITests/UITestsSignalling.swift index fb35a533b..ee82b2436 100644 --- a/ElementX/Sources/UITests/UITestsSignalling.swift +++ b/ElementX/Sources/UITests/UITestsSignalling.swift @@ -112,7 +112,8 @@ enum UITestsSignalling { guard mode == .tests else { fatalError("The app can't wait for itself.") } guard !isConnected else { return } - await _ = signals.values.first { $0 == .ready } + var iterator = signals.values.makeAsyncIterator() + while let signal = await iterator.next(isolation: #isolation), signal != .ready { } NSLog("UITestsSignalling: Connected to app.") } diff --git a/ElementX/SupportingFiles/target.yml b/ElementX/SupportingFiles/target.yml index 3e5849158..f79709d4b 100644 --- a/ElementX/SupportingFiles/target.yml +++ b/ElementX/SupportingFiles/target.yml @@ -144,6 +144,9 @@ targets: SWIFT_OBJC_INTERFACE_HEADER_NAME: GeneratedInterface-Swift.h PILLS_UT_TYPE_IDENTIFIER: $(BASE_BUNDLE_IDENTIFIER).pills DEVELOPMENT_ASSET_PATHS: DevelopmentAssets/Media + SWIFT_VERSION: 6.2 + SWIFT_APPROACHABLE_CONCURRENCY: YES + SWIFT_DEFAULT_ACTOR_ISOLATION: MainActor OTHER_SWIFT_FLAGS: - "-DIS_MAIN_APP" diff --git a/Enterprise b/Enterprise index eaa8ac510..538306062 160000 --- a/Enterprise +++ b/Enterprise @@ -1 +1 @@ -Subproject commit eaa8ac5101e4b1947fa9fd92766736e0ce903e2c +Subproject commit 5383060626db89816734199ba6188c728a02eb4a diff --git a/NSE/Sources/BootDetectionManager.swift b/NSE/Sources/BootDetectionManager.swift index b307db8d4..8536f935c 100644 --- a/NSE/Sources/BootDetectionManager.swift +++ b/NSE/Sources/BootDetectionManager.swift @@ -8,7 +8,7 @@ import Foundation -enum BootDetectionManager { +nonisolated enum BootDetectionManager { /// Detects after reboot, before unlocked state. Does this by trying to write a file to the filesystem (to the Caches directory) and read it back. /// - Parameter containerURL: Container url to write the file. /// - Returns: true if the state detected diff --git a/NSE/Sources/CommonSettings+NotificationName.swift b/NSE/Sources/CommonSettings+NotificationName.swift index 6cb2b529d..41d427c0f 100644 --- a/NSE/Sources/CommonSettings+NotificationName.swift +++ b/NSE/Sources/CommonSettings+NotificationName.swift @@ -7,7 +7,7 @@ import UserNotifications -extension CommonSettingsProtocol { +nonisolated extension CommonSettingsProtocol { /// The sound name to use in outgoing notifications. /// Falls back to the default Element X tone if no custom tone has been selected. var notificationSoundName: UNNotificationSoundName { diff --git a/NSE/Sources/NSEUserSession.swift b/NSE/Sources/NSEUserSession.swift index 4510131b2..67ac784d5 100644 --- a/NSE/Sources/NSEUserSession.swift +++ b/NSE/Sources/NSEUserSession.swift @@ -10,7 +10,7 @@ import Foundation import MatrixRustSDK // sourcery: AutoMockable -protocol NSEUserSessionProtocol { +nonisolated protocol NSEUserSessionProtocol { var inviteAvatarsVisibility: InviteAvatars { get async } var mediaPreviewVisibility: MediaPreviews { get async } var threadsEnabled: Bool { get } @@ -19,7 +19,7 @@ protocol NSEUserSessionProtocol { func roomForIdentifier(_ roomID: String) -> Room? } -final class NSEUserSession: NSEUserSessionProtocol { +final nonisolated class NSEUserSession: NSEUserSessionProtocol { private let sessionDirectories: SessionDirectories private let appSettings: CommonSettingsProtocol private let baseClient: Client @@ -132,7 +132,7 @@ final class NSEUserSession: NSEUserSessionProtocol { } } -private final class ClientDelegateWrapper: ClientDelegate { +private final nonisolated class ClientDelegateWrapper: ClientDelegate { // MARK: - ClientDelegate func didReceiveAuthError(isSoftLogout: Bool) { diff --git a/NSE/Sources/NotificationContentBuilder.swift b/NSE/Sources/NotificationContentBuilder.swift index 3b752f330..4d43c2f2d 100644 --- a/NSE/Sources/NotificationContentBuilder.swift +++ b/NSE/Sources/NotificationContentBuilder.swift @@ -13,7 +13,7 @@ import SwiftUI import UserNotifications import Version -struct NotificationContentBuilder { +nonisolated struct NotificationContentBuilder { let messageEventStringBuilder: RoomMessageEventStringBuilder let notificationSoundName: UNNotificationSoundName let userSession: NSEUserSessionProtocol @@ -337,7 +337,7 @@ struct NotificationContentBuilder { } } -private struct NotificationIcon { +private nonisolated struct NotificationIcon { struct GroupInfo { let avatarDisplayName: String let displayName: String diff --git a/NSE/Sources/NotificationHandler.swift b/NSE/Sources/NotificationHandler.swift index b2a19afd5..ac7449702 100644 --- a/NSE/Sources/NotificationHandler.swift +++ b/NSE/Sources/NotificationHandler.swift @@ -11,7 +11,7 @@ import MatrixRustSDK import Synchronization import UserNotifications -class NotificationHandler { +nonisolated class NotificationHandler { private let userSession: NSEUserSession private let settings: CommonSettingsProtocol private let contentHandler: (UNNotificationContent) -> Void diff --git a/NSE/Sources/NotificationItemProxy/NotificationItemProxy.swift b/NSE/Sources/NotificationItemProxy/NotificationItemProxy.swift index 365c91dad..47318be52 100644 --- a/NSE/Sources/NotificationItemProxy/NotificationItemProxy.swift +++ b/NSE/Sources/NotificationItemProxy/NotificationItemProxy.swift @@ -10,7 +10,7 @@ import Foundation import MatrixRustSDK import UserNotifications -struct NotificationItemProxy: NotificationItemProxyProtocol { +nonisolated struct NotificationItemProxy: NotificationItemProxyProtocol { let notificationItem: NotificationItem let eventID: String let receiverID: String @@ -91,7 +91,7 @@ struct NotificationItemProxy: NotificationItemProxyProtocol { } } -struct EmptyNotificationItemProxy: NotificationItemProxyProtocol { +nonisolated struct EmptyNotificationItemProxy: NotificationItemProxyProtocol { let eventID: String var event: NotificationEvent? { diff --git a/NSE/Sources/NotificationItemProxy/NotificationItemProxyProtocol.swift b/NSE/Sources/NotificationItemProxy/NotificationItemProxyProtocol.swift index a618c7b22..1f5559b73 100644 --- a/NSE/Sources/NotificationItemProxy/NotificationItemProxyProtocol.swift +++ b/NSE/Sources/NotificationItemProxy/NotificationItemProxyProtocol.swift @@ -11,7 +11,7 @@ import MatrixRustSDK import UserNotifications // sourcery: AutoMockable -protocol NotificationItemProxyProtocol { +nonisolated protocol NotificationItemProxyProtocol: Sendable { var event: NotificationEvent? { get } var senderID: String { get } diff --git a/NSE/Sources/NotificationServiceExtension.swift b/NSE/Sources/NotificationServiceExtension.swift index e2f71410f..dc5812f88 100644 --- a/NSE/Sources/NotificationServiceExtension.swift +++ b/NSE/Sources/NotificationServiceExtension.swift @@ -30,7 +30,7 @@ import Synchronization // called on the same instance of `NotificationService` as a previous // notification. -final class NotificationServiceExtension: UNNotificationServiceExtension { +final nonisolated class NotificationServiceExtension: UNNotificationServiceExtension { let actor: NotificationServiceExtensionActor override init() { diff --git a/Secrets/Secrets.pkl b/Secrets/Secrets.pkl index 70492b541..ded7d3f4e 100644 --- a/Secrets/Secrets.pkl +++ b/Secrets/Secrets.pkl @@ -7,7 +7,7 @@ // Analytics and Diagnostics -import "package://pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.0.1#/StaticCode.pkl" +import "package://pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.1.0#/StaticCode.pkl" sentryDSN: String? = read?("env:SENTRY_DSN") sentryRustDSN: String? = read?("env:SENTRY_RUST_DSN") @@ -20,5 +20,6 @@ output { renderer = new StaticCode.Renderer { language = "Swift" objectName = "Secrets" + isolation = "nonisolated" } } diff --git a/Secrets/Secrets.swift b/Secrets/Secrets.swift index 187b8d003..d8b096c38 100644 --- a/Secrets/Secrets.swift +++ b/Secrets/Secrets.swift @@ -1,4 +1,4 @@ -enum Secrets { +nonisolated enum Secrets { static let sentryDSN: String? = "https://username@sentry.localhost/project_id" static let sentryRustDSN: String? = "https://username@sentry.localhost/project_id" static let postHogHost: String? = "https://posthog.localhost" diff --git a/Secrets/vendor/package-2/pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.0.1/staticcode@1.0.1.zip b/Secrets/vendor/package-2/pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.0.1/staticcode@1.0.1.zip deleted file mode 100644 index 803dd5f9760ed077a0b6d08005c92a92f164876c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12774 zcmaKSWl&vhlP$sB-QC?ixVyW%9o*d^1b270;O_1c0tA=f?#?COR82DPoq7Azsbc?l z`c$#k(`)tWR*(h(MFoO{gaiTt68!l73FwbMr2)=1mUi^^);5zG8!_{oh`#6gOk*%# zDXGGo8Teckmvu#4yw>JjKM|orakyv;TkRW#&G9^J0ES$VIb<>5-8lo;alCxJS+2kG zEpOFw;P$1BxrJy{!SQ-N9H^&W(RJ*WDT3*wiv}W-I#Vgpv*`;^VRQi1?=enkMj~{x z2owpykZmbmAwH2JK2}k_eU&*;fx>A5DT7T+FM!K4q+*7DQ66&w5fUnA_aIM|;j#(Q z)c(8(GLG5;sSaHbhGn>eu%V1G%s%FmM6xbdL4oTrcw=n8aN; zA|#~TB5$kngv;QH0Y1?R?LD=?lEUT5+!{!xx^b*@@(65tRjreZX3>zil!}6y$z@d} zgPB3J^%LAf6inuz@=0Ty3F|*N$El~dQ6SkFP|a2$t0n6_a14DLJ-lh}=Chl*piXne9=a;_5BYx;3g;!XcpswP$2&U>na%7fLLpX`{PFYwR=+LeA z1|Ikd5xFK=$KKl&Bt(b&TFcW_3vd05h5-(T6+KG?@92#|luj}M4_D6WZg`3-?+gLb zmiB}mm&d@=_V)phh+m}$&)APEwYukHNUZ(2W zMExZ~5hC@@R;e6fh7OUU`dd%a4*0&PMxv`2dkd%e&&dXtK~H^8KAxMAAVYJE8=Bh0 zP(K?T>P#0wlwY;`Lu?ZWZw#ZHSuZMb0J(m2amW|F&5N$@;DrQJx_k)3nT26pWDR1I z(XGEShNgblNOoz}>=>!ep)JTbHhBEx!uOp9`o5-At$)mJ>tb%c-vDcl3s^vKH9|;7 zj1Vr^P!&`!z(Y22zZ$Spy{U^#6;1ZwBlfg72=0Pyj4-d+%P6svB-JEU!xvKe*Y%!|JhL{fMKr3925t~vhkK=Cj)XEu@ekhcvN*4 zBgZuI@t2co{<~E_#-gn%gYWdRoA#Sqw=v6Z<_w_Ms!GAuI}e?wZ$Ev|jVWup4v(Xc ze(hBRef{q9#hMx#j1L9T>FNwV#!qp3)3P0VHx#05ghZr=7pyyU3G_u^Eq8Jes_e7} zEYD3VgfT_G5n~T;{#6KeIu0k^C?Sh%sK%$Ngy@(wdrE2th}kNSK@!izKp#3UGH=!W z9?gPKjPQ0fY##>8A0a>Q3NVyXxO{eunX?qVAn$#mdWT7T!yVGfm9V8a@qVH0Q~t_k zRFokbQ;Ed2Vygf2D|)eom~`rW&q~v)VLs(OA-Ho2`xd5I>->i?%;xv)aQE*nMJvwo ztAo<|?bYQT)a(nN_vpW4FQ98rAs4c~n#zO`XahZ%y^Gp+^Hbxs>~$h@m6pv{?4Hu# zbG`#BNJBsdHnj_Bf&&5Zq5=Ua{GWsb^+8BVqJko_qV%>VMJnTVD~yO8*EHx?Wb8&% zr-}kI#e(pn1eEc6DyWcTv&hzwDkG|}1roCaqm7Gi%3X!hO7R2-MWvfTojg44JUmyh zcCiJt466q7`81XvMcS%}CTChx&Meq^u~*z}b;;+&9Z91jwo= z6>SBr#)fgXYLPx=^zDmrUl8b5&N_zqgLgSwH#%p(9!mx-wepTzm7jiTV6`1;my59J zn+Q0j{^72c4rql3IgRv@bI>gr`k^^qG&Qz9r5cAkdIRujx9)E>=vdiR29|iQUiu6vs9C|&A40H82 zHp!=%yJ^TntN^e~VMnxMl+cc;QG2~y^~9M@rKm<=kHNTS|D~R=%Y8TS3&KhgL*7y8 z4br?NF;uzymQLUE{+-bAK?az`rG(F$PT zR~>?R*uSU@htG07POx zoN_En$8bD={6;TmU4&T}Fc456*uS9{{sX1?<=^PUEn z4QJ?`mo5gOB-yci)3J1aJ9(^O+{SUA-q$jb!g z;?Xr3bIc>4Yqq_B;zgeo8E% zzQm%|*qs6;dq4KF8#*qpzMifY6)wFVD?P0i&Ol{}d8efW4Xa}`7~OF>M2GGs)HHKo zfOs)26|D`40f6tROVJa~1l4N*+%E~l0Fkg&C@sVfTT(N8UVLF_@4$p98)lAzsoyi| z?#!JDKTP871r{_b?#_anU3YHZf=i~b`vJY`Hy=;|qY@fD zu*vWV^>PVB<|1lXzC_m7xw&+pfnAqT`MjIVCR#IIMaMLfIpXnMjbY|xC9pwL{Hoz1 z=0c}@aT{A9lu`(Bc43e;>nbER5cFoNND0cE`Na5@D@9UE z+tHHG&O{Vl(g^#8$^8_`1v39mED9IS!E28kSV~P3A|ORqbXCJiVVY`~J)Y|r0O+0| z+>s^Xz)DU=+mf2CX4|#~4Gj+mV~4e=$EW5UldXnr%Uq@Qg;c#7>G@t6JHgx6R(#F6 zp{}=`^91qZg$*BDG_-_e*eo_yY~FuN&S*7id}59&0#9+oLusJeQ1gbUC10t5CEKVj z0j{Pi)TMNX?(Tq^YwY_1(%sBWXZ>0Q7@6IEY@0Be$MS$GB#oH4xn7}jp{_S^eALk)KYD=K30! zdRzoxHB8)+ij5dpSgkM$!RENxq*>Gp&L&IB-|?HhzR~w$R%y2NFZ~GemKZtVGh`<) z&1lX?+NnXzH$xRLhx{eO?{HmS7XUtyJA*&p+S`reB|&P-Qt36Y4ks5v8q`uzeiNxz z0hisUsVpff7LH;Ph!;kxsnLib4fgy}jg@-FkWG z_Moefwjc!5aaM`Vs%=T9bisf;9M4fwZNmt=adN>oa-7nXFKqf!-PF-XoRreJt2Ts< zq1xgX9?emsA{?G?ob31~Fm!Ov@3>tRFsx7Sx)AaYn^Uuh%Z_?TEpWf4XB8>6b!Rj$ zKc8Unc+}Pomsdx?cXh>#_!R(H+g>pi$%`J_8=}uG_j=D}`Q;nouGIB;MsYL_!|s!{ zK%KpwmvG!@cH!%a9(5-8+>B?{Ius=q-heJ$9`)ZQ6@k6{=sPhks$%aCOA8n5T@dPM zn{;%!p|nd}MfhO1M%`5it-s6(u*=P|T< zVQ=`jq4DVd@FGxn&MI1OmqLKIf8nrTEnbUjaEd#YTgs-r&bl@3Id5-O)Z^4)tJd#0 z5OxD~4^7oh*UTeQ<1G=4*_b&;6r#`$KgC0li!yP?Ktzf1y$e4a2E_;4@W%M|{%yk( z%VFPS?P+Z*6hxgG&UzCme^GC|U0bF53rLj)WcETNl|}^TUfn|ZPYtI2TA8o%>*!9X z_bY(o@~2yG2n44K)YlnM8Yot42_HmaXd+giK-rqB@4l6e3w`hDb2*qCHQQ4~(%&zTP zNiJ%>@87Tp6U-dV%&VnLkQ7x|o8sdvB^%NDQCOlOV*1%jNOL){5_#Sr{3hd@ZvjP$ z5I{iFxc^4Rzon$Io28laZyxT{um!BJBfg#KJIthLSrEH{-3?kRwMa%{NoNtsX`{*p z%rM*57f8zHA9-58Kc7iR<(qQ(;6xTXh^&u0xlJpIBY=1I0!=wLO%6JmZeA7)clQMY zHqqq2PHoLipd=FJNyj;=UT`H^O*t{rz!yXnJ#4u}D^M{6t6gw}`l2nm)irlHCd;j;HtRuTY0Vta4^!qc$A4x!Lk{B%Ns z217x5SP5_tL6c?)j4{8cZ#?Il3~%7{icDG#x7O7+||E=SsVnCpIv&!U9wo zL^7l7{+fp4nLF9DpzaAUB;T(fp*tCIlAV}YFhWKLD_MCS%Qp?b=K+~TQH6^sW6G1b zv!_Rwh@0%*KJ49Bq;On#I{WaYuSPKx+q=M-t0!DvPCi%#%1;}zdVu&vQS6KNFlirz z`As-R0vSS&kv4+`Q|6(QT+6O?wTx1%So#r{d@;^9#!h_V`PKjnE4L{Nif3stK2}Em zxW4T!@weV6l&DMwQhvjHNav|hy6S}H0M!;E>@9iCmi*mJCI4)?mXKs6fP$e#NQ@$` za$ddh=x2K<2He##G%PnNl3Aq6N6%12;%>~kWaN`?w;VLpl_2$#rG-ZUg6vaLM3YQ& zfoePDl*yy8{EV88(z(EADpbF8=cLK{t#s9y^tg^+3Ir*^K%vS-?M61b`G7EZp43te zZBik?D4T|u{a#=N z&LWY}{-~U29guT{O1%zI2$aB0*a>+EHw-rloUvZANAA-O?_eB_&tNH6`y85(P;BDI z-FoU_i$2@iN-l&L%%iyaA1?*<^T!7RkssiF?^^Qh!q=L&dH z1twpLxo^mZy;i6DR3CfBdMu??N1)#oQV%H2GQs=AU4Y_1-_t=?y7peT1gU#boseRv zuDj@}?n*!%&Y_vKZWD^4qBEW?j_V870|7^;X%MgOPE^yba`Jc8E+<_37d+1AMEFY7{kC> z?>rK+b_Z4iyl1g=D5nMG@D&)ke|@bh)QBp#3)pogO@DjDE7e0AcSkoLM~Y~eHx zX{Y&qd*ovWH!&&G2*-`4A(cXHqe-3N;$Yxf43ZOhIEm)ZVi$eS2!HNS3^Z8r_*3r9 zYhGnec*8wtCCh?msGug@PMd`G(TXqn%2X0iY-Uh6IX^{p;}x1C9Hzu*^S$cl(ahAH z z%p&LZlW$v#+0v6QN3Ha;K8;(}$4v)$Kkb{=+TK^r5#?9gq?KxQtiSW*oZB*zvnAKP zMfYu-zO0p>J>I=mABDC-oE@W#MKYbi9gJQ zoUkOZLViZihyj?tB_HRgk+{&YSHa_kK<|c|o2wnf3MLXPqLeVB5F=Ci=zi*SN z33zXR(<#UieXZ~Xm`hLud|+;PyeMF! zesJ{0K9ORET;M#8H!)1i1@b{B4=$HgWzT|#%q4`e)E@JAf?ft#zCMg9h_tm3RJvkM z36gnYCJgaJHXgPgaU6-Ay;`=W*+Rt%8DDEIr#XW5|){GtcUOc zsE~gJ6#oAJl#7kCU{H=n&LytByG4GJ>C(YXPe-3i{gcy_e@LD3^z=+qd4fGSy z89znCLx@F22fyj+dP2cq5N9w$$zJ$NYC+YSDe;akjfbw=nCXZ5Ekw`=HU z^ONM0&CBKfx8TXgFVrh$$C(@a!s(xTT$1%Cfm*e7AU<#huTc!0HDKtkK-d*q%ONhg zp0DCXwwzwgtw^M@2bEfiU+MHP}vn~58F))JzvD(pATCrronvIU8_yR z@YMr$1o?GGTVZg?|BK1NU0}CBmuxAd93@TmBpbe~SPS!>#AB04u}u^z+=$o(dekq9 zF)-8)m$oMiSK4=IHq{K9VAlD#Q;QyMSey&-d&zqaWzwF_bGvUd`RZPgVaD~(Q+{dQ z&b8YNQ%$8|ggB3Izsp|<(3pqO2U;^g|E>HH{Eb#Q7aJQxBO6l%M}WPlqqF6I!PQo| z_hXs?+xbibnZr(4{{^_+gc6$Ll+ieZW#BLpA1%Y7fhwM2)+H$KonOiU+x(D7ft3HM zQ+&=6yNGH+roFyy8Bs@1$2Sz%>mdRS3+7&hBI+X7OEb?^L%77cK>#PX5)F+&*rZSL zhh)JPbE`iBJ|aTi!w!bNkvaELB%X!v4A(C9T(1^2sCQW{Su8eny=@X|o6rH7E%3C$ zAWc9?Ua018yap!&j+qca;qo~|PFZE2yW~X>GcZ>Qtq`0JefZmH#@gj+-6h;-ptC@} z_;Fhj}uSW z&1fh%2Q?wRA^U_R53Wm5{Oe!MkNwE_^@GGT$&b2F*I*NSgSK50`(PVgLTbFd_Z=-+ zK#t9+5c*ojc(pQzJP{vwCC--6$mk?pG$LE9GqP?w{Gi@c^M-Uh!7r{fSvjS~0gVg= zyK3>d7tVV$Hqh@%Bdo`WGUt+D0V}ENV5OotzbdXroJ&*=tgYb^;zT$ClD5itNaaUy zUl<~qiqA0BU>^to7nDW`L&yV?@yU9cY%FZ#rvNnZ**ss#YzOG)YwT*^YbJjE*KL=a zzRY1mb16;?#uu!YubV9}{V2RJ3q%_uSC`yEyjPGNLma!-H*MxzjJy`>&z|x~qGKvT zg1-PHXDD-2yIKeVZmGopKCXbTR51b8HD(`HKG@WzH8jT%CF+yk1=lQ(q&X@{zwv`F zGQJJB6%RJ=^V(+C&t?GY)F9Eeq5bLtP5Ai7*umgndXc)RrcA!vy3 zc{Dz1_8p4^GWqy@aMAZ?%4J*rpZG@0yF2qcC`p{~+nB}W%T{`}v{CXyC9#GO-L7MS{PV9N@$x};4%2X5-)<5&mJf4y&Rcl2QF~v+CszH?` zOg29eOi;0fRBd@b@GUmzJTd!{2FlOD{9FKBC=@;m;Mb?1nL4z5iqsn4`HObMwV+I3 z<=&B*VW7=ezaq6QM46(&$W_iDlt@Od3Y_-SI1cAIkTkENk$Zjz_!xP7nZX)C-_QOG zZ(MiNH8(eC=ST=_hRAovgSB$~d2^DJGcz-tR*q-I=8KjwoeENflY3Z|X^aoZ-GzB& zY4)dLCE3qZkipcHD(;c@HeRkTGfhx4k@5BOmu+^k0W~AEx3TC2MKtZ0cxdXv3gj>gWXc&z6*F{D)9y zL=8TFiBy!+rot(g@EXltVpUZnQ3`Rcz{hisr3g4}oSb`k=2up;YNRk(cYm2&vP>_e zY8ukRYfkaMJ$-_J#=gubH^9Bi(~BUEywi!hQ!$=l;|hi$sxOb9=G7b{-(R+yn7K?Azv*(vxSuOh zZ4#8EdaVhGW_BPA>6%cy!&&_uw4J$HwjCi&{{GQbJ+b{9m>1yw1J46N+z;Fp`OZ6} z4p^nE-oVu=xFKIloEe53I3^n8*cA$p&PXjjTWm&vn-g|XRO9C!|5Pu4t&IJpQbdpb zf`;bW5ldF@YQBH#F*xPKeIio1i^hS|$cysqO4*mv#3iQEeb88Ml}>OjIa3($V-PfO z^qXWlJtEmGM(~g~p@%dYhmIuc8hklf!yW?{U4+5t?a9tp&rg*Fvcr53XvO;PztZ)j z<}y5E%d>asFtbRtZW{!t3|%t9-@#kqM|pm~REnaDkDH~{GZ84{2nmwE2f;V-UF>DH01BLlf5#cMZd7x+T63ZWjY{|KTLY&!tyq5h}{M3HFEf zc$1$O#;y0v^mXipGw}W6K$|7=@xmd#P==!@J1^z=K+jz!hF5(p;2fd(HJ!K3b0#_+ zP?@Jxuv=hONS=xoD}r#X`8$_UE?XT~yiRw}SwtOu))2YGrRcYa9eRiSo8+&t_1OF& z=Yj>?p$qIN>unw*OSWzVfSf5JZ}CG^66H2dM{eM~)C|||-se!BhWUE3=a(C5JnSQ@ ztnE^5p9aO-%LC^UF1AiSOKI+}r646ezT%Qu&p@$=ELh)Q|4*O45FxX4Y&)3kIL*i_5ep%+&O^)mh>ur+~c)mGN`8>+n>;I{9 zMlnnU6Cc+h>tjape_sjmf4dTNrtbEp#?GcD^!CPPMHqhhJ(D3fMm=tI9V%E>UOcX_jRJ%{DHiI7JiL}+sTr&S#OrarFUn2=;G07 z6rnEj#n7=pHLyoV%Cz;^l%g#uC8j1n2+;U1rL%Vs<8c0lKJ=wOfX)}Ey=cr2 zACqkt*tH=_-s3_~H5!Q+hWAUoyBQ|)zP*jG>0CTdq5=<{mZ@7`dCI<}5{vCETQ-p| zr@eAd+X<=jv)F2Eg}GUtX@m?cXl7E8VJ6`?N{5(PqdN6Ec9j4FdtaJ?YGeh|*p_p1 z=vnzi%UnEv6?*FEBL*TI<*TChbYFS7#xR;GY5UYC51J&`l6bzpi8Max|An-)o5?kR z_-Vy4@2JWk;h4`;$y-G9SrDt&H1}ux-o5ki$lFD}Zd>^)S$LYe}b77AXQg^>z z{2t4TQq8D}QYgk9b@U9`F{3_nN|k6yvcf^&tlT0+Q|vX0bYYJT21az54GLw)O`Xm0 zg&GL8-NJhQ^^P_Z?BYwD^klyuR@jWU|FZvUDn&@g%+3sR{{6?cxS4I~^_B zy>Nm{*srgG=6GV9w!PP|5;Dqx_MBqn-0T>i`_<;qphE}~z&fjZ>*GfoJy=J$QWBQRRj<9o(0dwM;_6u+%(wv(daGdmdg)~CV;C)c7h|Ut~w0bIxmAJ{E~!_T5<#}6Cc6`2c1U%?EtL@ z)*4r{U zyhQ^4B@(rd?&K%N?@ILv7!~Nxp8DSlgTMFG|7ZN!TL0&{zgM+>&w&3#+=p-e-^+#n zJofic`S%{zpOF8^@<%oN77YJ9`?o3oKYwx+@vkBDKac(Gtp0ZF|HRVA|KtDn@BexJ zZzJuu|N1ASKAO7!KL3{+`_Bx2n;X9kw?C2bA%p*9_}}cef9CqT+x%^Z{0YgA$N$dt zzndffO!l`_|J|Ve2~gs{lKp?}>Ob@Rtqy++`#*t7_E(<&MdtrA)8C}}TTT9n!w)9? rKegpQ)BKJ2-wgaGUa0;h&HvzI1!=GkBm)7#etf7uOw?lf-%tM!L)Uxd diff --git a/Secrets/vendor/package-2/pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.0.1/staticcode@1.0.1.json b/Secrets/vendor/package-2/pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.1.0/staticcode@1.1.0.json similarity index 54% rename from Secrets/vendor/package-2/pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.0.1/staticcode@1.0.1.json rename to Secrets/vendor/package-2/pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.1.0/staticcode@1.1.0.json index cf6621831..ebad53d80 100644 --- a/Secrets/vendor/package-2/pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.0.1/staticcode@1.0.1.json +++ b/Secrets/vendor/package-2/pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.1.0/staticcode@1.1.0.json @@ -1,10 +1,10 @@ { "name": "staticcode", - "packageUri": "package://pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.0.1", - "version": "1.0.1", - "packageZipUrl": "https://github.com/element-hq/pkl-tools/releases/download/staticcode@1.0.1/staticcode@1.0.1.zip", + "packageUri": "package://pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.1.0", + "version": "1.1.0", + "packageZipUrl": "https://github.com/element-hq/pkl-tools/releases/download/staticcode@1.1.0/staticcode@1.1.0.zip", "packageZipChecksums": { - "sha256": "4f89837d86c6228620cb1986bb7dd19fec8665a5932fca18348204f24ba3f004" + "sha256": "ae2f3f61deed48e6f5698e5f295c4a4c090d8ac712906f43adf844325a86f887" }, "dependencies": {}, "authors": [] diff --git a/Secrets/vendor/package-2/pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.1.0/staticcode@1.1.0.zip b/Secrets/vendor/package-2/pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.1.0/staticcode@1.1.0.zip new file mode 100644 index 0000000000000000000000000000000000000000..8ef04014097a40d5e5e1cdf94ffec5caa77d1e3d GIT binary patch literal 13329 zcmaKzWl&vPv#xP>cXwU5ySuvtcUT1X;O?%$3GVI^EV#QvfS>__%O&T#b&|91xw|Q< zm_J6ZD%LYbzy0=@%5vZk7$7h(Fd!fxBJaO{0`C1!IiQQ3wF8r*t=)pQeH=O$%IoJ3 zEUV0B63fa(er>l%A$%w*HElnf{87S!8%`)fW4a8yVXb$1+=p(vfw7_wssT*c-iDtu zJo$;XTzE4Tcl6D}^zE9Vhy;9Y*ck4K46l|;378bn@*!XiBGct2&}q#2odJ4C4bg-5 zJML7a$+r0v{E440iw>0r0kUv-vT~GdRhoehc7V6K_;<; zbpiBFhV@7(E?3u-=?9dv^F>3q78OK{hJrTnl5*s~JiQ2-VA&O2O|ZL~czN*%eQMVh z^!4}e>W9y8svP@DhvtHTwT|fUAMC{Bo_%MaVb^S%IwLSE@ zVsP-;!mp_pIAzrAf!H&Fjg7vY&UiB*WX>bu4}dgJTm$P*yv7P{a*B5uGOfd638mtK zTytD5jpI+lK{eywf>pp=fB}%Ql`X>#L>v4VG|ymNEi39(hsFGve9_9DKo!HS2^;69 zMuq9bE^0-`g~D*Q$YXC#JZr=rsTR6j^S~g#UvzWS(kdiXra4lY9s5+x-E!nqrGHYGK8xBMJwh4emEX=xcL0~<* zhPPBCCbUjbnQL_J*KBl;0`+ehH_aB-x=xE3!nHcpfIUe^h0I?q=;JkI}fpy0KK16~vr6v2p8o3y66(`rvMo7-YoUxpGYh~Hu=7m{v%M2q?9=SLjf*?2?33(><2`Ux=@=S)fHnKZCJ8eQgKIOKRB^U*|R$oR8EA7x?K}@NIxck6@xJF ziE^PC$X^P$RKMoTiw)WPW==BWO}WqAnj(Vp=z?nfWA}$&ecoO%*7*~Dt&sWHKPZstI}7Q?Ir-zv%8>w?x3f62H4TP^~I$N~9YVeEpcl8DpB(J;K(k zbDuI~p23p4I@SAYN0Qf;csJkiQt_sHLWNY#+i4>8qV<3jVZz~P5!E-A^5B@~Es50j zvlS6BOep5IpuKn^qhUZ)Pa!4c`1ZWXMVpAlvk=~_fx-7M51z$Hst+fa#tmAnYn9g6 z8Cr&yRZm9B>7rFpwn+wt$D|UgV9(sOZC1D>2zm)5{J^d`ftQ2LvegV~)m)g94ApgQUxKqsK@iNLr7DmC2UDTv0|GmNT#OJF>JZQ zv`rAFj6CA^)4TrkxiFb;{E}bSpzXGIR06u4_IFUhq6QjJ=(^+kxev zKUUT0(kA17IHDoi@g2PFP=pvXSNab7`TKyo0CXs>H{WY7vUdvgqvF+ST@hc5i=KzI zwGqGto#qzx8;s8@LKS4QI>;-fx}MS;hc)fByef zD%kf*r79sJt{}l=Z&s{6=CB4p>Aa@Lx}xMXp*>R(o-PqVk|3r@{H~4xLpg(H8>v2` zflw$tLp<8F^s3ffB&V84d{kVz9n{6g*TKhkh2Rih$iS>XiPPb)WDBWzB&%%C z&&VLPvu#1H1vAvo7bI&#QwGI}hVQXmPAyDXMWbRbV)Jd7V5b%pG^_tmlJ}DML*x+X{OD+j5 z_LdBioQBo3lDnw*$X`WZsZl7v+(FH~POV0MhVqz34N5E(vyYkdEpKcP`kJ!NQh{5> zS1KZ#t?~IQ7f}98o$yu0icw*5?&C7-U1FYXxUow;%ihmG8)64SW{Wvto}h1`f&IR&%-49;oMS^|Lv4f zfzQqKaq@}|?OR6@zm;HPlW#=Wd30Q^nGNcpz{nZbid-DmJ@{{WA?hP6!oWa40wMp6 zUZi(=)m)5StWCv$X6C=O)|t*05T6UpZ|MWeMwn)l+Mpq#2E(VN| zvaal|r^Gp9n@TX%o42JjQyP7h9koIfyd!h7I8xa4URIpgk5fBGHz@4#buE)Fmdn%Q z2B7hf`z8DbJdM7TQMP1~eEPb5)oTKqjBB{@(19W|x#vSm$=1?YQ5la^fe=zy3O_oT z9&$`?je*oN5jyau@1oUq0Ekn@fEVbsM4jUe>sjX^1Trc<~+VLXW`ab~M5qmE5O!z!5528jbBURy@jHrOl)<+0gdl5kL$L&aR{Zm3UQ+ zqvfMPvYY63Lv0R6%9btPzwAS;IfRHf-o1|yP_R>8_q;AgaoMetEAFIL1!v0(D@z&j zGU-hJdXW}h0&7g`Q&qi%gGH3(3QZC5653pH-$MZV5Err-K zeFb=Y0`Z^UwDZ8XsZa%~8<0%*Yo-HWSogLKi$D^5uou<9GE=J4u{xEVs!($?^!C#X z$4r!5)51P z87|Lvh4CzsrCipgx~raJ4!@n$KV8IfxO5LWn*J>*DdkUTnjS7py(MnEcb znW~Z|i{+Xs%ZNg;v`uGo`+2?vESzkI&R@=ADcew^z^wO9r$J9`5a{koRokzJ+22bc zHIr-C1=8>Ylb_Mt zWp=rwk=5RZ-EhNr*sWoe~?VkDB2+P=Pn=`X3Aj z2(Dv6fAvZAHzptWdzVgSdItHhGSG+YTixzius^ND-QTZu(LAR4P!>6QJd2bCvSq|3 zFm#R;RUw13e|Bf3Iw`2NoaSNgu>5LIv4O*K&Dz+G=z>jWTo*kvYZV8I-VapZYdfZt z0;}w#zu5Ye?Yh{cdrrq7{iWYI9RCDjjZPkwh`tD#UlVWrQhx2L&NyVvnj=~8r~v#2 zK2crQP#`=;pZ$YKv=)=Q)nr zi}tedXx43_i;SDhY#kVgk>}=94D(Yfx#@(7X*w1dj|sVM&O&`&RzM!|p*Hd%UOX;z zM4YK*8^;FEFJaWPdG>&D*)nTQf`ToAOo1oio*j`5np6#Rt`LC;Q=a^zp^W-Ry-qp7 zwmh*;3!tve<_CSdf?oI{Cld*xX=aW zi#IY-Z}B7=W?D#7!tA;)YbPP;ZeV#e%*5G*5y~uV6k!%_u9htn&2q|Pa=B7wIWL;e z*pnJ)T`;-`K(VcSe3d6DN7`Ed%st>;zm}-guyvWAC}ik`5-ZtP#za|~?9u1k@;s*+pG)a9Lk^O-@YU%xi9+u}bCV~Fl zB(ueV=V5_CU%Ppp&T~F4ax5?ZK3+QSSUoxl`UeR%d`c&XlJd7HgH!;L(>@(!8~G~j zgYCV%+rt>1H~#fk5xK`U*lOoIUo?7@$k!$A^9JuEa68tVq3J@S%0B45&d_JEtaj!`mD; z$z{?E)KaOV#7{WXztzS3MGlWJ7W1pDZt(NY-s{~$b9a_2vMXqee)GW^WLN54&pJ^F zd8rU(oYSO;RR)xZB&G;Rv0OO4zZqSO_luGtMkGhBZ~6OEZLaWSvC|_$lAjQVng=pKjTaq?%;X=XQWSu2?9AiMM6!BMXxq>oS&uSp} zTL4Hl>yO4W6(n`9MlD)S-_2ETj*x!~1tFQfkuzuzkO1O;6AHg&u9~~Gh0AY^FsS_j zxWF!JGaWU5Jh(SP?hXNRvHH&E(+gIzT0$LQ^5_>n+G8uJ3;F63YWBq1>J$9VI{vn+O2+DBHNU{VncCh5%Dy#@2rRLH2Z;; zc}oOCv{66D&Jf~h$3hY>DZCJT$zawsQC{WA+{*nC*8BC`t-5(ZQ$2=0By)euER zD><#n(xZ9oLJaW*6ybEhfH?>pO9-R5tVQ>YH?RTLmN&X5F6;yjEouzem-Nje}?Lk**L!lIk<4t{N3uHe9-rKP>& ziTwwJ>gt_m8!wi&41I;4$B@xqfICa0Hzptig&|(|zM2158YBs)f9$sGSJg?nN**?$ zHF=i?aLv25s>GgDGvv~q&8R%)>{8&^6jZ4A`5ByYj6DddUieKk0CiCb{vCWK*JN}l zf(pnu3%$DeE+X9$R>Z#X)9g9LM{l$nV7G^#f+vre{(UaU|gRZlj z>*jjwA6D2}WQhVA)n`)3GqfaUoV;zJhj8BJR)L=de zJ#?j=$+xq9_MuBs&FK-B+Disk`~LO*M<0WPVI}j+aWo z?%C;@@%L#Ok+*KkkwWTVC+-%v4s(b5M0RWW4MYGpRn6LBHT84V+Mh_Xv*&rU-arnVhOP6|@wh(?X(S0-9AH!GwytDIm$yr3q6}0?~`0U;=x6ws>W8NfCfgMWzg> z22@M=bw8Vd$^;D6Kk?{75L5UoNYVY2rfvJ-;dbKjEfRBMd!UI3;S7`Poo@(j1{ zi>k}$_@Wo%W9;HZXY+|b8j3>}X@}yb;0;CfhoV`mnugK4>js}!y*ZD#b1_qV`CapC zJ8a@xorJG9(5rOE2b=N3TuS#c$7$b>sKL*=hMKoX;ff|#jgyTLuATz0qcZ~DQ()+k z0-$CCx(w6&)Lk=D8v=z1jcQ@#oJgr2#hwoWwZb+6q*AU=4%!|x6OzKq@(G%ZC%2Sp z>(J8*$})ABuqClv-15Bz0Py6YL7uU*UN!SNwjtL#S2rhjj$mTNao>h{eIS7d2;o`R zT^oz>y!%MblDhvOdx(iU>EKWf_yAOno>>5T8aNUpE>bmt;5H!~1v4}n8(ot_oC>n* z-bjZKn2SDij}3v<`h$$t-pA}JI9{U@cvkz*ZiZ`bqvkaoMR!cf8cSB}QIlW}Bh;`j z*;LXsm?S30hQ28?KQ~*{mR2$ddu*7XK@n)=7_JRhJVlipQKnd%;cvZabi8boz~=8A zm@_}W4oi9hQaiSNJ-lkiG#|bEUYhXK%^enU$}wx~vK7dC<1h*jW_ca^2Hb*$*W34w z4g4eEH}^6hhO4@yF`O%~%Y}a(go*`i6ofeqd}}^A|I{KjQh&l3yXiEja^~Y#OQBN$ zcv!F{;S%il*<>R>f!bb~TW&*C&JY=yz$c3C_Qv>Q!hgC`wh3;hsi}Ga%AQ^ER&V>Y zYq4;^UjhD_Zf}mdG*#b={#;LvkO<8dxpgZf=dbE`~CFyCwG zIM%<_QndG4YVKid?`UW4%q(i`Y;F3xsG6%O#AN|cx~}OZvvp}hG>QzHiP1(&=xoG` z;$51gz`*_%gvGlmQ*pAH0~qLIt;ejg8vtW47FV{H$>Mu0g~zrR9M%l-w@ z#T_(D1Qqs`lyJUYtXC~!C`euT$EJ&FDVlL|ch2KDLnQ=}1(Jb>h@%K(sKYM~l;B*6 zmd&g+ZlYlpw4`O}HL7za05)*$7u6V7jr66yqdFlkG*%Dd>}>5IZZN4xF^#kZwIqp_ zxM_luVZ-)}EVD)f$QN57xF~rwnZqgusJHPNYESlG9R398aQzfv?8wF``_|n?iBC6| zAKm$Tee1WVS4cPZYu5(6(l(02T+(LFz$sS1ePkOtAW7OJd@s!yl!RF+`6A}PNTqzJ z@)xmXCXHxqb!M%~am9nCk1nh*6(FGOnF)dO3B8flyeo3d&lr!u>f_>RY%#D9NAXB% z5xi2l3Mq?ydqjdfU)+kafHdj-oRa-U2N7Ulj#Y?duC9(oX+hr7g0L%n2_jggydJVK z#{02AyVTx4;&awdqFf;5A?0?JI*`|lrg7jPQ?w`0H8JYG&`BL$;4Ub&BL#v|?SgvM z<`6=8*uTxvdIL?Kjo(z2em^z!p{Fd4s1x^D-72AqWC44UUgqfw!oYU!sCZIb{p}9M z;vn|pM!nAcO#Z<=dD9#GZ{n6_g5_A>ZJs>vekE! z#j3`^8QHd?NV@iw@={uS#w6{F45l{BPHUXrD zdG}}DsoWW$UY=m~U(t01ys=3Z;GW%R)+A$#+dD#p~8tybx*(gkvK zwT(8D5hMd9k2rx{XeI>1;))jNd%80d?92`g6P(P=7bBOdjx~HYL{6$Z`nZ)(>pdA8sZVw7>BW^rZf+Cqh{b>w6I-s+SrO1Lh!>}VI zyE3~j{>miX_0#Dqi7nb?k{TEaEkSmuy4UbICE`XizrI~Zc(H0X$ba#|G)r%O9pl)* z@Pa7H^pUnvLX5RAWBJark7hXInZUQl?Fal35c*mC8rmmkNrjz_L=jEJan8onM*cL8 z=@p)qaHR6|E1`ivp(P;Er`HiNlj#bf_X0+E?6dn`@=iJ@_c=!;bKxNkoq}gmypZGZ zw5y6)s8JXIb83_JlEK@;>Mam}_==dwi&S|pvIvV7J19I}M}FIoGUG^)(iP9(7v1r)8U ziiHGAV>rzL8)xTeCK@kylSWoKk`thye8A04F1C0ImBilJAAa63(f`9pW_a?^K>c&!FO8)2tC zDUc3~Yw#d^Qmw#g5N8{kRYc{24MV(2+3IW2JaBl%nP39pWovJmg&+fA3XgapI;0c3 zFAhym__(TNGs(xPxmKJ~uq%)$Jmg#F5WSF*KDm5LSlIv#rW8>5^T=U4SqR$_MG?tU?N) zN_khJnSxeMDGJ?nuwoKO**5yY6FOzp#vmyTN^m}h?|D1k`u6B0DCU)k^PC!Rk(zhyv>{qk-c(1DJ-eeLapO!p!>ENSjDK;~JFzCMf$6&+?d5nL_ZY zOKR2{ub6gRzN4Xj1x4Rb-!Bx*`#u5_7yeG2I{GrtTPNR5TkMN%qcDDOB_<}Zm|4Hf zqDN4*G8$N(>&-9@B6+ z;8CA=tyfNMpbN}JQnc&jDZRFWx25d&$!Pq+pX{e==|^tq+26bKY2y@uV6Zdz^^#GHj)Tnh}dg&y5BD}{v3=(c1+%Q>2*EeSfO`?T&pyg2Vv9`J zVet`yLFOcEB1HWBVsj~b*1?teeHY~?fV=t!=2vs(C5$jjbOLM>e6YigT@^pF|4bJf z1oKKA-qF4JS9J0IM)!SC<6vg&WTx)v_#bLr)fIsMMXi>jpuMn#JFeI0B9cR9!4MpD z_#CDH9p|1^5~Wh&A(X`16U~af;3|>H%KqNm9(oEl(k@O(`HGF9Jwvq8(3f~)=$_hI z*?|~Fa#8MSL}q0?hWr#tn_B$fB4bEKF$-~tRYyu=f}CC{XqYhd`{S&_<#H^WX2>#z zMyQA&d~N3de`H8btkz)Bg_v!5EEvKT{GO@a-Q?bv-h9ne)NBAgSq%oS^a$YWF~gW;uFR#fBRwP@INn>czFI>CV{Iq|rkw;UOg*LwRGg+}!nq?WS%=E+6^lgozZl}$H=*NA{@FYvw0pQ#2<9L-5OLPl}=3Jz<# zAjgV`+FO4)p!Gb(M0$6kbE3lWxpy_(d0_yY{zq!i}l#QTl zFtxss>0yxV_)o=}J1FwSgOTgpLFkbHo(lYqvji@eS?~<+;*mSSk4SM!MDl|*B7Q>t z%&$DRQ#Cg?m=~zX9L8w3Cxf+$1NpNu6VubvT{ceVC6-Ipab3!?Bop6pD>DH1Xgx*w zWf_iVl3zYQ(ZU4N(WrYw-r0G(Jx@2oPLJtzE5tIc-PxuU^*-b?12KuXgm`{DRT0JN zuUwmf4ahkfjY3oh7xWPCs#e+So}4_E-CggzY)+i*^2}wuI-y#1Ud7hfe+v8tKdHSz z9ctU)l152z`u1No7>*Eq=MQ_vq(kb`2GB)ex5oB0`UN>VUJRiP`5TK{ZXACTg=ykLQVH>&znB z<{?AEmNfrgXOGZuct5ksjR_;tQf9j;haYPH;B zK}LBtwm#r8R$B%Q6xU1(OI#{a}I*>Dz?jGEdS;LK9R-4_tNW@+g|NVlWyfX(sNwbTeiPF=LxWV|xGR zk3;1h%qPp|hsd;XMk>KI6fZ>*X>=V6N3wu!0zv_|+a@?+KYIgx5QmAYfy0-s9?oph zLpwB~C-|+Mv6~@#m%IfncYx^gZBv{se2_%lWN7TRdQ21rhm^170Vw1SD(T-c6DL`A z)IKX)n`qYJ_RGIYQkIg9s7$mq6E27YngF=D&I9sI^JNv8$wXO&(i|QSVr~}7_%%!9 zWU9EAK0>{a18N!yQjFQ zYLm-cI>!ke>Z%0Vl4%!9HtCRvyg{})HQ3d6EK$;YY&tJeFpco_u&9`$fsV!_kCyKI z_Sk(*<2V!F@J`I&E0N=r_hyJgnpx&EomXj)wT(Nwt+A9ktAv3dn^Zo;uj=ZjHO8%8 zeEvskN{y6Zx7+u`{9Mzya@U3IxY$!9TF~cYS~JJ&jV8)5p57=wR@@PLOFB9(QifT0 zH*M4>IWNekv3}(0tbu9h+#S`gcGqt9*eA5(uMfIY$Le(<9kIy99%aSP9b0_vu+=wP zlO-Okt$IWs5SXor74zUlUR&i;lux_wNLc^jZu}Gji{v1RJunjkcO4(gO>fomRpx2? zGdBz|EAy}3`44@Qi&lcMlZbVg^`_YKg2UslmdWhNVY%eCcsUQR?&r;c3J&h9s&q-P zV@A5+Uk&B;QH1vQsST{i+q2>UE^!Zga6(OqO#ANcTl zw-V)x8d$#feGCZywp*$GZMQO-dpMe#x|o|WIhtCW>AcGmZj`P=El1aK(843PnW(xA z2SK>g0tIvuMlTwtJjx+su_WDyZ`CUMJ?_%JD!a;w8xFQ4lYIq+TuN+(p8N3@Z!@lR z+KSx-s8_V@v+7jrawAU)->x9r9@Dmtj#f7*DI&?d&Fi(3@N5z=d!G+7ZHUnO*hd#K z4UVJ7Faay{o-zeJ=_odeg5~lQJ>sMtQR>c=Wk;($U|^#X(^d}|gLu6FK}_~3(9P&v zcFo1vpNzWY=InP4Z;Tvzb#@}3T`yD~ymEdhSihtmUiK<2`NH66wfN;E9Xem>5zny1 z#TN2JD2@+XyPS1g#U5l*I(T3|rkYFZHw{Lp2CB4?aH;Rx#hOfNk1weU`zw8L0cjxr zlzdVd-juY;Oo;yMTNqDO1Gof{c8Y6=cJO0t#A!orqT zzBU;LkzlVmkjIqk^P2K@EV@U*VoZ>|(ualn=mF+-PWbg1XYdrOS7h1P82YM_i|p+> z+sTu_HpLSU2qdI<#i2a!d<*IyfE%7`ga-Rm*tk8LB?18ywDmNBirHqIo;ImHj!wcPmRC8V zTsS2x9ss!`ExOeaKBHzo{JH)5D2B8U%QTl*ol&u7+GiTdG|q)<$vWyiN44w^E@`g( zt%V&uTVm;qf%Wv%?J4pF-sH}@30saYD>m4KL;=BpgU?xxIetZ%%aflIM66wXh%AbapEW1mdXhm*2kcHDe)_652e zNq0rl>7xx8)BdZD(PRQ{se2Pwpv8!qGbpP!VrvUn5|>?rdM)=|YU|g>T47&Ui^`KE zcXc($BQAhL9~q;HxuGQcOndiAjA`RB?BbQ%+<5-bsA9Did**&IRM!7 z6ib`4tPpzr=TK{>g*0`K75swHUk>3=aGQ<_H7+L_dGm;Kjd;ukc#K#6#5)MCFCtkQ z(Y0HC2y7%QzhIxwIh7akhi(Z^ArBPPcv(_jvmT2iF7fy(zq-f z;uqfPaS`K!6Ph!yP!q7WdIoi3#G|FtYu_PGs?^8nZ)I|0D>R~yY}BGSpc@iq!b=GVDRA9bM*+R^_D9fgJuI!gen-^VlDZhwknKEKrOQy zLwTktt?&`;m#_#MF-hKFS4A_UyOwZwueq#{jGu@e#jM`k8P7LM5M^hXhKw0+m2`R( zLO^ge;Eb9VNYmx9OoV8HyBQY+J-#216^Sl=I}R0vWpzn^d|tGQeDkj8-Kghe?kfWul0X< z*8j}#w+Hmwm;4jCgnwuF-(1Rn=K8xS|Lq$62?dhBa{ccf(m#{^-O>E+~(f>=D a|Dg?( {% if method.isInitializer %}Void{% else %}{% call closureReturnTypeName method %}{% endif %})? + {% call accessLevel method.accessLevel %}{% call staticSpecifier method %}nonisolated(unsafe) var {% call methodClosureName method %}: (({% for param in method.parameters %}{{ param.typeName }}{% if not forloop.last %}, {% endif %}{% endfor %}) {% if method.isAsync %}async {% endif %}{% if method.throws %}throws {% endif %}-> {% if method.isInitializer %}Void{% else %}{% call closureReturnTypeName method %}{% endif %})? {% endmacro %} {% macro methodClosureCallParameters method %}{% for param in method.parameters %}{{ param.name }}{% if not forloop.last %}, {% endif %}{% endfor %}{% endmacro %} {% macro mockMethod method %} @@ -58,7 +58,7 @@ import {{ import }} {% endif %} {% if not method.isInitializer %} private {% call staticSpecifier method %}let {% call swiftifyMethodName method.selectorName %}CallsCountLock = NSLock() - private {% call staticSpecifier method %}var {% call swiftifyMethodName method.selectorName %}UnderlyingCallsCount = 0 + private {% call staticSpecifier method %}nonisolated(unsafe) var {% call swiftifyMethodName method.selectorName %}UnderlyingCallsCount = 0 {% call accessLevel method.accessLevel %}{% call staticSpecifier method %}var {% call swiftifyMethodName method.selectorName %}CallsCount: Int { get { {% call swiftifyMethodName method.selectorName %}CallsCountLock.withLock { {% call swiftifyMethodName method.selectorName %}UnderlyingCallsCount } } set { {% call swiftifyMethodName method.selectorName %}CallsCountLock.withLock { {% call swiftifyMethodName method.selectorName %}UnderlyingCallsCount = newValue } } @@ -74,26 +74,26 @@ import {{ import }} {% endset %} {% if method.parameters.count == 1 and not hasNonEscapingClosures %} private {% call staticSpecifier method %}let {% call swiftifyMethodName method.selectorName %}Received{% for param in method.parameters %}{{ param.name| replace:"`","" | upperFirstLetter }}Lock = NSLock(){% endfor %} - private {% call staticSpecifier method %}var {% call swiftifyMethodName method.selectorName %}UnderlyingReceived{% for param in method.parameters %}{{ param.name| replace:"`","" | upperFirstLetter }}: {{ '(' if param.isClosure }}{{ param.typeName.unwrappedTypeName }}{{ ')' if param.isClosure }}?{% endfor %} + private {% call staticSpecifier method %}nonisolated(unsafe) var {% call swiftifyMethodName method.selectorName %}UnderlyingReceived{% for param in method.parameters %}{{ param.name| replace:"`","" | upperFirstLetter }}: {{ '(' if param.isClosure }}{{ param.typeName.unwrappedTypeName }}{{ ')' if param.isClosure }}?{% endfor %} {% call accessLevel method.accessLevel %}{% call staticSpecifier method %}var {% call swiftifyMethodName method.selectorName %}Received{% for param in method.parameters %}{{ param.name| replace:"`","" | upperFirstLetter }}: {{ '(' if param.isClosure }}{{ param.typeName.unwrappedTypeName }}{{ ')' if param.isClosure }}?{% endfor %} { get { {% for param in method.parameters %}{% call swiftifyMethodName method.selectorName %}Received{{ param.name| replace:"`","" | upperFirstLetter }}Lock{% endfor %}.withLock { {% for param in method.parameters %}{% call swiftifyMethodName method.selectorName %}UnderlyingReceived{{ param.name| replace:"`","" | upperFirstLetter }}{% endfor %} } } set { {% for param in method.parameters %}{% call swiftifyMethodName method.selectorName %}Received{{ param.name| replace:"`","" | upperFirstLetter }}Lock{% endfor %}.withLock { {% for param in method.parameters %}{% call swiftifyMethodName method.selectorName %}UnderlyingReceived{{ param.name| replace:"`","" | upperFirstLetter }}{% endfor %} = newValue } } } private {% call staticSpecifier method %}let {% call swiftifyMethodName method.selectorName %}ReceivedInvocationsLock = NSLock() - private {% call staticSpecifier method %}var {% call swiftifyMethodName method.selectorName %}UnderlyingReceivedInvocations{% for param in method.parameters %}: [{{ '(' if param.isClosure }}{{ param.typeName.unwrappedTypeName }}{{ ')' if param.isClosure }}{%if param.typeName.isOptional%}?{%endif%}]{% endfor %} = [] + private {% call staticSpecifier method %}nonisolated(unsafe) var {% call swiftifyMethodName method.selectorName %}UnderlyingReceivedInvocations{% for param in method.parameters %}: [{{ '(' if param.isClosure }}{{ param.typeName.unwrappedTypeName }}{{ ')' if param.isClosure }}{%if param.typeName.isOptional%}?{%endif%}]{% endfor %} = [] {% call accessLevel method.accessLevel %}{% call staticSpecifier method %}var {% call swiftifyMethodName method.selectorName %}ReceivedInvocations{% for param in method.parameters %}: [{{ '(' if param.isClosure }}{{ param.typeName.unwrappedTypeName }}{{ ')' if param.isClosure }}{%if param.typeName.isOptional%}?{%endif%}]{% endfor %} { get { {% call swiftifyMethodName method.selectorName %}ReceivedInvocationsLock.withLock { {% call swiftifyMethodName method.selectorName %}UnderlyingReceivedInvocations } } set { {% call swiftifyMethodName method.selectorName %}ReceivedInvocationsLock.withLock { {% call swiftifyMethodName method.selectorName %}UnderlyingReceivedInvocations = newValue } } } {% elif not method.parameters.count == 0 and not hasNonEscapingClosures %} private {% call staticSpecifier method %}let {% call swiftifyMethodName method.selectorName %}ReceivedArgumentsLock = NSLock() - private {% call staticSpecifier method %}var {% call swiftifyMethodName method.selectorName %}UnderlyingReceivedArguments: ({% for param in method.parameters %}{{ param.name }}: {{ param.unwrappedTypeName if param.typeAttributes.escaping else param.typeName }}{{ ', ' if not forloop.last }}{% endfor %})? + private {% call staticSpecifier method %}nonisolated(unsafe) var {% call swiftifyMethodName method.selectorName %}UnderlyingReceivedArguments: ({% for param in method.parameters %}{{ param.name }}: {{ param.unwrappedTypeName if param.typeAttributes.escaping else param.typeName }}{{ ', ' if not forloop.last }}{% endfor %})? {% call accessLevel method.accessLevel %}{% call staticSpecifier method %}var {% call swiftifyMethodName method.selectorName %}ReceivedArguments: ({% for param in method.parameters %}{{ param.name }}: {{ param.unwrappedTypeName if param.typeAttributes.escaping else param.typeName }}{{ ', ' if not forloop.last }}{% endfor %})? { get { {% call swiftifyMethodName method.selectorName %}ReceivedArgumentsLock.withLock { {% call swiftifyMethodName method.selectorName %}UnderlyingReceivedArguments } } set { {% call swiftifyMethodName method.selectorName %}ReceivedArgumentsLock.withLock { {% call swiftifyMethodName method.selectorName %}UnderlyingReceivedArguments = newValue } } } private {% call staticSpecifier method %}let {% call swiftifyMethodName method.selectorName %}ReceivedInvocationsLock = NSLock() - private {% call staticSpecifier method %}var {% call swiftifyMethodName method.selectorName %}UnderlyingReceivedInvocations: [({% for param in method.parameters %}{{ param.name }}: {{ param.unwrappedTypeName if param.typeAttributes.escaping else param.typeName }}{{ ', ' if not forloop.last }}{% endfor %})] = [] + private {% call staticSpecifier method %}nonisolated(unsafe) var {% call swiftifyMethodName method.selectorName %}UnderlyingReceivedInvocations: [({% for param in method.parameters %}{{ param.name }}: {{ param.unwrappedTypeName if param.typeAttributes.escaping else param.typeName }}{{ ', ' if not forloop.last }}{% endfor %})] = [] {% call accessLevel method.accessLevel %}{% call staticSpecifier method %}var {% call swiftifyMethodName method.selectorName %}ReceivedInvocations: [({% for param in method.parameters %}{{ param.name }}: {{ param.unwrappedTypeName if param.typeAttributes.escaping else param.typeName }}{{ ', ' if not forloop.last }}{% endfor %})] { get { {% call swiftifyMethodName method.selectorName %}ReceivedInvocationsLock.withLock { {% call swiftifyMethodName method.selectorName %}UnderlyingReceivedInvocations } } set { {% call swiftifyMethodName method.selectorName %}ReceivedInvocationsLock.withLock { {% call swiftifyMethodName method.selectorName %}UnderlyingReceivedInvocations = newValue } } @@ -102,7 +102,7 @@ import {{ import }} {% if not method.returnTypeName.isVoid and not method.isInitializer %} private {% call staticSpecifier method %}let {% call swiftifyMethodName method.selectorName %}ReturnValueLock = NSLock() - private {% call staticSpecifier method %}var {% call swiftifyMethodName method.selectorName %}UnderlyingReturnValue: {{ '(' if method.returnTypeName.isClosure and not method.isOptionalReturnType }}{{ method.returnTypeName }}{{ ')' if method.returnTypeName.isClosure and not method.isOptionalReturnType }}{{ '!' if not method.isOptionalReturnType }} + private {% call staticSpecifier method %}nonisolated(unsafe) var {% call swiftifyMethodName method.selectorName %}UnderlyingReturnValue: {{ '(' if method.returnTypeName.isClosure and not method.isOptionalReturnType }}{{ method.returnTypeName }}{{ ')' if method.returnTypeName.isClosure and not method.isOptionalReturnType }}{{ '!' if not method.isOptionalReturnType }} {% call accessLevel method.accessLevel %}{% call staticSpecifier method %}var {% call swiftifyMethodName method.selectorName %}ReturnValue: {{ '(' if method.returnTypeName.isClosure and not method.isOptionalReturnType }}{{ method.returnTypeName }}{{ ')' if method.returnTypeName.isClosure and not method.isOptionalReturnType }}{{ '!' if not method.isOptionalReturnType }} { get { {% call swiftifyMethodName method.selectorName %}ReturnValueLock.withLock { {% call swiftifyMethodName method.selectorName %}UnderlyingReturnValue } } set { {% call swiftifyMethodName method.selectorName %}ReturnValueLock.withLock { {% call swiftifyMethodName method.selectorName %}UnderlyingReturnValue = newValue } } @@ -121,7 +121,8 @@ import {{ import }} {{ value }} {% endfor %} {% endfor %} - {% call accessLevel method.accessLevel %}{% call staticSpecifier method %}func {{ method.name }}{{ ' async' if method.isAsync }}{{ ' throws' if method.throws }}{% if not method.returnTypeName.isVoid %} -> {{ method.returnTypeName }}{% endif %} { + {# @concurrent keeps async mocks suspending like the real implementations would, otherwise with caller isolation inherited by default, intermediate states are never observable. #} + {% call accessLevel method.accessLevel %}{% call staticSpecifier method %}{{ '@concurrent ' if method.isAsync }}func {{ method.name }}{{ ' async' if method.isAsync }}{{ ' throws' if method.throws }}{% if not method.returnTypeName.isVoid %} -> {{ method.returnTypeName }}{% endif %} { {% if method.throws %} {% call methodThrowableErrorUsage method %} {% endif %} @@ -160,10 +161,10 @@ import {{ import }} {% endif %} {% endmacro %} {% macro mockOptionalVariable variable %} - {% if variable.name == 'delegate' %}weak {% endif %}{% call accessLevel variable.readAccess %}var {% call mockedVariableName variable %}: {{ variable.typeName }} + {% if variable.name == 'delegate' %}weak {% endif %}{% call accessLevel variable.readAccess %}nonisolated(unsafe) var {% call mockedVariableName variable %}: {{ variable.typeName }} {% endmacro %} {% macro mockNonOptionalArrayOrDictionaryVariable variable %} - {% call accessLevel variable.readAccess %}var {% call mockedVariableName variable %}: {{ variable.typeName }} = {% if variable.isArray %}[]{% elif variable.isDictionary %}[:]{% endif %} + {% call accessLevel variable.readAccess %}nonisolated(unsafe) var {% call mockedVariableName variable %}: {{ variable.typeName }} = {% if variable.isArray %}[]{% elif variable.isDictionary %}[:]{% endif %} {% endmacro %} {% macro mockNonOptionalVariable variable %} {% call accessLevel variable.readAccess %}var {% call mockedVariableName variable %}: {{ variable.typeName }} { @@ -171,10 +172,10 @@ import {{ import }} set(value) { {% call underlyingMockedVariableName variable %} = value } } {% set wrappedTypeName %}{% if variable.typeName.isProtocolComposition %}({{ variable.typeName }}){% else %}{{ variable.typeName }}{% endif %}{% endset %} - {% call accessLevel variable.readAccess %}var {% call underlyingMockedVariableName variable %}: {{ wrappedTypeName }}! + {% call accessLevel variable.readAccess %}nonisolated(unsafe) var {% call underlyingMockedVariableName variable %}: {{ wrappedTypeName }}! {% endmacro %} {% macro variableThrowableErrorDeclaration variable %} - {% call accessLevel variable.readAccess %}var {% call mockedVariableName variable %}ThrowableError: Error? + {% call accessLevel variable.readAccess %}nonisolated(unsafe) var {% call mockedVariableName variable %}ThrowableError: Error? {% endmacro %} {% macro variableThrowableErrorUsage variable %} if let error = {% call mockedVariableName variable %}ThrowableError { @@ -182,11 +183,11 @@ import {{ import }} } {% endmacro %} {% macro variableClosureDeclaration variable %} - {% call accessLevel variable.readAccess %}var {% call variableClosureName variable %}: (() {% if variable.isAsync %}async {% endif %}{% if variable.throws %}throws {% endif %}-> {{ variable.typeName }})? + {% call accessLevel variable.readAccess %}nonisolated(unsafe) var {% call variableClosureName variable %}: (() {% if variable.isAsync %}async {% endif %}{% if variable.throws %}throws {% endif %}-> {{ variable.typeName }})? {% endmacro %} {% macro variableClosureName variable %}{% call mockedVariableName variable %}Closure{% endmacro %} {% macro mockAsyncOrThrowingVariable variable %} - {% call accessLevel variable.readAccess %}var {% call mockedVariableName variable %}CallsCount = 0 + {% call accessLevel variable.readAccess %}nonisolated(unsafe) var {% call mockedVariableName variable %}CallsCount = 0 {% call accessLevel variable.readAccess %}var {% call mockedVariableName variable %}Called: Bool { return {% call mockedVariableName variable %}CallsCount > 0 } @@ -204,7 +205,7 @@ import {{ import }} } } } - {% call accessLevel variable.readAccess %}var {% call underlyingMockedVariableName variable %}: {{ variable.typeName }}{{ '!' if not variable.isOptional }} + {% call accessLevel variable.readAccess %}nonisolated(unsafe) var {% call underlyingMockedVariableName variable %}: {{ variable.typeName }}{{ '!' if not variable.isOptional }} {% if variable.throws %} {% call variableThrowableErrorDeclaration variable %} {% endif %} @@ -213,7 +214,7 @@ import {{ import }} {% macro underlyingMockedVariableName variable %}underlying{{ variable.name|upperFirstLetter }}{% endmacro %} {% macro mockedVariableName variable %}{{ variable.name }}{% endmacro %} {% for type in types.protocols where type.based.AutoMockable or type|annotated:"AutoMockable" %}{% if type.name != "AutoMockable" %} -{% call accessLevel type.accessLevel %}class {{ type.name | replace:"Protocol","" }}Mock: {{ type.name }}, @unchecked Sendable { +{% call accessLevel type.accessLevel %}nonisolated class {{ type.name | replace:"Protocol","" }}Mock: {{ type.name }}, @unchecked Sendable { {% if type.accessLevel == "public" %}public init() {}{% endif %} {% for variable in type.allVariables|!definedInExtension %} {% if variable.isAsync or variable.throws %}{% call mockAsyncOrThrowingVariable variable %}{% elif variable.isOptional %}{% call mockOptionalVariable variable %}{% elif variable.isArray or variable.isDictionary %}{% call mockNonOptionalArrayOrDictionaryVariable variable %}{% else %}{% call mockNonOptionalVariable variable %}{% endif %} diff --git a/Tools/SwiftGen/Templates/Strings/structured-swift5-element-untranslated.stencil b/Tools/SwiftGen/Templates/Strings/structured-swift5-element-untranslated.stencil index 02ad4c7ab..21a065322 100644 --- a/Tools/SwiftGen/Templates/Strings/structured-swift5-element-untranslated.stencil +++ b/Tools/SwiftGen/Templates/Strings/structured-swift5-element-untranslated.stencil @@ -59,7 +59,7 @@ import Foundation // swiftlint:disable explicit_type_interface function_parameter_count identifier_name line_length // swiftlint:disable nesting type_body_length type_name vertical_whitespace_opening_braces {% set enumName %}{{param.enumName|default:"L10n"}}{% endset %} -{{accessModifier}} enum {{enumName}} { +{{accessModifier}} nonisolated enum {{enumName}} { {% if tables.count > 1 or param.forceFileNameEnum %} {% for table in tables %} {% filter indent:2 %}{% call recursiveBlock table.name table.levels %}{% endfilter %} @@ -73,7 +73,7 @@ import Foundation // MARK: - Implementation Details -extension {{enumName}} { +nonisolated extension {{enumName}} { static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String { // No need to check languages, we always default to en for untranslated strings guard let bundle = Bundle.lprojBundle(for: "en") else { return key } diff --git a/Tools/SwiftGen/Templates/Strings/structured-swift5-element.stencil b/Tools/SwiftGen/Templates/Strings/structured-swift5-element.stencil index 74a5da076..40dbf9071 100644 --- a/Tools/SwiftGen/Templates/Strings/structured-swift5-element.stencil +++ b/Tools/SwiftGen/Templates/Strings/structured-swift5-element.stencil @@ -59,7 +59,7 @@ import Foundation // swiftlint:disable explicit_type_interface function_parameter_count identifier_name line_length // swiftlint:disable nesting type_body_length type_name vertical_whitespace_opening_braces {% set enumName %}{{param.enumName|default:"L10n"}}{% endset %} -{{accessModifier}} enum {{enumName}} { +{{accessModifier}} nonisolated enum {{enumName}} { {% if tables.count > 1 or param.forceFileNameEnum %} {% for table in tables %} {% filter indent:2 %}{% call recursiveBlock table.name table.levels %}{% endfilter %} @@ -73,7 +73,7 @@ import Foundation // MARK: - Implementation Details -extension {{enumName}} { +nonisolated extension {{enumName}} { static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String { // Use preferredLocalizations to get a language that is in the bundle and the user's preferred list of languages. let languages = Bundle.overrideLocalizations ?? Bundle.app.preferredLocalizations diff --git a/UnitTests/Sources/AnalyticsTests.swift b/UnitTests/Sources/AnalyticsTests.swift index af12b5970..c0e17601f 100644 --- a/UnitTests/Sources/AnalyticsTests.swift +++ b/UnitTests/Sources/AnalyticsTests.swift @@ -11,13 +11,13 @@ import AnalyticsEvents import PostHog import Testing +@MainActor final class AnalyticsTests { private let appSettings: AppSettings private let analytics: AnalyticsServiceProtocol private let analyticsClient: AnalyticsClientMock private var posthogMock: PHGPostHogMock - @MainActor init() { appSettings = AppSettings.volatile() diff --git a/UnitTests/Sources/AppRouteURLParserTests.swift b/UnitTests/Sources/AppRouteURLParserTests.swift index 6f70edf3c..7ceb0b9a2 100644 --- a/UnitTests/Sources/AppRouteURLParserTests.swift +++ b/UnitTests/Sources/AppRouteURLParserTests.swift @@ -10,6 +10,7 @@ import Foundation import Testing +@MainActor struct AppRouteURLParserTests { var appSettings: AppSettings var appRouteURLParser: AppRouteURLParser diff --git a/UnitTests/Sources/BugReportServiceTests.swift b/UnitTests/Sources/BugReportServiceTests.swift index e8a54728d..d026efc0a 100644 --- a/UnitTests/Sources/BugReportServiceTests.swift +++ b/UnitTests/Sources/BugReportServiceTests.swift @@ -11,6 +11,7 @@ import Combine import Foundation import Testing +@MainActor final class BugReportServiceTests { var appSettings: AppSettings! var bugReportService: BugReportServiceProtocol! @@ -76,7 +77,7 @@ final class BugReportServiceTests { #expect(!service.crashedLastRun) } - @Test @MainActor + @Test func submitBugReportWithRealService() async throws { let urlPublisher: CurrentValueSubject = .init(.url("https://example.com/submit")) let service = BugReportService(rageshakeURLPublisher: urlPublisher.asCurrentValuePublisher(), diff --git a/UnitTests/Sources/ClassicAppAccountManagerTests.swift b/UnitTests/Sources/ClassicAppAccountManagerTests.swift index ac0f2812c..4889dbb53 100644 --- a/UnitTests/Sources/ClassicAppAccountManagerTests.swift +++ b/UnitTests/Sources/ClassicAppAccountManagerTests.swift @@ -9,6 +9,7 @@ import Foundation import Testing +@MainActor final class ClassicAppAccountManagerTests { let testDirectory: URL = .temporaryDirectory.appending(component: UUID().uuidString) let accountAESKey: Data @@ -68,6 +69,7 @@ final class ClassicAppAccountManagerTests { } } +@MainActor extension ClassicAppAccount { /// Creates a mock account based on the fixtures used by this test. static func mock(classicAppAccountManager: ClassicAppAccountManager, cryptoStorePassphrase: Data) -> ClassicAppAccount { diff --git a/UnitTests/Sources/ClassicAppMediaLoaderTests.swift b/UnitTests/Sources/ClassicAppMediaLoaderTests.swift index a0b6233c6..d6c633518 100644 --- a/UnitTests/Sources/ClassicAppMediaLoaderTests.swift +++ b/UnitTests/Sources/ClassicAppMediaLoaderTests.swift @@ -14,6 +14,7 @@ final class ClassicAppMediaLoaderTests { let mediaLoader: ClassicAppMediaLoader let urlSession: URLSession + @MainActor init() throws { account = ClassicAppAccount(userID: "@alice:matrix.org", displayName: nil, @@ -40,6 +41,7 @@ final class ClassicAppMediaLoaderTests { #expect(data == MockURLProtocol.downloadData) } + @MainActor @Test func loadMediaContentWithInvalidToken() async throws { let accountWithoutToken = ClassicAppAccount(userID: "@bob:matrix.org", diff --git a/UnitTests/Sources/ElementCallServiceTests.swift b/UnitTests/Sources/ElementCallServiceTests.swift index c84ccfd67..4fe6f0447 100644 --- a/UnitTests/Sources/ElementCallServiceTests.swift +++ b/UnitTests/Sources/ElementCallServiceTests.swift @@ -41,7 +41,7 @@ final class ElementCallServiceTests { func incomingCall() async { #expect(!callProvider.reportNewIncomingCallWithUpdateCompletionCalled) - await confirmation { confirmation in + await waitForConfirmation { confirmation in let pkPushPayloadMock = PKPushPayloadMock().updatingExpiration(currentDate, lifetime: 30) service.pushRegistry(pushRegistry, didReceiveIncomingPushWith: pkPushPayloadMock, for: .voIP) { @@ -62,7 +62,7 @@ final class ElementCallServiceTests { func incomingVoiceCall() async { #expect(!callProvider.reportNewIncomingCallWithUpdateCompletionCalled) - await confirmation { confirmation in + await waitForConfirmation { confirmation in let pkPushPayloadMock = PKPushPayloadMock().updatingExpiration(currentDate, lifetime: 30) .updateIsVoice(true) @@ -162,7 +162,7 @@ final class ElementCallServiceTests { // Send push #2 for the same room; the previous incoming state must be cleared, // so the second push gets a fresh CallID. - await confirmation { confirmation in + await waitForConfirmation { confirmation in let secondPayload = PKPushPayloadMock().updatingExpiration(currentDate, lifetime: 60) service.pushRegistry(pushRegistry, didReceiveIncomingPushWith: secondPayload, for: .voIP) { confirmation() @@ -182,7 +182,7 @@ final class ElementCallServiceTests { @Test func setupCallSessionCancelsPendingUnansweredTimeout() async { // Schedule the 60s unanswered timer via an incoming push - await confirmation { confirmation in + await waitForConfirmation { confirmation in let payload = PKPushPayloadMock().updatingExpiration(currentDate, lifetime: 60) service.pushRegistry(pushRegistry, didReceiveIncomingPushWith: payload, for: .voIP) { confirmation() @@ -240,7 +240,7 @@ final class ElementCallServiceTests { let baselineNewIncomingCount = callProvider.reportNewIncomingCallWithUpdateCompletionCallsCount let baselineEndedCount = callProvider.reportCallWithEndedAtReasonCallsCount - await confirmation { confirmation in + await waitForConfirmation { confirmation in service.pushRegistry(pushRegistry, didReceiveIncomingPushWith: payload, for: .voIP) { confirmation() } diff --git a/UnitTests/Sources/HomeScreenViewModelTests.swift b/UnitTests/Sources/HomeScreenViewModelTests.swift index f5abd111e..b9dda3959 100644 --- a/UnitTests/Sources/HomeScreenViewModelTests.swift +++ b/UnitTests/Sources/HomeScreenViewModelTests.swift @@ -441,6 +441,7 @@ final class HomeScreenViewModelTests { } } +@MainActor private extension [HomeScreenRoom] { var invites: [HomeScreenRoom] { filter { room in @@ -453,7 +454,8 @@ private extension [HomeScreenRoom] { } } -extension HomeScreenViewModelAction: @retroactive Equatable { +@MainActor +extension HomeScreenViewModelAction: @MainActor @retroactive Equatable { public static func == (lhs: HomeScreenViewModelAction, rhs: HomeScreenViewModelAction) -> Bool { switch (lhs, rhs) { case (.presentRoom(let lhsID), .presentRoom(let rhsID)): diff --git a/UnitTests/Sources/JoinRoomScreenViewModelTests.swift b/UnitTests/Sources/JoinRoomScreenViewModelTests.swift index ed3b61251..37ee4d0a9 100644 --- a/UnitTests/Sources/JoinRoomScreenViewModelTests.swift +++ b/UnitTests/Sources/JoinRoomScreenViewModelTests.swift @@ -207,7 +207,8 @@ final class JoinRoomScreenViewModelTests { } } -extension JoinRoomScreenViewModelAction: @retroactive Equatable { +@MainActor +extension JoinRoomScreenViewModelAction: @MainActor @retroactive Equatable { /// A close enough approximation for tests. public static func == (lhs: JoinRoomScreenViewModelAction, rhs: JoinRoomScreenViewModelAction) -> Bool { switch (lhs, rhs) { diff --git a/UnitTests/Sources/LocationSharingScreenViewModelTests.swift b/UnitTests/Sources/LocationSharingScreenViewModelTests.swift index d4109f148..4a14377ad 100644 --- a/UnitTests/Sources/LocationSharingScreenViewModelTests.swift +++ b/UnitTests/Sources/LocationSharingScreenViewModelTests.swift @@ -241,7 +241,7 @@ struct LocationSharingScreenViewModelTests { } @Test - mutating func startLiveLocationWithNotDeterminedAuthorizationTransitionsToWhenInUse() async { + mutating func startLiveLocationWithNotDeterminedAuthorizationTransitionsToWhenInUse() { let authorizationStatusSubject = CurrentValueSubject(.notDetermined) let liveLocationManagerMock = LiveLocationManagerMock() liveLocationManagerMock.authorizationStatus = .init(authorizationStatusSubject) @@ -252,16 +252,14 @@ struct LocationSharingScreenViewModelTests { // No alert yet — waiting for MapLibre to resolve the status to whenInUse #expect(context.alertInfo == nil) + #expect(!liveLocationManagerMock.requestAlwaysAuthorizationIfPossibleCalled) - // Simulate MapLibre resolving the Authorization to whenInUse, and confirm that the ViewModel - // recurses and calls requestAlwaysAuthorizationIfPossible as a result - await waitForConfirmation { confirmation in - liveLocationManagerMock.requestAlwaysAuthorizationIfPossibleClosure = { - confirmation() - return true - } - authorizationStatusSubject.send(.authorizedWhenInUse) - } + // Simulate MapLibre resolving the Authorization to whenInUse. The subject delivers + // synchronously on the main actor, so the ViewModel recurses and calls + // requestAlwaysAuthorizationIfPossible before send returns. + authorizationStatusSubject.send(.authorizedWhenInUse) + + #expect(liveLocationManagerMock.requestAlwaysAuthorizationIfPossibleCalled) // The request was made, so no alert — waiting for the always Authorization prompt response #expect(context.alertInfo == nil) diff --git a/UnitTests/Sources/LoggingTests.swift b/UnitTests/Sources/LoggingTests.swift index 9355e6cb1..17bcf24b9 100644 --- a/UnitTests/Sources/LoggingTests.swift +++ b/UnitTests/Sources/LoggingTests.swift @@ -12,6 +12,7 @@ import Foundation import MatrixRustSDKMocks import Testing +@MainActor final class LoggingTests { private enum Constants { static let genericFailure = "Test failed" diff --git a/UnitTests/Sources/MapTilerURLBuilderTests.swift b/UnitTests/Sources/MapTilerURLBuilderTests.swift index 94dc0f975..9a8f08dc7 100644 --- a/UnitTests/Sources/MapTilerURLBuilderTests.swift +++ b/UnitTests/Sources/MapTilerURLBuilderTests.swift @@ -10,6 +10,7 @@ import CoreLocation @testable import ElementX import Testing +@MainActor struct MapTilerURLBuilderTests { private static let baseURL: URL = "http://www.foo.com" private static let apiKey = "some_key" diff --git a/UnitTests/Sources/RoomListFiltersStateTests.swift b/UnitTests/Sources/RoomListFiltersStateTests.swift index f1b32e4ba..4f733503d 100644 --- a/UnitTests/Sources/RoomListFiltersStateTests.swift +++ b/UnitTests/Sources/RoomListFiltersStateTests.swift @@ -9,6 +9,7 @@ @testable import ElementX import Testing +@MainActor final class RoomListFiltersStateTests { var appSettings: AppSettings var state: RoomListFiltersState diff --git a/UnitTests/Sources/RoomSummaryTests.swift b/UnitTests/Sources/RoomSummaryTests.swift index 562d2b49d..e983d1185 100644 --- a/UnitTests/Sources/RoomSummaryTests.swift +++ b/UnitTests/Sources/RoomSummaryTests.swift @@ -11,6 +11,7 @@ import Foundation import MatrixRustSDKMocks import Testing +@MainActor struct RoomSummaryTests { // swiftlint:disable:next large_tuple let roomDetails: (id: String, name: String, avatarURL: URL) = ("room_id", "Room Name", "mxc://hs.tld/room/avatar") diff --git a/UnitTests/Sources/TestUtilities/WaitingConfirmation.swift b/UnitTests/Sources/TestUtilities/WaitingConfirmation.swift index 829f9b68b..bfa076024 100644 --- a/UnitTests/Sources/TestUtilities/WaitingConfirmation.swift +++ b/UnitTests/Sources/TestUtilities/WaitingConfirmation.swift @@ -114,8 +114,10 @@ func waitForConfirmation(_ comment: Comment? = nil, expectedCount: expectedCount, isolation: isolation, sourceLocation: sourceLocation) { confirmation in - let result = try body(.init(continuation: continuation, - expectedCount: expectedCount)) + let result = try await runBody(on: isolation, + body, + with: .init(continuation: continuation, + expectedCount: expectedCount)) for await _ in stream { confirmation() } @@ -123,6 +125,17 @@ func waitForConfirmation(_ comment: Comment? = nil, } } +/// Runs the body on the given actor, so that it can safely touch the caller's isolated state. +/// +/// Swift Testing's `confirmation` runs its closure on the concurrent executor regardless of the +/// isolation parameter, so without this hop a body that synchronously triggers main actor +/// work (e.g. sending a view action) would crash on the runtime's executor check. +private func runBody(on isolation: isolated (any Actor)?, + _ body: (WaitingConfirmation) throws -> R, + with confirmation: WaitingConfirmation) rethrows -> R { + try body(confirmation) +} + /// Waits for a confirmation to be triggered an expected number of times within a synchronous body, /// with a timeout. /// @@ -181,8 +194,10 @@ func waitForConfirmation(_ comment: Comment? = nil, expectedCount: expectedCount, isolation: isolation, sourceLocation: sourceLocation) { confirmation in - let result = try body(.init(continuation: continuation, - expectedCount: expectedCount)) + let result = try await runBody(on: isolation, + body, + with: .init(continuation: continuation, + expectedCount: expectedCount)) // The reason why I don't add to the task group directly the non timeout implementation // is that I do not want the body to be marked as @escaping and thus to be able to capture diff --git a/UnitTests/Sources/TimelineStateTests.swift b/UnitTests/Sources/TimelineStateTests.swift index 67de38c27..ced73cb45 100644 --- a/UnitTests/Sources/TimelineStateTests.swift +++ b/UnitTests/Sources/TimelineStateTests.swift @@ -10,6 +10,7 @@ import OrderedCollections import Testing +@MainActor struct TimelineStateTests { // MARK: - Read marker diff --git a/UnitTests/Sources/UserPreferenceTests.swift b/UnitTests/Sources/UserPreferenceTests.swift index d4b0e86e1..b023036db 100644 --- a/UnitTests/Sources/UserPreferenceTests.swift +++ b/UnitTests/Sources/UserPreferenceTests.swift @@ -135,28 +135,28 @@ struct UserPreferenceTests { @Test func localOverRemoteValue() { let storage = VolatileUserDefaults() - @UserPreference(key: TestsKey.testKey, defaultValue: "", storage: storage) var preference - #expect(preference == "") + let preference = UserPreference(key: TestsKey.testKey, defaultValue: "", storage: storage) + #expect(preference.wrappedValue == "") - _preference.remoteValue = "remote" - #expect(preference == "remote") + preference.remoteValue = "remote" + #expect(preference.wrappedValue == "remote") - preference = "local" - #expect(preference == "local") + preference.wrappedValue = "local" + #expect(preference.wrappedValue == "local") } @Test func remoteOverLocalValue() { let storage = VolatileUserDefaults() - @UserPreference(key: TestsKey.testKey, defaultValue: "", storage: storage, mode: .remoteOverLocal) var preference - #expect(preference == "") + let preference = UserPreference(key: TestsKey.testKey, defaultValue: "", storage: storage, mode: .remoteOverLocal) + #expect(preference.wrappedValue == "") - _preference.remoteValue = "remote" - #expect(preference == "remote") + preference.remoteValue = "remote" + #expect(preference.wrappedValue == "remote") - preference = "local" - #expect(preference == "remote") - #expect(_preference.isLockedToRemote) + preference.wrappedValue = "local" + #expect(preference.wrappedValue == "remote") + #expect(preference.isLockedToRemote) } } diff --git a/compound-ios/Sources/Compound/List/ListRow.swift b/compound-ios/Sources/Compound/List/ListRow.swift index 8ee7ff25e..c3e84f70d 100644 --- a/compound-ios/Sources/Compound/List/ListRow.swift +++ b/compound-ios/Sources/Compound/List/ListRow.swift @@ -52,7 +52,7 @@ public struct ListRow, axis: Axis?) case secureField(text: Binding) - case custom(() -> CustomView) + case custom(@MainActor () -> CustomView) public static func textField(text: Binding) -> Self { .textField(text: text, axis: nil)