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: app stuck on setting up wire after account creation #2044

Merged
merged 2 commits into from
Sep 8, 2023

Conversation

MohamadJaara
Copy link
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

app stuck on setting up wire after creation an account

Solutions

the function inside the unti computeIfAbsent is not being called for a tricky reason
ConcurrentMutableMap inherent from MutableMap and in java HashMaps already have a computeIfAbsent and in runtime the one form parent is called ignoring the extension function

this can be confirmed by the app still compiling if I simply delete the extension function we added and kipping everything else as it is

solution: rename it to something else

i also noticed that the calling manager function getCallManagerForClient is not thread safe, so I fixed this as well.

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.

@MohamadJaara MohamadJaara requested review from yamilmedina, ohassine, a team, alexandreferris, borichellow and trOnk12 and removed request for yamilmedina and a team September 7, 2023 15:51
@MohamadJaara MohamadJaara changed the title fix: app stuck on setting up wire after creation an account fix: app stuck on setting up wire after account creation Sep 7, 2023
private val callManagerHolder: ConcurrentMutableMap<QualifiedID, CallManager> by lazy {
ConcurrentMutableMap()
private val callManagerHolder: ConcurrentMap<QualifiedID, CallManager> by lazy {
ConcurrentHashMap()
Copy link
Member Author

Choose a reason for hiding this comment

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

in jvm we do not need to use statly since java already have ConcurrentHashMap

@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2023

Unit Test Results

       1 files   - 431         1 suites   - 431   7s ⏱️ - 1m 53s
1 645 tests  - 708  1 638 ✔️  - 612  7 💤  - 96  0 ±0 

Results for commit 603e779. ± Comparison against base commit 16334db.

♻️ This comment has been updated with latest results.

@codecov-commenter
Copy link

Codecov Report

Merging #2044 (603e779) into develop (16334db) will increase coverage by 0.01%.
The diff coverage is 0.00%.

@@              Coverage Diff              @@
##             develop    #2044      +/-   ##
=============================================
+ Coverage      57.97%   57.99%   +0.01%     
  Complexity        24       24              
=============================================
  Files           1006     1006              
  Lines          37667    37667              
  Branches        3411     3411              
=============================================
+ Hits           21839    21844       +5     
+ Misses         14372    14366       -6     
- Partials        1456     1457       +1     
Files Changed Coverage Δ
...in/com/wire/kalium/logic/di/UserStorageProvider.kt 0.00% <0.00%> (ø)
...e/kalium/logic/feature/UserSessionScopeProvider.kt 0.00% <0.00%> (ø)
...e/kalium/logic/feature/auth/AuthenticationScope.kt 0.00% <0.00%> (ø)
...n/kotlin/com/wire/kalium/logic/util/CommonUtils.kt 67.74% <ø> (+16.12%) ⬆️

... and 2 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 16334db...603e779. Read the comment docs.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Sep 7, 2023

Datadog Report

All test runs 5bd07e1 🔗

2 Total Test Services: 0 Failed, 0 with New Flaky, 2 Passed

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Wall Time Branch View
kalium-ios 0 0 0 1616 31 11.09s Link
kalium-jvm 0 0 0 2251 103 9m 55s Link

@MohamadJaara MohamadJaara added this pull request to the merge queue Sep 8, 2023
Merged via the queue into develop with commit b5ece03 Sep 8, 2023
15 checks passed
@MohamadJaara MohamadJaara deleted the fix/app-no-work branch September 8, 2023 02:20
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.

5 participants