sdk bump to 1.0.60

This commit is contained in:
Mauro Romito
2023-05-05 15:30:03 +02:00
committed by Mauro
parent 93e3a1a80b
commit b17c987fd0
4 changed files with 62 additions and 79 deletions
@@ -111,8 +111,8 @@
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
"location" : "https://github.com/matrix-org/matrix-rust-components-swift", "location" : "https://github.com/matrix-org/matrix-rust-components-swift",
"state" : { "state" : {
"revision" : "15c314fcb20e3b009b573a50edc4736a73e63c96", "revision" : "6c11b548074f4bfedfe73a9724d7d8d1709b0ede",
"version" : "1.0.59-alpha" "version" : "1.0.60-alpha"
} }
}, },
{ {
@@ -362,39 +362,34 @@ class ClientProxy: ClientProxyProtocol {
fatalError("This shouldn't be called more than once") fatalError("This shouldn't be called more than once")
} }
do { let visibleRoomsSlidingSyncView = SlidingSyncListBuilder(name: "CurrentlyVisibleRooms")
let visibleRoomsSlidingSyncView = try SlidingSyncListBuilder() .timelineLimit(limit: UInt32(SlidingSyncConstants.initialTimelineLimit)) // Starts off with zero to quickly load rooms, then goes to 1 while scrolling to quickly load last messages and 20 when the scrolling stops to load room history
.timelineLimit(limit: UInt32(SlidingSyncConstants.initialTimelineLimit)) // Starts off with zero to quickly load rooms, then goes to 1 while scrolling to quickly load last messages and 20 when the scrolling stops to load room history .requiredState(requiredState: slidingSyncRequiredState)
.requiredState(requiredState: slidingSyncRequiredState) .filters(filters: slidingSyncFilters)
.filters(filters: slidingSyncFilters) .syncMode(mode: .selective)
.name(name: "CurrentlyVisibleRooms") .addRange(from: 0, to: 20)
.syncMode(mode: .selective) .build()
.addRange(from: 0, to: 20)
.build() let visibleRoomsViewProxy = SlidingSyncViewProxy(slidingSyncView: visibleRoomsSlidingSyncView, name: "Visible rooms")
let visibleRoomsViewProxy = SlidingSyncViewProxy(slidingSyncView: visibleRoomsSlidingSyncView, name: "Visible rooms") self.visibleRoomsSlidingSyncView = visibleRoomsSlidingSyncView
self.visibleRoomsViewProxy = visibleRoomsViewProxy
self.visibleRoomsSlidingSyncView = visibleRoomsSlidingSyncView
self.visibleRoomsViewProxy = visibleRoomsViewProxy // Changes to the visibleRoomsSlidingSyncView range need to restart the connection to be applied
visibleRoomsViewProxy.visibleRangeUpdatePublisher.sink { [weak self] in
// Changes to the visibleRoomsSlidingSyncView range need to restart the connection to be applied self?.restartSync()
visibleRoomsViewProxy.visibleRangeUpdatePublisher.sink { [weak self] in }
self?.restartSync() .store(in: &cancellables)
// The allRoomsSlidingSyncView will be registered as soon as the visibleRoomsSlidingSyncView receives its first update
visibleRoomsViewProxyStateObservationToken = visibleRoomsViewProxy.statePublisher.sink { [weak self] state in
guard state == .fullyLoaded else {
return
} }
.store(in: &cancellables)
MXLog.info("Visible rooms view received first update, configuring views post initial sync")
// The allRoomsSlidingSyncView will be registered as soon as the visibleRoomsSlidingSyncView receives its first update self?.configureViewsPostInitialSync()
visibleRoomsViewProxyStateObservationToken = visibleRoomsViewProxy.statePublisher.sink { [weak self] state in self?.visibleRoomsViewProxyStateObservationToken = nil
guard state == .fullyLoaded else {
return
}
MXLog.info("Visible rooms view received first update, configuring views post initial sync")
self?.configureViewsPostInitialSync()
self?.visibleRoomsViewProxyStateObservationToken = nil
}
} catch {
MXLog.error("Failed building the visible rooms sliding sync view with error: \(error)")
} }
} }
@@ -403,22 +398,16 @@ class ClientProxy: ClientProxyProtocol {
fatalError("This shouldn't be called more than once") fatalError("This shouldn't be called more than once")
} }
do { let allRoomsSlidingSyncView = SlidingSyncListBuilder(name: "AllRooms")
let allRoomsSlidingSyncView = try SlidingSyncListBuilder() .noTimelineLimit()
.noTimelineLimit() .requiredState(requiredState: slidingSyncRequiredState)
.requiredState(requiredState: slidingSyncRequiredState) .filters(filters: slidingSyncFilters)
.filters(filters: slidingSyncFilters) .syncMode(mode: .growing)
.name(name: "AllRooms") .batchSize(batchSize: 100)
.syncMode(mode: .growing) .build()
.batchSize(batchSize: 100)
.build() self.allRoomsSlidingSyncView = allRoomsSlidingSyncView
allRoomsViewProxy = SlidingSyncViewProxy(slidingSyncView: allRoomsSlidingSyncView, name: "All rooms")
self.allRoomsSlidingSyncView = allRoomsSlidingSyncView
allRoomsViewProxy = SlidingSyncViewProxy(slidingSyncView: allRoomsSlidingSyncView, name: "All rooms")
} catch {
MXLog.error("Failed building the all rooms sliding sync view with error: \(error)")
}
} }
private func buildAndConfigureInvitesSlidingSyncView() { private func buildAndConfigureInvitesSlidingSyncView() {
@@ -426,21 +415,16 @@ class ClientProxy: ClientProxyProtocol {
fatalError("This shouldn't be called more than once") fatalError("This shouldn't be called more than once")
} }
do { let invitesView = SlidingSyncListBuilder(name: "Invites")
let invitesView = try SlidingSyncListBuilder() .noTimelineLimit()
.noTimelineLimit() .requiredState(requiredState: slidingSyncInvitesRequiredState)
.requiredState(requiredState: slidingSyncInvitesRequiredState) .filters(filters: slidingSyncInviteFilters)
.filters(filters: slidingSyncInviteFilters) .syncMode(mode: .growing)
.name(name: "Invites") .batchSize(batchSize: 100)
.syncMode(mode: .growing) .build()
.batchSize(batchSize: 100)
.build() invitesSlidingSyncView = invitesView
invitesViewProxy = SlidingSyncViewProxy(slidingSyncView: invitesView, name: "Invites")
invitesSlidingSyncView = invitesView
invitesViewProxy = SlidingSyncViewProxy(slidingSyncView: invitesView, name: "Invites")
} catch {
MXLog.error("Failed building the invites sliding sync view with error: \(error)")
}
} }
private func buildAndConfigureNotificationSyncView() { private func buildAndConfigureNotificationSyncView() {
@@ -448,20 +432,15 @@ class ClientProxy: ClientProxyProtocol {
fatalError("This shouldn't be called more than once") fatalError("This shouldn't be called more than once")
} }
do { let notificationsSlidingSyncView = SlidingSyncListBuilder(name: "Notifications")
let notificationsSlidingSyncView = try SlidingSyncListBuilder() .noTimelineLimit()
.noTimelineLimit() .requiredState(requiredState: slidingSyncNotificationsRequiredState)
.requiredState(requiredState: slidingSyncNotificationsRequiredState) .filters(filters: slidingSyncNotificationsFilters)
.filters(filters: slidingSyncNotificationsFilters) .syncMode(mode: .growing)
.name(name: "Notifications") .batchSize(batchSize: 100)
.syncMode(mode: .growing) .build()
.batchSize(batchSize: 100)
.build()
self.notificationsSlidingSyncView = notificationsSlidingSyncView self.notificationsSlidingSyncView = notificationsSlidingSyncView
} catch {
MXLog.error("Failed building the notification sliding sync view with error: \(error)")
}
} }
private func buildRoomSummaryProviders() { private func buildRoomSummaryProviders() {
@@ -146,4 +146,8 @@ private class MockMediaLoadingClient: ClientProtocol {
func searchUsers(searchTerm: String, limit: UInt64) throws -> MatrixRustSDK.SearchUsersResults { fatalError() } func searchUsers(searchTerm: String, limit: UInt64) throws -> MatrixRustSDK.SearchUsersResults { fatalError() }
func setNotificationDelegate(notificationDelegate: MatrixRustSDK.NotificationDelegate?) { } func setNotificationDelegate(notificationDelegate: MatrixRustSDK.NotificationDelegate?) { }
func getNotificationItem(roomId: String, eventId: String) throws -> MatrixRustSDK.NotificationItem {
fatalError()
}
} }
+1 -1
View File
@@ -42,7 +42,7 @@ include:
packages: packages:
MatrixRustSDK: MatrixRustSDK:
url: https://github.com/matrix-org/matrix-rust-components-swift url: https://github.com/matrix-org/matrix-rust-components-swift
exactVersion: 1.0.59-alpha exactVersion: 1.0.60-alpha
# path: ../matrix-rust-sdk # path: ../matrix-rust-sdk
DesignKit: DesignKit:
path: DesignKit path: DesignKit