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] #3283

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

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.

Copy link

sonarqubecloud bot commented Feb 7, 2025

Copy link
Contributor

github-actions bot commented Feb 7, 2025

Test Results

3 513 tests  ±0   3 405 ✅ ±0   6m 22s ⏱️ +27s
  603 suites ±0     108 💤 ±0 
  603 files   ±0       0 ❌ ±0 

Results for commit 5ef80ec. ± Comparison against base commit 20791fd.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Feb 7, 2025

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.85%. Comparing base (9ca21c1) to head (5ef80ec).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3283      +/-   ##
===========================================
- Coverage    50.87%   50.85%   -0.03%     
===========================================
  Files         1606     1607       +1     
  Lines        57189    58051     +862     
  Branches      5105     5199      +94     
===========================================
+ Hits         29097    29519     +422     
- Misses       26078    26517     +439     
- Partials      2014     2015       +1     

see 35 files with indirect coverage changes


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 9ca21c1...5ef80ec. Read the comment docs.

@datadog-wireapp
Copy link

Datadog Report

Branch report: refactor/remove-not-needed-usage-of-observe-self-user
Commit report: 935ab77
Test service: kalium-jvm

✅ 0 Failed, 3405 Passed, 108 Skipped, 1m 1.19s Total Time

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.

2 participants