Bump SDK version and fix breaking changes. (#709)

This commit is contained in:
Doug
2023-03-20 18:26:07 +00:00
committed by GitHub
parent efdb47a98a
commit 66651c0f34
8 changed files with 23 additions and 22 deletions
@@ -95,8 +95,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" : "6e9c8b7f0f68fd8e617e9d6c1ad902736899557a", "revision" : "cc68dbd95a35a481a7398e7cc324e26917fd4022",
"version" : "1.0.46-alpha" "version" : "1.0.47-alpha"
} }
}, },
{ {
@@ -72,8 +72,8 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
.sink { [weak self] roomSummaryProviderState, totalCount, rooms in .sink { [weak self] roomSummaryProviderState, totalCount, rooms in
guard let self else { return } guard let self else { return }
let isLoadingData = roomSummaryProviderState != .live && (totalCount == 0 || rooms.count != totalCount) let isLoadingData = roomSummaryProviderState != .fullyLoaded && (totalCount == 0 || rooms.count != totalCount)
let hasNoRooms = roomSummaryProviderState == .live && totalCount == 0 let hasNoRooms = roomSummaryProviderState == .fullyLoaded && totalCount == 0
var roomListMode = self.state.roomListMode var roomListMode = self.state.roomListMode
if isLoadingData { if isLoadingData {
@@ -269,7 +269,7 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
} }
private func updateVisibleRange(_ range: Range<Int>, timelineLimit: UInt) { private func updateVisibleRange(_ range: Range<Int>, timelineLimit: UInt) {
guard visibleRoomsSummaryProvider?.statePublisher.value == .live, guard visibleRoomsSummaryProvider?.statePublisher.value == .fullyLoaded,
!range.isEmpty else { return } !range.isEmpty else { return }
guard let visibleRoomsSummaryProvider else { guard let visibleRoomsSummaryProvider else {
@@ -23,7 +23,7 @@ private class SlidingSyncViewObserver: SlidingSyncListRoomListObserver, SlidingS
let roomListDiffPublisher = PassthroughSubject<SlidingSyncListRoomsListDiff, Never>() let roomListDiffPublisher = PassthroughSubject<SlidingSyncListRoomsListDiff, Never>()
/// Publishes the current state of sliding sync, such as whether its catching up or live. /// Publishes the current state of sliding sync, such as whether its catching up or live.
let stateUpdatePublisher = CurrentValueSubject<SlidingSyncState, Never>(.cold) let stateUpdatePublisher = CurrentValueSubject<SlidingSyncState, Never>(.fullyLoaded)
/// Publishes the number of available rooms /// Publishes the number of available rooms
let countUpdatePublisher = CurrentValueSubject<UInt, Never>(0) let countUpdatePublisher = CurrentValueSubject<UInt, Never>(0)
@@ -35,11 +35,11 @@ class MockRoomSummaryProvider: RoomSummaryProviderProtocol {
switch state { switch state {
case .loading: case .loading:
roomListPublisher = .init([]) roomListPublisher = .init([])
statePublisher = .init(.cold) statePublisher = .init(.notLoaded)
countPublisher = .init(0) countPublisher = .init(0)
case .loaded: case .loaded:
roomListPublisher = .init(Self.rooms) roomListPublisher = .init(Self.rooms)
statePublisher = .init(.live) statePublisher = .init(.fullyLoaded)
countPublisher = .init(UInt(Self.rooms.count)) countPublisher = .init(UInt(Self.rooms.count))
} }
} }
@@ -26,7 +26,7 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
private var cancellables = Set<AnyCancellable>() private var cancellables = Set<AnyCancellable>()
let roomListPublisher = CurrentValueSubject<[RoomSummary], Never>([]) let roomListPublisher = CurrentValueSubject<[RoomSummary], Never>([])
let statePublisher = CurrentValueSubject<RoomSummaryProviderState, Never>(.cold) let statePublisher = CurrentValueSubject<RoomSummaryProviderState, Never>(.notLoaded)
let countPublisher = CurrentValueSubject<UInt, Never>(0) let countPublisher = CurrentValueSubject<UInt, Never>(0)
private var rooms: [RoomSummary] = [] { private var rooms: [RoomSummary] = [] {
@@ -220,14 +220,14 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
extension RoomSummaryProviderState { extension RoomSummaryProviderState {
init(slidingSyncState: SlidingSyncState) { init(slidingSyncState: SlidingSyncState) {
switch slidingSyncState { switch slidingSyncState {
case .cold: case .notLoaded:
self = .cold self = .notLoaded
case .preload: case .preloaded:
self = .preload self = .preloaded
case .catchingUp: case .partiallyLoaded:
self = .catchingUp self = .partiallyLoaded
case .live: case .fullyLoaded:
self = .live self = .fullyLoaded
} }
} }
} }
@@ -19,10 +19,10 @@ import Foundation
import MatrixRustSDK import MatrixRustSDK
enum RoomSummaryProviderState { enum RoomSummaryProviderState {
case cold case notLoaded
case preload case preloaded
case catchingUp case partiallyLoaded
case live case fullyLoaded
} }
enum RoomSummary: CustomStringConvertible { enum RoomSummary: CustomStringConvertible {
+1
View File
@@ -0,0 +1 @@
Bump SDK version and fix breaking changes.
+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.46-alpha exactVersion: 1.0.47-alpha
# path: ../matrix-rust-sdk # path: ../matrix-rust-sdk
DesignKit: DesignKit:
path: DesignKit path: DesignKit