Skip to content

feat: implement SyncServicesUseCase to sync services from backend and update ObserveAllServicesUseCase to avoid network calls#4750

Open
MohamadJaara wants to merge 1 commit intodevelopfrom
mo/don't-wait-for-remote-api-to-show-the-list-of-bots
Open

feat: implement SyncServicesUseCase to sync services from backend and update ObserveAllServicesUseCase to avoid network calls#4750
MohamadJaara wants to merge 1 commit intodevelopfrom
mo/don't-wait-for-remote-api-to-show-the-list-of-bots

Conversation

@MohamadJaara
Copy link
Copy Markdown
Member


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

ObserveAllServicesUseCase only return after a remote API update even tho the list of bots is

Causes (Optional)

the use case will update first and then return

Solutions

split it into ObserveAllServicesUseCase and SyncServicesUseCase and call SyncServicesUseCase from the view model when needed to update

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.

… update ObserveAllServicesUseCase to avoid network calls
@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.74%. Comparing base (d4133d0) to head (d87cf3d).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4750   +/-   ##
========================================
  Coverage    50.73%   50.74%           
========================================
  Files          603      603           
  Lines        21518    21522    +4     
  Branches      3344     3345    +1     
========================================
+ Hits         10917    10921    +4     
  Misses        9614     9614           
  Partials       987      987           
Files with missing lines Coverage Δ
...e/conversations/search/apps/SearchAppsViewModel.kt 98.11% <100.00%> (+0.15%) ⬆️

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 d4133d0...d87cf3d. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

} else {
if (!servicesSynced) {
servicesSynced = true
launch { syncServices() }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In that case, shouldn't we wait until services are synced instead of launching sync in a coroutine and then returning services while it's still syncing?

Copy link
Copy Markdown
Contributor

@saleniuk saleniuk left a comment

Choose a reason for hiding this comment

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

One question

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants