Skip to content

Commit 097a6dd

Browse files
Merge branch 'feature/offline-mode-branch'
2 parents ced14ab + 38ce107 commit 097a6dd

File tree

19 files changed

+375
-71
lines changed

19 files changed

+375
-71
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
33

44
# Upcoming
55

6+
### ✅ Added
7+
- Redacted loading view
8+
- Max file size checks
9+
- Inject custom footer view in Channel List
10+
- Config for disabling message overlay
11+
12+
### 🐞 Fixed
13+
- Prevent jumps when new messages are received
14+
- Orientation changes layout
15+
616
### 🔄 Changed
17+
- Method for creating custom avatar
718

819
# [4.11.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.11.0)
920
_March 02, 2022_

DemoAppSwiftUI/CreateGroupViewModel.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class CreateGroupViewModel: ObservableObject, ChatUserSearchControllerDelegate {
1919
}
2020

2121
@Published var state: NewChatState = .initial
22-
@Published var chatUsers = LazyCachedMapCollection<ChatUser>()
22+
@Published var chatUsers = [ChatUser]()
2323
@Published var selectedUsers = [ChatUser]()
2424
@Published var groupName = ""
2525
@Published var showGroupConversation = false
@@ -29,7 +29,7 @@ class CreateGroupViewModel: ObservableObject, ChatUserSearchControllerDelegate {
2929
private let lastSeenDateFormatter = DateUtils.timeAgo
3030

3131
init() {
32-
chatUsers = searchController.users
32+
chatUsers = searchController.userArray
3333
searchController.delegate = self
3434
// Empty initial search to get all users
3535
searchUsers(with: nil)
@@ -93,7 +93,7 @@ class CreateGroupViewModel: ObservableObject, ChatUserSearchControllerDelegate {
9393
_ controller: ChatUserSearchController,
9494
didChangeUsers changes: [ListChange<ChatUser>]
9595
) {
96-
chatUsers = controller.users
96+
chatUsers = controller.userArray
9797
}
9898

9999
// MARK: - private

DemoAppSwiftUI/NewChatViewModel.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class NewChatViewModel: ObservableObject, ChatUserSearchControllerDelegate {
1717
}
1818

1919
@Published var messageText: String = ""
20-
@Published var chatUsers = LazyCachedMapCollection<ChatUser>()
20+
@Published var chatUsers = [ChatUser]()
2121
@Published var state: NewChatState = .initial
2222
@Published var selectedUsers = [ChatUser]() {
2323
didSet {
@@ -50,7 +50,7 @@ class NewChatViewModel: ObservableObject, ChatUserSearchControllerDelegate {
5050
private let lastSeenDateFormatter = DateUtils.timeAgo
5151

5252
init() {
53-
chatUsers = searchController.users
53+
chatUsers = searchController.userArray
5454
searchController.delegate = self
5555
// Empty initial search to get all users
5656
searchUsers(with: nil)
@@ -100,7 +100,7 @@ class NewChatViewModel: ObservableObject, ChatUserSearchControllerDelegate {
100100
loadingNextUsers = true
101101
searchController.loadNextUsers(limit: 50) { [weak self] _ in
102102
guard let self = self else { return }
103-
self.chatUsers = self.searchController.users
103+
self.chatUsers = self.searchController.userArray
104104
self.loadingNextUsers = false
105105
}
106106
}
@@ -112,7 +112,7 @@ class NewChatViewModel: ObservableObject, ChatUserSearchControllerDelegate {
112112
_ controller: ChatUserSearchController,
113113
didChangeUsers changes: [ListChange<ChatUser>]
114114
) {
115-
chatUsers = controller.users
115+
chatUsers = controller.userArray
116116
}
117117

118118
// MARK: - private

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let package = Package(
1717
)
1818
],
1919
dependencies: [
20-
.package(url: "https://github.com/GetStream/stream-chat-swift.git", from: "4.11.0"),
20+
.package(url: "https://github.com/GetStream/stream-chat-swift.git", from: "4.12.0"),
2121
.package(url: "https://github.com/kean/Nuke.git", from: "10.0.0"),
2222
.package(url: "https://github.com/kean/NukeUI.git", from: "0.7.0")
2323
],

Sources/StreamChatSwiftUI/ChatChannel/Composer/Suggestions/Mentions/MentionsCommandHandler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public struct MentionsCommandHandler: CommandHandler {
158158
promise(.failure(error))
159159
return
160160
}
161-
let users = Array(userSearchController.users)
161+
let users = userSearchController.userArray
162162
let suggestionInfo = SuggestionInfo(key: id, value: users)
163163
promise(.success(suggestionInfo))
164164
}

StreamChatSwiftUI.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Pod::Spec.new do |spec|
1919

2020
spec.framework = "Foundation", "UIKit", "SwiftUI"
2121

22-
spec.dependency "StreamChat", "~> 4.11.0"
22+
spec.dependency "StreamChat", "~> 4.12.0"
2323
spec.dependency "Nuke", "~> 10.0"
2424
spec.dependency "SwiftyGif", "~> 5.0"
2525
spec.dependency "NukeUI", "~> 0.7.0"

StreamChatSwiftUI.xcodeproj/project.pbxproj

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@
162162
846608E7278C95E700D3D7B3 /* ChatChannelExtensions_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 846608E6278C95E700D3D7B3 /* ChatChannelExtensions_Tests.swift */; };
163163
846608E9278C98CB00D3D7B3 /* TypingIndicatorView_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 846608E8278C98CB00D3D7B3 /* TypingIndicatorView_Tests.swift */; };
164164
846D6564279FF0800094B36E /* ReactionUserView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 846D6563279FF0800094B36E /* ReactionUserView.swift */; };
165+
847BA08127E0B76400ED20C7 /* Spy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847BA08027E0B76400ED20C7 /* Spy.swift */; };
166+
847BA08327E0B9C600ED20C7 /* EventBatcherMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847BA08227E0B9C600ED20C7 /* EventBatcherMock.swift */; };
167+
847BA08527E0BA2500ED20C7 /* EventNotificationCenterMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847BA08427E0BA2500ED20C7 /* EventNotificationCenterMock.swift */; };
168+
847BA08727E0BACB00ED20C7 /* WebSocketPingControllerMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847BA08627E0BACB00ED20C7 /* WebSocketPingControllerMock.swift */; };
169+
847BA08927E0BAEE00ED20C7 /* WebSocketEngineMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847BA08827E0BAEE00ED20C7 /* WebSocketEngineMock.swift */; };
165170
847CEFEC27BFAB6400606257 /* StreamChat in Frameworks */ = {isa = PBXBuildFile; productRef = 847CEFEB27BFAB6400606257 /* StreamChat */; };
166171
847CEFEE27C38ABE00606257 /* MessageCachingUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847CEFED27C38ABE00606257 /* MessageCachingUtils.swift */; };
167172
848399EA275FB3E9003075E4 /* SnapshotTesting in Frameworks */ = {isa = PBXBuildFile; productRef = 848399E9275FB3E9003075E4 /* SnapshotTesting */; };
@@ -487,6 +492,11 @@
487492
846608E6278C95E700D3D7B3 /* ChatChannelExtensions_Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatChannelExtensions_Tests.swift; sourceTree = "<group>"; };
488493
846608E8278C98CB00D3D7B3 /* TypingIndicatorView_Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypingIndicatorView_Tests.swift; sourceTree = "<group>"; };
489494
846D6563279FF0800094B36E /* ReactionUserView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReactionUserView.swift; sourceTree = "<group>"; };
495+
847BA08027E0B76400ED20C7 /* Spy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Spy.swift; sourceTree = "<group>"; };
496+
847BA08227E0B9C600ED20C7 /* EventBatcherMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventBatcherMock.swift; sourceTree = "<group>"; };
497+
847BA08427E0BA2500ED20C7 /* EventNotificationCenterMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventNotificationCenterMock.swift; sourceTree = "<group>"; };
498+
847BA08627E0BACB00ED20C7 /* WebSocketPingControllerMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebSocketPingControllerMock.swift; sourceTree = "<group>"; };
499+
847BA08827E0BAEE00ED20C7 /* WebSocketEngineMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebSocketEngineMock.swift; sourceTree = "<group>"; };
490500
847CEFED27C38ABE00606257 /* MessageCachingUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageCachingUtils.swift; sourceTree = "<group>"; };
491501
848399EB275FB41B003075E4 /* ChatChannelListView_Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatChannelListView_Tests.swift; sourceTree = "<group>"; };
492502
848399F127601231003075E4 /* ReactionsOverlayView_Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReactionsOverlayView_Tests.swift; sourceTree = "<group>"; };
@@ -1047,6 +1057,7 @@
10471057
84C94CBB27578B92007FE2B9 /* NSManagedObject+ContextChange.swift */,
10481058
84C94CBC27578B92007FE2B9 /* DatabaseContainer_Mock.swift */,
10491059
84C94CCB27578B92007FE2B9 /* ChatClient_Mock.swift */,
1060+
847BA08027E0B76400ED20C7 /* Spy.swift */,
10501061
);
10511062
path = TestTools;
10521063
sourceTree = "<group>";
@@ -1160,6 +1171,10 @@
11601171
84C94D2B275796F7007FE2B9 /* RequestRecorderURLProtocol.swift */,
11611172
84C94D452757D1CA007FE2B9 /* ImageLoader_Mock.swift */,
11621173
84C94D5B275A2E9F007FE2B9 /* StreamChatUtilsMocks.swift */,
1174+
847BA08227E0B9C600ED20C7 /* EventBatcherMock.swift */,
1175+
847BA08427E0BA2500ED20C7 /* EventNotificationCenterMock.swift */,
1176+
847BA08627E0BACB00ED20C7 /* WebSocketPingControllerMock.swift */,
1177+
847BA08827E0BAEE00ED20C7 /* WebSocketEngineMock.swift */,
11631178
);
11641179
path = Mocks;
11651180
sourceTree = "<group>";
@@ -1600,6 +1615,8 @@
16001615
84C94D442757C704007FE2B9 /* MoreChannelActionsViewModel_Tests.swift in Sources */,
16011616
84C94D5127591DE2007FE2B9 /* ChatMessageIDs_Tests.swift in Sources */,
16021617
84C94CD727578B92007FE2B9 /* ChatMessageLinkAttachment_Mock.swift in Sources */,
1618+
847BA08327E0B9C600ED20C7 /* EventBatcherMock.swift in Sources */,
1619+
847BA08527E0BA2500ED20C7 /* EventNotificationCenterMock.swift in Sources */,
16031620
84C94D0527578BF2007FE2B9 /* TestRunnerEnvironment.swift in Sources */,
16041621
84E6EC23279AEE6B0017207B /* MessageContainerView_Tests.swift in Sources */,
16051622
84C94D68275A6AFD007FE2B9 /* ChannelHeaderLoader_Tests.swift in Sources */,
@@ -1612,11 +1629,13 @@
16121629
84C94CDB27578B92007FE2B9 /* NSManagedObject+ContextChange.swift in Sources */,
16131630
84C94D0C27578BF2007FE2B9 /* AssertJSONEqual.swift in Sources */,
16141631
84C94D62275A5BB7007FE2B9 /* ChatChannelNamer_Tests.swift in Sources */,
1632+
847BA08927E0BAEE00ED20C7 /* WebSocketEngineMock.swift in Sources */,
16151633
84C94D492758BE1C007FE2B9 /* ChatChannelViewModel_Tests.swift in Sources */,
16161634
84C94CE027578B92007FE2B9 /* CurrentUserPayload.swift in Sources */,
16171635
84C94CCD27578B92007FE2B9 /* ChannelUnreadCount_Mock.swift in Sources */,
16181636
84C94CDC27578B92007FE2B9 /* DatabaseContainer_Mock.swift in Sources */,
16191637
84C94D1727578BF3007FE2B9 /* XCTAssertEqual+Difference.swift in Sources */,
1638+
847BA08127E0B76400ED20C7 /* Spy.swift in Sources */,
16201639
84C94CE327578B92007FE2B9 /* XCTestCase+Dummy.swift in Sources */,
16211640
84C94D0D27578BF2007FE2B9 /* AssertResult.swift in Sources */,
16221641
84E6EC25279AEE9F0017207B /* StreamChatTestCase.swift in Sources */,
@@ -1658,6 +1677,7 @@
16581677
84C94CD127578B92007FE2B9 /* CurrentChatUser_Mock.swift in Sources */,
16591678
841B2EF6278F108700ED619E /* MessageReadIndicatorView_Tests.swift in Sources */,
16601679
84C94D0E27578BF2007FE2B9 /* AssertAsync.swift in Sources */,
1680+
847BA08727E0BACB00ED20C7 /* WebSocketPingControllerMock.swift in Sources */,
16611681
84C94D1327578BF2007FE2B9 /* XCTestCase+MockJSON.swift in Sources */,
16621682
84C94D5E275A3AA9007FE2B9 /* ImageCDN_Tests.swift in Sources */,
16631683
84C94CDF27578B92007FE2B9 /* MessagePayload.swift in Sources */,
@@ -2006,7 +2026,7 @@
20062026
CODE_SIGN_ENTITLEMENTS = DemoAppSwiftUI/DemoAppSwiftUI.entitlements;
20072027
CODE_SIGN_IDENTITY = "Apple Development";
20082028
CODE_SIGN_STYLE = Manual;
2009-
CURRENT_PROJECT_VERSION = 10;
2029+
CURRENT_PROJECT_VERSION = 12;
20102030
DEVELOPMENT_ASSET_PATHS = "\"DemoAppSwiftUI/Preview Content\"";
20112031
DEVELOPMENT_TEAM = EHV7XZLAHA;
20122032
ENABLE_PREVIEWS = YES;
@@ -2021,7 +2041,7 @@
20212041
"$(inherited)",
20222042
"@executable_path/Frameworks",
20232043
);
2024-
MARKETING_VERSION = 4.10.0;
2044+
MARKETING_VERSION = 4.12.0;
20252045
PRODUCT_BUNDLE_IDENTIFIER = io.getstream.iOS.DemoAppSwiftUI;
20262046
PRODUCT_NAME = "$(TARGET_NAME)";
20272047
PROVISIONING_PROFILE_SPECIFIER = "match Development io.getstream.iOS.DemoAppSwiftUI";
@@ -2040,7 +2060,7 @@
20402060
CODE_SIGN_ENTITLEMENTS = DemoAppSwiftUI/DemoAppSwiftUI.entitlements;
20412061
CODE_SIGN_IDENTITY = "Apple Distribution";
20422062
CODE_SIGN_STYLE = Manual;
2043-
CURRENT_PROJECT_VERSION = 10;
2063+
CURRENT_PROJECT_VERSION = 12;
20442064
DEVELOPMENT_ASSET_PATHS = "\"DemoAppSwiftUI/Preview Content\"";
20452065
DEVELOPMENT_TEAM = EHV7XZLAHA;
20462066
ENABLE_PREVIEWS = YES;
@@ -2055,7 +2075,7 @@
20552075
"$(inherited)",
20562076
"@executable_path/Frameworks",
20572077
);
2058-
MARKETING_VERSION = 4.10.0;
2078+
MARKETING_VERSION = 4.12.0;
20592079
PRODUCT_BUNDLE_IDENTIFIER = io.getstream.iOS.DemoAppSwiftUI;
20602080
PRODUCT_NAME = "$(TARGET_NAME)";
20612081
PROVISIONING_PROFILE_SPECIFIER = "match AppStore io.getstream.iOS.DemoAppSwiftUI";
@@ -2128,7 +2148,7 @@
21282148
repositoryURL = "https://github.com/GetStream/stream-chat-swift.git";
21292149
requirement = {
21302150
kind = upToNextMajorVersion;
2131-
minimumVersion = 4.11.0;
2151+
minimumVersion = 4.12.0;
21322152
};
21332153
};
21342154
848399E6275FB3BE003075E4 /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */ = {

StreamChatSwiftUI.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

StreamChatSwiftUITests/Infrastructure/Mocks/APIClient_Mock.swift

Lines changed: 45 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,24 @@ import Foundation
77
import XCTest
88

99
/// Mock implementation of APIClient allowing easy control and simulation of responses.
10-
class APIClientMock: APIClient {
11-
@Atomic var request_allRecordedCalls: [(endpoint: AnyEndpoint, completion: Any?)] = []
12-
10+
class APIClientMock: APIClient, Spy {
11+
var recordedFunctions: [String] = []
12+
1313
/// The last endpoint `request` function was called with.
1414
@Atomic var request_endpoint: AnyEndpoint?
1515
@Atomic var request_completion: Any?
16+
@Atomic var request_allRecordedCalls: [(endpoint: AnyEndpoint, completion: Any?)] = []
17+
18+
/// The last endpoint `recoveryRequest` function was called with.
19+
@Atomic var recoveryRequest_endpoint: AnyEndpoint?
20+
@Atomic var recoveryRequest_completion: Any?
21+
@Atomic var recoveryRequest_allRecordedCalls: [(endpoint: AnyEndpoint, completion: Any?)] = []
1622

1723
/// The last endpoint `uploadFile` function was called with.
1824
@Atomic var uploadFile_attachment: AnyChatMessageAttachment?
1925
@Atomic var uploadFile_progress: ((Double) -> Void)?
2026
@Atomic var uploadFile_completion: ((Result<URL, Error>) -> Void)?
2127

22-
/// The last params `flushRequestsQueue` function was called with.
23-
@Atomic var flushRequestsQueue_timeout: TimeInterval?
24-
@Atomic var flushRequestsQueue_itemAction: ((APIClient.RequestsQueueItem) -> Void)?
25-
2628
@Atomic var init_sessionConfiguration: URLSessionConfiguration
2729
@Atomic var init_requestEncoder: RequestEncoder
2830
@Atomic var init_requestDecoder: RequestDecoder
@@ -39,17 +41,15 @@ class APIClientMock: APIClient {
3941
uploadFile_attachment = nil
4042
uploadFile_progress = nil
4143
uploadFile_completion = nil
42-
43-
flushRequestsQueue_timeout = nil
44-
flushRequestsQueue_itemAction = nil
4544
}
46-
45+
4746
override init(
4847
sessionConfiguration: URLSessionConfiguration,
4948
requestEncoder: RequestEncoder,
5049
requestDecoder: RequestDecoder,
5150
CDNClient: CDNClient,
52-
tokenRefresher: ((ClientError, @escaping () -> Void) -> Void)!
51+
tokenRefresher: ((@escaping () -> Void) -> Void)!,
52+
queueOfflineRequest: @escaping QueueOfflineRequestBlock
5353
) {
5454
init_sessionConfiguration = sessionConfiguration
5555
init_requestEncoder = requestEncoder
@@ -62,26 +62,40 @@ class APIClientMock: APIClient {
6262
requestEncoder: requestEncoder,
6363
requestDecoder: requestDecoder,
6464
CDNClient: CDNClient,
65-
tokenRefresher: tokenRefresher
65+
tokenRefresher: tokenRefresher,
66+
queueOfflineRequest: queueOfflineRequest
6667
)
6768
}
6869

6970
/// Simulates the response of the last `request` method call
7071
func test_simulateResponse<Response: Decodable>(_ response: Result<Response, Error>) {
71-
let completion = request_completion as! ((Result<Response, Error>) -> Void)
72-
completion(response)
72+
let completion = request_completion as? ((Result<Response, Error>) -> Void)
73+
completion?(response)
74+
}
75+
76+
func test_simulateRecoveryResponse<Response: Decodable>(_ response: Result<Response, Error>) {
77+
let completion = recoveryRequest_completion as? ((Result<Response, Error>) -> Void)
78+
completion?(response)
7379
}
7480

7581
override func request<Response>(
7682
endpoint: Endpoint<Response>,
77-
timeout: TimeInterval,
7883
completion: @escaping (Result<Response, Error>) -> Void
7984
) where Response: Decodable {
8085
request_endpoint = AnyEndpoint(endpoint)
8186
request_completion = completion
8287
_request_allRecordedCalls.mutate { $0.append((request_endpoint!, request_completion!)) }
8388
request_expectation.fulfill()
8489
}
90+
91+
override func recoveryRequest<Response>(
92+
endpoint: Endpoint<Response>,
93+
completion: @escaping (Result<Response, Error>) -> Void
94+
) where Response: Decodable {
95+
recoveryRequest_endpoint = AnyEndpoint(endpoint)
96+
recoveryRequest_completion = completion
97+
_recoveryRequest_allRecordedCalls.mutate { $0.append((recoveryRequest_endpoint!, recoveryRequest_completion!)) }
98+
}
8599

86100
override func uploadAttachment(
87101
_ attachment: AnyChatMessageAttachment,
@@ -92,20 +106,26 @@ class APIClientMock: APIClient {
92106
uploadFile_progress = progress
93107
uploadFile_completion = completion
94108
}
95-
96-
override func flushRequestsQueue(
97-
after timeout: TimeInterval = 0,
98-
itemAction: ((APIClient.RequestsQueueItem) -> Void)? = nil
99-
) {
100-
flushRequestsQueue_timeout = timeout
101-
flushRequestsQueue_itemAction = itemAction
109+
110+
override func flushRequestsQueue() {
111+
record()
102112
}
103113

104114
@discardableResult
105115
func waitForRequest(timeout: Double = 0.5) -> AnyEndpoint? {
106116
XCTWaiter().wait(for: [request_expectation], timeout: timeout)
107117
return request_endpoint
108118
}
119+
120+
override func enterRecoveryMode() {
121+
record()
122+
super.enterRecoveryMode()
123+
}
124+
125+
override func exitRecoveryMode() {
126+
record()
127+
super.exitRecoveryMode()
128+
}
109129
}
110130

111131
extension APIClientMock {
@@ -115,7 +135,8 @@ extension APIClientMock {
115135
requestEncoder: DefaultRequestEncoder(baseURL: .unique(), apiKey: .init(.unique)),
116136
requestDecoder: DefaultRequestDecoder(),
117137
CDNClient: CDNClient_Mock(),
118-
tokenRefresher: { _, _ in }
138+
tokenRefresher: { _ in },
139+
queueOfflineRequest: { _ in }
119140
)
120141
}
121142
}

StreamChatSwiftUITests/Infrastructure/Mocks/AnyEndpoint.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Foundation
66
@testable import StreamChat
77

88
struct AnyEndpoint: Equatable {
9-
let path: String
9+
let path: EndpointPath
1010
let method: EndpointMethod
1111
let queryItems: AnyEncodable?
1212
let requiresConnectionId: Bool
@@ -23,7 +23,7 @@ struct AnyEndpoint: Equatable {
2323
}
2424

2525
static func == (lhs: AnyEndpoint, rhs: AnyEndpoint) -> Bool {
26-
lhs.path == rhs.path
26+
lhs.path.value == rhs.path.value
2727
&& lhs.method == rhs.method
2828
&& lhs.queryItems == rhs.queryItems
2929
&& lhs.requiresConnectionId == rhs.requiresConnectionId

0 commit comments

Comments
 (0)