-
Notifications
You must be signed in to change notification settings - Fork 5
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
chore: add support for jetpack paging on persistence (AR-1882) #886
Merged
vitorhugods
merged 13 commits into
develop
from
android/chore/add_support_for_jetpack_paging_on_persistence
Sep 12, 2022
Merged
chore: add support for jetpack paging on persistence (AR-1882) #886
vitorhugods
merged 13 commits into
develop
from
android/chore/add_support_for_jetpack_paging_on_persistence
Sep 12, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## develop #886 +/- ##
=============================================
- Coverage 60.36% 60.35% -0.02%
- Complexity 673 679 +6
=============================================
Files 455 456 +1
Lines 12114 12127 +13
Branches 1223 1225 +2
=============================================
+ Hits 7313 7319 +6
- Misses 4279 4286 +7
Partials 522 522 |
…ing_on_persistence
…tpack_paging_on_persistence' into android/chore/add_support_for_jetpack_paging_on_persistence
vitorhugods
requested review from
saleniuk,
yamilmedina,
typfel and
alexandreferris
and removed request for
saleniuk,
yamilmedina and
typfel
September 12, 2022 00:34
6 tasks
Garzas
approved these changes
Sep 12, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎸
vitorhugods
deleted the
android/chore/add_support_for_jetpack_paging_on_persistence
branch
September 12, 2022 05:20
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764
The PR Description
What's new in this PR?
Issues
On Android, dealing with LazyColumn + manual implementation of Paging with reactive data is a bit painful.
Solutions
Add support for Jetpack Paging on Android, using SQLDelight's extensions for that.
Issues with SQLDelight implementation
There are a few issues related to the current implementation of
PagingSource
on SQLDelight. Especially for us that are a few versions behind and can't upgrade right now:Because of this, I've altered the implementation in a couple of lines to suit our needs.
Platform-specific extension
Adding a platform-specific extension was a first (I believe ?) to this project.
The chosen approach was to create an
expect class MessageExtensions
that is added to the currentMessageDAO
.This way, each platform can create its own extensions on their
actual
implementation of theMessageExtensions
.The alternative would be flipping this completely upside-down, like
UserSessionScope
does:A
MessageDAOCommon
and actual implementations ofMessageDAO
that extend the common implementation. However, empty extension classes seem easier to maintain than creating empty actual implementations of the main behaviour.Small refactoring on MessageMapper
As the mapper is needed for both the
MessageDAO
and theMessageExtensions
, I've moved it to its own file, and moved some of the mapping functions from the DAO to the Mapper, as it probably should've been done before anyway. This way these functions can be used by both classes.Testing
Test Coverage
PR Post Merge Checklist for internal contributors
References
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764
.