Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch poll history (PSG-1043) #7293

Merged
merged 36 commits into from
Jan 24, 2023
Merged

Conversation

alfogrillo
Copy link
Contributor

Description

This PR adds the logic to fetch the polls history in a given room.
The goal is to show polls for the last 30 days in the room.
The already available sdk objects MXRoomEventTimeline and PollAggregator have been used to fetch the polls.

Dependency

matrix-org/matrix-ios-sdk#1691

Result

poc

@alfogrillo alfogrillo requested review from a team and pixlwave and removed request for a team January 23, 2023 15:09
@codecov
Copy link

codecov bot commented Jan 23, 2023

Codecov Report

Base: 11.79% // Head: 11.98% // Increases project coverage by +0.18% 🎉

Coverage data is based on head (22b397e) compared to base (19320c2).
Patch coverage: 49.58% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7293      +/-   ##
===========================================
+ Coverage    11.79%   11.98%   +0.18%     
===========================================
  Files         1638     1634       -4     
  Lines       161160   161354     +194     
  Branches     65877    66021     +144     
===========================================
+ Hits         19010    19333     +323     
+ Misses      141503   141377     -126     
+ Partials       647      644       -3     
Flag Coverage Δ
uitests 55.31% <73.46%> (+0.40%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ot/Modules/Room/RoomInfo/RoomInfoCoordinator.swift 0.00% <0.00%> (ø)
...llHistory/Coordinator/PollHistoryCoordinator.swift 0.00% <0.00%> (ø)
...I/Modules/Room/PollHistory/PollHistoryModels.swift 100.00% <ø> (+100.00%) ⬆️
...History/Service/MatrixSDK/PollHistoryService.swift 0.00% <0.00%> (ø)
...linePoll/Coordinator/TimelinePollCoordinator.swift 0.00% <0.00%> (ø)
...I/Modules/Room/PollHistory/View/PollListItem.swift 33.56% <19.23%> (+33.56%) ⬆️
...odules/Room/PollHistory/PollHistoryViewModel.swift 80.00% <77.96%> (+80.00%) ⬆️
...linePoll/View/TimelinePollAnswerOptionButton.swift 51.96% <80.00%> (-1.76%) ⬇️
...UI/Modules/Room/PollHistory/View/PollHistory.swift 79.66% <88.13%> (+79.66%) ⬆️
.../Room/PollHistory/MockPollHistoryScreenState.swift 100.00% <100.00%> (+100.00%) ⬆️
... and 31 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@pixlwave pixlwave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! This feature is looking good 😎

Some minor comments inline for you :)

Comment on lines 25 to 29
var updates: AnyPublisher<TimelinePollDetails, Never> { 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<Error, Never> { get }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe in most of places we suffix publisher properties with Publisher. Can't say I'm particularly fussed about it, but might be nice for consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this practice adds value to our codebase. On the contrary increase verbosity.
It would be like suffixing "sequence" every time you have an array (or another Sequence) property.
Also Apple seems not to do that here. 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep yep, seeing it in this PR I do agree, the call site looks way nicer without the suffix.

@alfogrillo alfogrillo force-pushed the alfogrillo/fetch_poll_history branch from d0196d7 to 11f605b Compare January 24, 2023 09:48
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@alfogrillo alfogrillo merged commit 82d2ad8 into develop Jan 24, 2023
@alfogrillo alfogrillo deleted the alfogrillo/fetch_poll_history branch January 24, 2023 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants