diff --git a/RiotSwiftUI/Modules/Room/PollHistory/PollHistoryViewModel.swift b/RiotSwiftUI/Modules/Room/PollHistory/PollHistoryViewModel.swift index 02d1d853a..773a012fb 100644 --- a/RiotSwiftUI/Modules/Room/PollHistory/PollHistoryViewModel.swift +++ b/RiotSwiftUI/Modules/Room/PollHistory/PollHistoryViewModel.swift @@ -73,7 +73,7 @@ private extension PollHistoryViewModel { .store(in: &subcriptions) pollService - .updatesErrors + .pollErrors .sink { detail in #warning("Handle errors") } diff --git a/RiotSwiftUI/Modules/Room/PollHistory/Service/MatrixSDK/PollHistoryService.swift b/RiotSwiftUI/Modules/Room/PollHistory/Service/MatrixSDK/PollHistoryService.swift index 6a7499248..0d4a5db09 100644 --- a/RiotSwiftUI/Modules/Room/PollHistory/Service/MatrixSDK/PollHistoryService.swift +++ b/RiotSwiftUI/Modules/Room/PollHistory/Service/MatrixSDK/PollHistoryService.swift @@ -36,7 +36,7 @@ final class PollHistoryService: PollHistoryServiceProtocol { updatesSubject.eraseToAnyPublisher() } - var updatesErrors: AnyPublisher { + var pollErrors: AnyPublisher { updatesErrorsSubject.eraseToAnyPublisher() } diff --git a/RiotSwiftUI/Modules/Room/PollHistory/Service/Mock/MockPollHistoryService.swift b/RiotSwiftUI/Modules/Room/PollHistory/Service/Mock/MockPollHistoryService.swift index 7f412b94e..9cfa8da3b 100644 --- a/RiotSwiftUI/Modules/Room/PollHistory/Service/Mock/MockPollHistoryService.swift +++ b/RiotSwiftUI/Modules/Room/PollHistory/Service/Mock/MockPollHistoryService.swift @@ -22,9 +22,9 @@ final class MockPollHistoryService: PollHistoryServiceProtocol { updatesPublisher } - var updatesErrorsPublisher: AnyPublisher = Empty().eraseToAnyPublisher() - var updatesErrors: AnyPublisher { - updatesErrorsPublisher + var pollErrorPublisher: AnyPublisher = Empty().eraseToAnyPublisher() + var pollErrors: AnyPublisher { + pollErrorPublisher } lazy var nextPublisher: AnyPublisher = (activePollsData + pastPollsData) diff --git a/RiotSwiftUI/Modules/Room/PollHistory/Service/PollHistoryServiceProtocol.swift b/RiotSwiftUI/Modules/Room/PollHistory/Service/PollHistoryServiceProtocol.swift index bec8dbe53..3458c3d64 100644 --- a/RiotSwiftUI/Modules/Room/PollHistory/Service/PollHistoryServiceProtocol.swift +++ b/RiotSwiftUI/Modules/Room/PollHistory/Service/PollHistoryServiceProtocol.swift @@ -17,8 +17,14 @@ import Combine protocol PollHistoryServiceProtocol { - var updates: AnyPublisher { get } - var updatesErrors: AnyPublisher { get } - + /// Returns a Publisher publishing the polls in the next batch. + /// Implementations should return the same publisher if `next()` is called again before the previous publisher completes. func next() -> AnyPublisher + + /// Publishes updates for the polls previously pusblished by the `next()` publishers. + var updates: AnyPublisher { get } + + /// Publishes errors regarding poll aggregations. + /// Note: `next()` will continue to publish new polls even if some poll isn't being aggregated correctly. + var pollErrors: AnyPublisher { get } }