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

[CIS-295] Channels pagination #438

Merged
merged 2 commits into from Aug 27, 2020
Merged

[CIS-295] Channels pagination #438

merged 2 commits into from Aug 27, 2020

Conversation

mantergo
Copy link
Contributor

In this PR:

  • Implement channels pagination in ChannelListController
  • Make use of pagination in SampleApp

Q: I’m not doing any checks for empty channels in loadNextChannels function cause it’s not an issue to have 0 offset. But there is a possibility that this function will be called successfully before startUpdating call. (channels has empty array as fallback value) If we want to restrict this we can check for controller state but I’m not sure if we should do that.

@mantergo mantergo added the 🌐 SDK: StreamChat (LLC) Tasks related to the StreamChat LLC SDK label Aug 26, 2020
@GetStream GetStream deleted a comment from Stream-iOS-Bot Aug 26, 2020
@codecov
Copy link

codecov bot commented Aug 26, 2020

Codecov Report

Merging #438 into master will decrease coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #438      +/-   ##
==========================================
- Coverage   84.19%   84.15%   -0.04%     
==========================================
  Files          94       94              
  Lines        3536     3541       +5     
==========================================
+ Hits         2977     2980       +3     
- Misses        559      561       +2     
Impacted Files Coverage Δ
Sources_v3/Query/ChannelListQuery.swift 70.00% <ø> (ø)
Sources_v3/Controllers/ChannelListController.swift 92.53% <100.00%> (+0.60%) ⬆️
Sources_v3/Controllers/Controller.swift 87.50% <0.00%> (-12.50%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b709f81...a7de68e. Read the comment docs.

Copy link
Contributor

@VojtaStavik VojtaStavik left a comment

Choose a reason for hiding this comment

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

Nice and easy 👍 Thanks

Comment on lines +245 to +249
controller.loadNextChannels(limit: limit) { [callbackQueueID] error in
AssertTestQueue(withId: callbackQueueID)
XCTAssertNil(error)
completionCalled = true
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Smells like we should create some abstraction for this boilerplate, too. It's everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably yes. Will think about it when will touch this again :)

@mantergo mantergo merged commit 439b3ea into master Aug 27, 2020
@delete-merged-branch delete-merged-branch bot deleted the CIS-259-channels-pagination branch August 27, 2020 11:11
@VojtaStavik VojtaStavik changed the title [CIS-259] Channels pagination [CIS-295] Channels pagination Aug 27, 2020
@mantergo mantergo changed the title [CIS-295] Channels pagination [CIS-259] Channels pagination Aug 27, 2020
@mantergo mantergo changed the title [CIS-259] Channels pagination [CIS-295] Channels pagination Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌐 SDK: StreamChat (LLC) Tasks related to the StreamChat LLC SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants