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

View File

@ -111,8 +111,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/matrix-org/matrix-rust-components-swift",
"state" : {
"revision" : "15c314fcb20e3b009b573a50edc4736a73e63c96",
"version" : "1.0.59-alpha"
"revision" : "6c11b548074f4bfedfe73a9724d7d8d1709b0ede",
"version" : "1.0.60-alpha"
}
},
{

View File

@ -362,39 +362,34 @@ class ClientProxy: ClientProxyProtocol {
fatalError("This shouldn't be called more than once")
}
do {
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
.requiredState(requiredState: slidingSyncRequiredState)
.filters(filters: slidingSyncFilters)
.name(name: "CurrentlyVisibleRooms")
.syncMode(mode: .selective)
.addRange(from: 0, to: 20)
.build()
let visibleRoomsViewProxy = SlidingSyncViewProxy(slidingSyncView: visibleRoomsSlidingSyncView, name: "Visible rooms")
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
self?.restartSync()
let visibleRoomsSlidingSyncView = SlidingSyncListBuilder(name: "CurrentlyVisibleRooms")
.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)
.filters(filters: slidingSyncFilters)
.syncMode(mode: .selective)
.addRange(from: 0, to: 20)
.build()
let visibleRoomsViewProxy = SlidingSyncViewProxy(slidingSyncView: visibleRoomsSlidingSyncView, name: "Visible rooms")
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
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)
// 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
}
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)")
MXLog.info("Visible rooms view received first update, configuring views post initial sync")
self?.configureViewsPostInitialSync()
self?.visibleRoomsViewProxyStateObservationToken = nil
}
}
@ -403,22 +398,16 @@ class ClientProxy: ClientProxyProtocol {
fatalError("This shouldn't be called more than once")
}
do {
let allRoomsSlidingSyncView = try SlidingSyncListBuilder()
.noTimelineLimit()
.requiredState(requiredState: slidingSyncRequiredState)
.filters(filters: slidingSyncFilters)
.name(name: "AllRooms")
.syncMode(mode: .growing)
.batchSize(batchSize: 100)
.build()
self.allRoomsSlidingSyncView = allRoomsSlidingSyncView
allRoomsViewProxy = SlidingSyncViewProxy(slidingSyncView: allRoomsSlidingSyncView, name: "All rooms")
} catch {
MXLog.error("Failed building the all rooms sliding sync view with error: \(error)")
}
let allRoomsSlidingSyncView = SlidingSyncListBuilder(name: "AllRooms")
.noTimelineLimit()
.requiredState(requiredState: slidingSyncRequiredState)
.filters(filters: slidingSyncFilters)
.syncMode(mode: .growing)
.batchSize(batchSize: 100)
.build()
self.allRoomsSlidingSyncView = allRoomsSlidingSyncView
allRoomsViewProxy = SlidingSyncViewProxy(slidingSyncView: allRoomsSlidingSyncView, name: "All rooms")
}
private func buildAndConfigureInvitesSlidingSyncView() {
@ -426,21 +415,16 @@ class ClientProxy: ClientProxyProtocol {
fatalError("This shouldn't be called more than once")
}
do {
let invitesView = try SlidingSyncListBuilder()
.noTimelineLimit()
.requiredState(requiredState: slidingSyncInvitesRequiredState)
.filters(filters: slidingSyncInviteFilters)
.name(name: "Invites")
.syncMode(mode: .growing)
.batchSize(batchSize: 100)
.build()
invitesSlidingSyncView = invitesView
invitesViewProxy = SlidingSyncViewProxy(slidingSyncView: invitesView, name: "Invites")
} catch {
MXLog.error("Failed building the invites sliding sync view with error: \(error)")
}
let invitesView = SlidingSyncListBuilder(name: "Invites")
.noTimelineLimit()
.requiredState(requiredState: slidingSyncInvitesRequiredState)
.filters(filters: slidingSyncInviteFilters)
.syncMode(mode: .growing)
.batchSize(batchSize: 100)
.build()
invitesSlidingSyncView = invitesView
invitesViewProxy = SlidingSyncViewProxy(slidingSyncView: invitesView, name: "Invites")
}
private func buildAndConfigureNotificationSyncView() {
@ -448,20 +432,15 @@ class ClientProxy: ClientProxyProtocol {
fatalError("This shouldn't be called more than once")
}
do {
let notificationsSlidingSyncView = try SlidingSyncListBuilder()
.noTimelineLimit()
.requiredState(requiredState: slidingSyncNotificationsRequiredState)
.filters(filters: slidingSyncNotificationsFilters)
.name(name: "Notifications")
.syncMode(mode: .growing)
.batchSize(batchSize: 100)
.build()
let notificationsSlidingSyncView = SlidingSyncListBuilder(name: "Notifications")
.noTimelineLimit()
.requiredState(requiredState: slidingSyncNotificationsRequiredState)
.filters(filters: slidingSyncNotificationsFilters)
.syncMode(mode: .growing)
.batchSize(batchSize: 100)
.build()
self.notificationsSlidingSyncView = notificationsSlidingSyncView
} catch {
MXLog.error("Failed building the notification sliding sync view with error: \(error)")
}
self.notificationsSlidingSyncView = notificationsSlidingSyncView
}
private func buildRoomSummaryProviders() {

View File

@ -146,4 +146,8 @@ private class MockMediaLoadingClient: ClientProtocol {
func searchUsers(searchTerm: String, limit: UInt64) throws -> MatrixRustSDK.SearchUsersResults { fatalError() }
func setNotificationDelegate(notificationDelegate: MatrixRustSDK.NotificationDelegate?) { }
func getNotificationItem(roomId: String, eventId: String) throws -> MatrixRustSDK.NotificationItem {
fatalError()
}
}

View File

@ -42,7 +42,7 @@ include:
packages:
MatrixRustSDK:
url: https://github.com/matrix-org/matrix-rust-components-swift
exactVersion: 1.0.59-alpha
exactVersion: 1.0.60-alpha
# path: ../matrix-rust-sdk
DesignKit:
path: DesignKit