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

feat: add query profiling and cached paginated list [WPB-14826] #3726

Merged
merged 7 commits into from
Dec 13, 2024

Conversation

saleniuk
Copy link
Contributor

@saleniuk saleniuk commented Dec 10, 2024

BugWPB-14826 [Android] Conversation list loading very slow after closing a conversation


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

Paginated conversation list is loading slowly when navigating back from conversation screen.

Solutions

Implement caching for the PagingData flow - there's a ready to use extension function cachedIn.
Add a logic to enable or disable database profiling to have logs with query execution times if the user enabled logging (only for cipher db) - thanks to that we will be able to confirm or eliminate some queries as potential causes of slow loading of conversation list.

Dependencies (Optional)

Needs releases with:

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Open conversation and navigate back - list should be cached and appear faster on the screen.
Enable logging in the app and check logcat or logs collected in the file to make sure there are also logs with query execution times.


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@echoes-hq echoes-hq bot added the echoes: unplanned Any work item that isn’t part of the product or technical roadmap. label Dec 10, 2024
Copy link
Contributor

@saleniuk looks like you are rolling back kalium to a previous commitish.

This means that the PR's target branch (develop) is using a newer version of Kalium, and the changes in this PR will rollback Kalium to an older version.

develop This PR
26b7d4b4dcf2b50b64a3979e6211094a7a5d63d4 85de0cfb5906f5fbf5e9ce903f09b3edd92bc22d

Is this intentional?

Copy link
Contributor

@saleniuk looks like you are rolling back kalium to a previous commitish.

This means that the PR's target branch (develop) is using a newer version of Kalium, and the changes in this PR will rollback Kalium to an older version.

develop This PR
26b7d4b4dcf2b50b64a3979e6211094a7a5d63d4 85de0cfb5906f5fbf5e9ce903f09b3edd92bc22d

Is this intentional?

@codecov-commenter
Copy link

codecov-commenter commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 81.81818% with 4 lines in your changes missing coverage. Please review.

Project coverage is 45.63%. Comparing base (a346709) to head (bec0301).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...rc/main/kotlin/com/wire/android/WireApplication.kt 0.00% 3 Missing ⚠️
...ome/conversationslist/ConversationListViewModel.kt 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3726      +/-   ##
===========================================
+ Coverage    45.58%   45.63%   +0.05%     
===========================================
  Files          476      477       +1     
  Lines        16113    16134      +21     
  Branches      2736     2736              
===========================================
+ Hits          7345     7363      +18     
- Misses        8001     8004       +3     
  Partials       767      767              
Files with missing lines Coverage Δ
...com/wire/android/debug/DatabaseProfilingManager.kt 100.00% <100.00%> (ø)
...ome/conversationslist/ConversationListViewModel.kt 33.46% <66.66%> (+0.53%) ⬆️
...rc/main/kotlin/com/wire/android/WireApplication.kt 0.00% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

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

Copy link
Contributor

Built wire-android-staging-compat-pr-3726.apk is available for download

Copy link
Contributor

Built wire-android-dev-debug-pr-3726.apk is available for download

@saleniuk saleniuk requested review from a team, typfel, yamilmedina, borichellow, MohamadJaara and mathias-niboulies and removed request for a team December 11, 2024 09:12
@saleniuk saleniuk enabled auto-merge December 11, 2024 17:32
@saleniuk saleniuk added this pull request to the merge queue Dec 11, 2024
Copy link
Contributor

Built wire-android-staging-compat-pr-3726.apk is available for download

Copy link
Contributor

Built wire-android-dev-debug-pr-3726.apk is available for download

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Dec 11, 2024
@saleniuk saleniuk added this pull request to the merge queue Dec 12, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Dec 12, 2024
@saleniuk saleniuk added this pull request to the merge queue Dec 12, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 12, 2024
@saleniuk saleniuk enabled auto-merge December 13, 2024 14:40
@saleniuk saleniuk added this pull request to the merge queue Dec 13, 2024
Copy link
Contributor

Built wire-android-staging-compat-pr-3726.apk is available for download

Copy link
Contributor

Built wire-android-dev-debug-pr-3726.apk is available for download

Merged via the queue into develop with commit 375b8ca Dec 13, 2024
13 of 14 checks passed
@saleniuk saleniuk deleted the feat/add-query-profiling-and-cached-conv-list branch December 13, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes: unplanned Any work item that isn’t part of the product or technical roadmap. size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants