Skip to content

Commit

Permalink
Merge branch 'develop' into langleyd/fix_flakey_tests_with_deferFulfi…
Browse files Browse the repository at this point in the history
…llment
  • Loading branch information
langleyd authored Jul 12, 2023
2 parents 1e49054 + 7650675 commit 5a8bf5b
Show file tree
Hide file tree
Showing 116 changed files with 668 additions and 709 deletions.
8 changes: 1 addition & 7 deletions ElementX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@
6860721DB3091BE08164C132 /* MapAssets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B48B7AD4908C5C374517B892 /* MapAssets.xcassets */; };
68AC3C84E2B438036B174E30 /* EmoteRoomTimelineView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 471EB7D96AFEA8D787659686 /* EmoteRoomTimelineView.swift */; };
695825D20A761C678809345D /* MessageForwardingScreenModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52135BD9E0E7A091688F627A /* MessageForwardingScreenModels.swift */; };
69ABFBAF05D7EF11E7C88CEA /* EncryptionSyncListenerProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68356CB936A8814A3FEA66A8 /* EncryptionSyncListenerProxy.swift */; };
69BCBB4FB2DC3D61A28D3FD8 /* TimelineStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DC2C9E0E15C79BBDA80F0A2 /* TimelineStyle.swift */; };
69C7B956B74BEC3DB88224EA /* NavigationSplitCoordinatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78913D6E120D46138E97C107 /* NavigationSplitCoordinatorTests.swift */; };
6A0E7551E0D1793245F34CDD /* ClientError.swift in Sources */ = {isa = PBXBuildFile; fileRef = D09A267106B9585D3D0CFC0D /* ClientError.swift */; };
Expand Down Expand Up @@ -723,7 +722,6 @@
F7BC744FFA7FE248FAE7F570 /* UserIndicatorToastView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F57C8022B8A871A1DCD1750A /* UserIndicatorToastView.swift */; };
F86102DC2C68BBBB0521BAAE /* SoftLogoutScreenModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BB385E148DE55C85C0A02D6 /* SoftLogoutScreenModels.swift */; };
F8E725D42023ECA091349245 /* AudioRoomTimelineItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57EAAF82432B0B53881CF826 /* AudioRoomTimelineItem.swift */; };
F91B4629E4AF51A4FE8E7608 /* EncryptionSyncListenerProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68356CB936A8814A3FEA66A8 /* EncryptionSyncListenerProxy.swift */; };
F94000E3D91B11C527DA8807 /* UserProfileCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 923485F85E1D765EF9D20E88 /* UserProfileCell.swift */; };
F9842667B68DC6FA1F9ECCBB /* NSItemProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = F72EFC8C634469F9262659C7 /* NSItemProvider.swift */; };
F99FB21EFC6D99D247FE7CBE /* Kingfisher in Frameworks */ = {isa = PBXBuildFile; productRef = DE8DC9B3FBA402117DC4C49F /* Kingfisher */; };
Expand Down Expand Up @@ -1071,7 +1069,6 @@
667DD3A9D932D7D9EB380CAA /* sk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = sk; path = sk.lproj/Localizable.stringsdict; sourceTree = "<group>"; };
669F35C505ACE1110589F875 /* MediaUploadingPreprocessor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaUploadingPreprocessor.swift; sourceTree = "<group>"; };
66F2402D738694F98729A441 /* RoomTimelineProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomTimelineProvider.swift; sourceTree = "<group>"; };
68356CB936A8814A3FEA66A8 /* EncryptionSyncListenerProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EncryptionSyncListenerProxy.swift; sourceTree = "<group>"; };
6861FE915C7B5466E6962BBA /* StartChatScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StartChatScreen.swift; sourceTree = "<group>"; };
686BCFA37AC6C67FF973CE67 /* OnboardingBackgroundImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingBackgroundImage.swift; sourceTree = "<group>"; };
69219A908D7C22E6EE6689AE /* UserNotificationCenterSpy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserNotificationCenterSpy.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2649,7 +2646,6 @@
832FC81F760220239E285294 /* Proxy */ = {
isa = PBXGroup;
children = (
68356CB936A8814A3FEA66A8 /* EncryptionSyncListenerProxy.swift */,
25F7FE40EF7490A7E09D7BE6 /* NotificationItemProxy.swift */,
);
path = Proxy;
Expand Down Expand Up @@ -4004,7 +4000,6 @@
9A3B0CDF097E3838FB1B9595 /* Bundle.swift in Sources */,
DFCA89C4EC2A5332ED6B441F /* DataProtectionManager.swift in Sources */,
24A75F72EEB7561B82D726FD /* Date.swift in Sources */,
F91B4629E4AF51A4FE8E7608 /* EncryptionSyncListenerProxy.swift in Sources */,
A33784831AD880A670CAA9F9 /* FileManager.swift in Sources */,
59F940FCBE6BC343AECEF75E /* ImageCache.swift in Sources */,
A3E390675E9730C176B59E1B /* ImageProviderProtocol.swift in Sources */,
Expand Down Expand Up @@ -4262,7 +4257,6 @@
9965CB800CE6BC74ACA969FC /* EncryptedHistoryRoomTimelineView.swift in Sources */,
4C5A638DAA8AF64565BA4866 /* EncryptedRoomTimelineItem.swift in Sources */,
B5903E48CF43259836BF2DBF /* EncryptedRoomTimelineView.swift in Sources */,
69ABFBAF05D7EF11E7C88CEA /* EncryptionSyncListenerProxy.swift in Sources */,
F78BAD28482A467287A9A5A3 /* EventBasedMessageTimelineItemProtocol.swift in Sources */,
02D8DF8EB7537EB4E9019DDB /* EventBasedTimelineItemProtocol.swift in Sources */,
63E46D18B91D08E15FC04125 /* ExpiringTaskRunner.swift in Sources */,
Expand Down Expand Up @@ -5289,7 +5283,7 @@
repositoryURL = "https://github.com/matrix-org/matrix-rust-components-swift";
requirement = {
kind = exactVersion;
version = "1.0.96-alpha";
version = "1.0.98-alpha";
};
};
96495DD8554E2F39D3954354 /* XCRemoteSwiftPackageReference "posthog-ios" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/matrix-org/matrix-rust-components-swift",
"state" : {
"revision" : "8bc8015237083035cb5f4a00d1eedb9ebbbb83c6",
"version" : "1.0.96-alpha"
"revision" : "985708733af7d2db1684f90f0a954854ca3a83ad",
"version" : "1.0.98-alpha"
}
},
{
Expand Down
23 changes: 16 additions & 7 deletions ElementX.xcodeproj/xcshareddata/xcschemes/ElementX.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
buildImplicitDependencies = "YES"
runPostActionsOnFailure = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
Expand All @@ -29,6 +30,12 @@
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES"
onlyGenerateCoverageForSpecifiedTargets = "YES">
<TestPlans>
<TestPlanReference
default = "YES"
reference = "container:UnitTests/SupportingFiles/UnitTests.xctestplan">
</TestPlanReference>
</TestPlans>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
Expand All @@ -38,6 +45,10 @@
ReferencedContainer = "container:ElementX.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
</Testables>
<CommandLineArguments>
</CommandLineArguments>
<CodeCoverageTargets>
<BuildableReference
BuildableIdentifier = "primary"
Expand All @@ -47,12 +58,6 @@
ReferencedContainer = "container:ElementX.xcodeproj">
</BuildableReference>
</CodeCoverageTargets>
<TestPlans>
<TestPlanReference
reference = "container:UnitTests/SupportingFiles/UnitTests.xctestplan"
default = "YES">
</TestPlanReference>
</TestPlans>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -74,6 +79,8 @@
ReferencedContainer = "container:ElementX.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
</CommandLineArguments>
<EnvironmentVariables>
<EnvironmentVariable
key = "RUST_BACKTRACE"
Expand Down Expand Up @@ -113,6 +120,8 @@
ReferencedContainer = "container:ElementX.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
</CommandLineArguments>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
6 changes: 3 additions & 3 deletions ElementX/Sources/Application/AppCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationCoordinatorDelegate,
// MARK: - Application State

private func stopSync() {
userSession?.clientProxy.stopSync()
userSession?.clientProxy.pauseSync()

backgroundAppRefreshTask?.setTaskCompleted(success: true)
backgroundAppRefreshTask = nil
Expand Down Expand Up @@ -602,7 +602,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationCoordinatorDelegate,

@objc
private func applicationWillTerminate() {
userSession?.clientProxy.stopSync()
userSession?.clientProxy.pauseSync()
}

@objc
Expand All @@ -616,7 +616,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationCoordinatorDelegate,
backgroundTask = backgroundTaskService.startBackgroundTask(withName: "SuspendApp: \(UUID().uuidString)") { [weak self] in
guard let self else { return }

userSession?.clientProxy.stopSync()
userSession?.clientProxy.pauseSync()

backgroundTask?.stop()
backgroundTask = nil
Expand Down
36 changes: 18 additions & 18 deletions ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
case (.roomMemberDetails, .dismissRoomMemberDetails, .room):
break

case (.room, .presentMessageForwarding(let eventID), .messageForwarding):
presentMessageForwarding(for: eventID)
case (.room, .presentMessageForwarding(let itemID), .messageForwarding):
presentMessageForwarding(for: itemID)
case (.messageForwarding, .dismissMessageForwarding, .room):
break
case (.room, .presentMapNavigator(let mode), .mapNavigator):
Expand Down Expand Up @@ -401,14 +401,14 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
}
}

private func presentReportContent(for itemID: String, from senderID: String) {
guard let roomProxy else {
private func presentReportContent(for itemID: TimelineItemIdentifier, from senderID: String) {
guard let roomProxy, let eventID = itemID.eventID else {
fatalError()
}

let navigationCoordinator = NavigationStackCoordinator()
let userIndicatorController = UserIndicatorController(rootCoordinator: navigationCoordinator)
let parameters = ReportContentScreenCoordinatorParameters(itemID: itemID,
let parameters = ReportContentScreenCoordinatorParameters(eventID: eventID,
senderID: senderID,
roomProxy: roomProxy,
userIndicatorController: userIndicatorController)
Expand Down Expand Up @@ -479,17 +479,17 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
}
}

private func presentEmojiPicker(for itemId: String) {
private func presentEmojiPicker(for itemID: TimelineItemIdentifier) {
let params = EmojiPickerScreenCoordinatorParameters(emojiProvider: emojiProvider,
itemId: itemId)
itemID: itemID)
let coordinator = EmojiPickerScreenCoordinator(parameters: params)
coordinator.callback = { [weak self] action in
switch action {
case let .emojiSelected(emoji: emoji, itemId: itemId):
MXLog.debug("Selected \(emoji) for \(itemId)")
case let .emojiSelected(emoji: emoji, itemID: itemID):
MXLog.debug("Selected \(emoji) for \(itemID)")
self?.navigationStackCoordinator.setSheetCoordinator(nil)
Task {
await self?.timelineController?.toggleReaction(emoji, to: itemId)
await self?.timelineController?.toggleReaction(emoji, to: itemID)
}
case .dismiss:
self?.navigationStackCoordinator.setSheetCoordinator(nil)
Expand Down Expand Up @@ -547,8 +547,8 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
}
}

private func presentMessageForwarding(for eventID: String) {
guard let roomProxy, let roomSummaryProvider = userSession.clientProxy.roomSummaryProvider else {
private func presentMessageForwarding(for itemID: TimelineItemIdentifier) {
guard let roomProxy, let roomSummaryProvider = userSession.clientProxy.roomSummaryProvider, let eventID = itemID.eventID else {
fatalError()
}

Expand Down Expand Up @@ -624,14 +624,14 @@ private extension RoomFlowCoordinator {
enum State: StateType {
case initial
case room(roomID: String)
case reportContent(roomID: String, itemID: String, senderID: String)
case reportContent(roomID: String, itemID: TimelineItemIdentifier, senderID: String)
case roomDetails(roomID: String, isRoot: Bool)
case mediaUploadPicker(roomID: String, source: MediaPickerScreenSource)
case mediaUploadPreview(roomID: String, fileURL: URL)
case emojiPicker(roomID: String, itemID: String)
case emojiPicker(roomID: String, itemID: TimelineItemIdentifier)
case mapNavigator(roomID: String)
case roomMemberDetails(roomID: String, member: HashableRoomMemberWrapper)
case messageForwarding(roomID: String, itemID: String)
case messageForwarding(roomID: String, itemID: TimelineItemIdentifier)
}

struct EventUserInfo {
Expand All @@ -643,7 +643,7 @@ private extension RoomFlowCoordinator {
case presentRoom(roomID: String)
case dismissRoom

case presentReportContent(itemID: String, senderID: String)
case presentReportContent(itemID: TimelineItemIdentifier, senderID: String)
case dismissReportContent

case presentRoomDetails(roomID: String)
Expand All @@ -655,7 +655,7 @@ private extension RoomFlowCoordinator {
case presentMediaUploadPreview(fileURL: URL)
case dismissMediaUploadPreview

case presentEmojiPicker(itemID: String)
case presentEmojiPicker(itemID: TimelineItemIdentifier)
case dismissEmojiPicker

case presentMapNavigator(interactionMode: StaticLocationInteractionMode)
Expand All @@ -664,7 +664,7 @@ private extension RoomFlowCoordinator {
case presentRoomMemberDetails(member: HashableRoomMemberWrapper)
case dismissRoomMemberDetails

case presentMessageForwarding(itemID: String)
case presentMessageForwarding(itemID: TimelineItemIdentifier)
case dismissMessageForwarding
}
}
Expand Down
Loading

0 comments on commit 5a8bf5b

Please sign in to comment.