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

fix: ANRs when getting identities [WPB-8753] #2718

Merged
merged 7 commits into from
Apr 26, 2024

Conversation

saleniuk
Copy link
Contributor

@saleniuk saleniuk commented Apr 25, 2024


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

ANR when trying to get user or device identities.

Solutions

ObserveConversationMembersUseCase was emitting the same items multiple times, especially when navigating in the app, and it was causing the spam of getUserIdentities and probably overloading CoreCrypto, so distinctUntilChanged worked.

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Navigate: group conversation -> details -> participants -> user profile -> 1:1 conversation -> back or conversation details

Attachments (Optional)

ANR_getclientidentity

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.

Copy link
Contributor

github-actions bot commented Apr 25, 2024

Test Results

2 850 tests   2 832 ✔️  4m 55s ⏱️
       7 suites       18 💤
       7 files           0

Results for commit 9f08ed5.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@yamilmedina yamilmedina left a comment

Choose a reason for hiding this comment

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

🚀 Just small naming suggestion, cool idea about the CurrentTimeProvider

@datadog-wireapp
Copy link

datadog-wireapp bot commented Apr 25, 2024

Datadog Report

All test runs 0880d67 🔗

2 Total Test Services: 0 Failed, 2 Passed

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Wall Time Test Service View
kalium-ios 0 0 0 2738 122 14m 15.12s Link
kalium-jvm 0 0 0 2878 106 8m 55.01s Link

@saleniuk saleniuk requested review from a team, typfel, alexandreferris, mchenani, Garzas and ohassine and removed request for a team April 25, 2024 14:33
Copy link
Member

@MohamadJaara MohamadJaara left a comment

Choose a reason for hiding this comment

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

tbh, i am not sure about the cache for user identities, i would rather fix the root cause, ObserveParticipantsForConversationUseCase. is calling this function on each update, maybe we can change this to not fetch this info on each flow emit but have it fetched separately in the view model when needed?

@saleniuk
Copy link
Contributor Author

tbh, i am not sure about the cache for user identities, i would rather fix the root cause, ObserveParticipantsForConversationUseCase. is calling this function on each update, maybe we can change this to not fetch this info on each flow emit but have it fetched separately in the view model when needed?

Sure, this cache isn't that much of an improvement (in that particular case it was making only one less request thanks to this cache) so it got removed and instead implemented the way to keep already fetched data and only fetch for newly emitted ones: wireapp/wire-android#2942 (all other places where user identities or client identities are fetched do not involve flows so do not have this problem).

Copy link
Member

@MohamadJaara MohamadJaara 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 👍🏼

@saleniuk saleniuk merged commit 18742df into release/candidate Apr 26, 2024
19 checks passed
@saleniuk saleniuk deleted the fix/mlsclient-getidentities-anrs branch April 26, 2024 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants