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

refactor: remove not needed usage of observe self user [WPB-15414] #3863

Merged

Conversation

MohamadJaara
Copy link
Member

@MohamadJaara MohamadJaara commented Feb 7, 2025

TaskWPB-15414 [Android] Fix issue with self user observation


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

ObserveSelfUserUseCase is often used like this:

val userId = observeSelf().first()

This may cause two issues:

NoSuchElementException if emptyFlow is returned.

Endless waiting for item if flow does not emit any blocking the UI in inconsistent state.

Solutions

Replace with GetSelfUserUseCase and handle possible null return value.

Dependencies (Optional)

If there are some other pull requests related to this one (e.g. new releases of frameworks), specify them here.

Needs releases with:

  • GitHub link to other pull request

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Briefly describe how this change was tested and if applicable the exact steps taken to verify that it works as expected.

Notes (Optional)

Specify here any other facts that you think are important for this issue.

Attachments (Optional)

Attachments like images, videos, etc. (drag and drop in the text box)


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: technical-roadmap/technical-debt More specific category, to highlight Technical Debt being tackled. label Feb 7, 2025
@pull-request-size pull-request-size bot added size/XS and removed size/S labels Feb 7, 2025
@codecov-commenter
Copy link

codecov-commenter commented Feb 7, 2025

Codecov Report

Attention: Patch coverage is 58.82353% with 7 lines in your changes missing coverage. Please review.

Project coverage is 45.41%. Comparing base (829b6b1) to head (dca1b23).
Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
...gs/devices/e2ei/E2eiCertificateDetailsViewModel.kt 0.00% 3 Missing ⚠️
...i/home/newconversation/NewConversationViewModel.kt 71.42% 0 Missing and 2 partials ⚠️
...n/kotlin/com/wire/android/ui/home/HomeViewModel.kt 66.66% 1 Missing ⚠️
...id/ui/sharing/ImportMediaAuthenticatedViewModel.kt 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3863      +/-   ##
===========================================
- Coverage    45.42%   45.41%   -0.02%     
===========================================
  Files          491      491              
  Lines        17022    17021       -1     
  Branches      2848     2850       +2     
===========================================
- Hits          7733     7730       -3     
  Misses        8502     8502              
- Partials       787      789       +2     
Files with missing lines Coverage Δ
.../ui/userprofile/service/ServiceDetailsViewModel.kt 95.18% <100.00%> (-0.12%) ⬇️
...n/kotlin/com/wire/android/ui/home/HomeViewModel.kt 65.45% <66.66%> (+0.63%) ⬆️
...id/ui/sharing/ImportMediaAuthenticatedViewModel.kt 34.00% <66.66%> (-0.66%) ⬇️
...i/home/newconversation/NewConversationViewModel.kt 68.06% <71.42%> (-1.43%) ⬇️
...gs/devices/e2ei/E2eiCertificateDetailsViewModel.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 829b6b1...dca1b23. Read the comment docs.

Copy link
Contributor

github-actions bot commented Feb 7, 2025

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

Copy link
Contributor

github-actions bot commented Feb 7, 2025

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

Copy link
Contributor

@borichellow borichellow left a comment

Choose a reason for hiding this comment

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

home about SelfUserProfileViewModel?

@MohamadJaara MohamadJaara added this pull request to the merge queue Feb 11, 2025
Merged via the queue into develop with commit 1f0c653 Feb 11, 2025
12 of 13 checks passed
@MohamadJaara MohamadJaara deleted the refactor/remove-not-needed-usage-of-observe-self-user branch February 11, 2025 13:09
Copy link
Contributor

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

Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes: technical-roadmap/technical-debt More specific category, to highlight Technical Debt being tackled. size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants