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: 1:1 calls can not be established on staging environment (WPB-9359) #3026

Closed

Conversation

ohassine
Copy link
Member

@ohassine ohassine commented May 22, 2024

BugWPB-9359 [Android] 1:1 calls can not be established on staging environment


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

When the user starts a call from android and answer the receiver answer, the call does not establish and stays on connecting state.

Causes (Optional)

When we start the call, websocket closes immediately.
This happens after moving calling feature to a separate activity in separate task. The app thinks that it's on background when we start the call so it changes the connectivity policy to DISCONNECT_AFTER_PENDING_EVENTS which cause to close websocket and therefore no calling messages will be received to establish the call.

Solutions

Observe lifecycle of CallActivity as well so we the app can correctly know if the app is visible or not (not just WireActivity as it was before)

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.

@ohassine ohassine requested review from a team, yamilmedina, alexandreferris, vitorhugods, mchenani and Garzas and removed request for a team May 22, 2024 14:00
@@ -85,6 +89,7 @@ class CallActivity : AppCompatActivity() {

setUpCallingFlags()
setUpScreenShootPreventionFlag()
lifecycle.addObserver(currentScreenManager)
Copy link
Contributor

Choose a reason for hiding this comment

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

question: won't that create a race condition between CallActivity and WireActivity if both Activities lifecycles are observed at the same time by the currentScreenManager? Shouldn't we also removeObserver when opening and closing another Activity?

Copy link
Contributor

Choose a reason for hiding this comment

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

According to the documentation:
image
so first onStart from new Activity and then onStop from old one.
We have visibilityCount there so it shouldn't have a negative impact in case of switching between activities, but still if we have multiple Activities now we should also remove these observers when Activity is destroyed.
Also, logs from CurrentScreenManager will probably become hard to understand as they don't say which Activity is stopped or started, so when opening second Activity, in logs we will get onStart and then onStop so from logs it will look like app is not visible, but it's only the previous activity that has become stopped, not the whole app. 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually there will be no race condition because visibilityCount is update when starting CallActivity onStart and it get updated onStop of WireActivity.
But yeah in logs it will not be clear which is which.

Copy link
Contributor

github-actions bot commented May 22, 2024

Test Results

23 tests   23 ✅  0s ⏱️
 5 suites   0 💤
 5 files     0 ❌

Results for commit 44567ed.

♻️ This comment has been updated with latest results.

@AndroidBob
Copy link
Collaborator

Build 4906 failed.

Copy link

sonarcloud bot commented May 24, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@AndroidBob
Copy link
Collaborator

Build 4981 failed.

@ohassine
Copy link
Member Author

Closing it in favour of #3037

@ohassine ohassine closed this May 24, 2024
@yamilmedina yamilmedina deleted the one-on-one-call-could-not-be-established-rc branch July 30, 2024 12:14
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.

4 participants