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: use server time for calling (WPB-10979) #3017

Merged
merged 9 commits into from
Oct 8, 2024

Conversation

ohassine
Copy link
Member

@ohassine ohassine commented Sep 17, 2024

BugWPB-10979 [Android] No call notifications incoming on graphene device on bund-next-col1 backend


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

No call notifications incoming if device time is not correct

Causes (Optional)

If device time is different from the server, AVS will return shouldRing flag as false causing the app to not show any incoming call notification

Solutions

On event processing we calculate time offset that will be used later to get server time

Edit:
I changed the logic so now we get serverTime by fetching /notifications api with only querySize 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: bugs Technical or functional defects in the product label Sep 17, 2024
@ohassine ohassine requested review from a team, typfel, yamilmedina, alexandreferris, MohamadJaara and Garzas and removed request for a team September 17, 2024 10:43
Copy link
Contributor

github-actions bot commented Sep 17, 2024

Test Results

3 219 tests  +3   3 113 ✅ +3   4m 41s ⏱️ +50s
  552 suites ±0     106 💤 ±0 
  552 files   ±0       0 ❌ ±0 

Results for commit 261f579. ± Comparison against base commit 75b92ab.

♻️ This comment has been updated with latest results.

@codecov-commenter
Copy link

codecov-commenter commented Sep 17, 2024

Codecov Report

Attention: Patch coverage is 52.17391% with 11 lines in your changes missing coverage. Please review.

Project coverage is 52.43%. Comparing base (75b92ab) to head (261f579).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...in/com/wire/kalium/logic/util/ServerTimeHandler.kt 0.00% 7 Missing ⚠️
.../network/api/v0/authenticated/NotificationApiV0.kt 0.00% 2 Missing and 1 partial ⚠️
.../network/api/v3/authenticated/NotificationApiV3.kt 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3017      +/-   ##
===========================================
- Coverage    52.52%   52.43%   -0.10%     
===========================================
  Files         1305     1309       +4     
  Lines        50225    50337     +112     
  Branches      4680     4671       -9     
===========================================
+ Hits         26383    26392       +9     
- Misses       21956    22057     +101     
- Partials      1886     1888       +2     
Files with missing lines Coverage Δ
...n/kotlin/com/wire/kalium/logic/data/event/Event.kt 78.17% <100.00%> (ø)
...om/wire/kalium/logic/data/event/EventRepository.kt 56.45% <100.00%> (+3.82%) ⬆️
...ire/kalium/logic/sync/incremental/EventGatherer.kt 80.00% <100.00%> (+1.51%) ⬆️
...base/authenticated/notification/NotificationApi.kt 20.00% <ø> (ø)
.../network/api/v3/authenticated/NotificationApiV3.kt 83.33% <0.00%> (-8.34%) ⬇️
.../network/api/v0/authenticated/NotificationApiV0.kt 49.23% <0.00%> (-3.16%) ⬇️
...in/com/wire/kalium/logic/util/ServerTimeHandler.kt 0.00% <0.00%> (ø)

... and 21 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 75b92ab...261f579. Read the comment docs.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Sep 17, 2024

Datadog Report

Branch report: user-server-time-for-calling
Commit report: 5e441d4
Test service: kalium-jvm

✅ 0 Failed, 3113 Passed, 106 Skipped, 20.43s Total Time

Copy link
Contributor

github-actions bot commented Sep 26, 2024

🐰 Bencher Report

Branchuser-server-time-for-calling
Testbedubuntu-latest

⚠️ WARNING: The following Measure does not have a Threshold. Without a Threshold, no Alerts will ever be generated!

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds CLI flag.

Click to view all benchmark results
BenchmarkLatencynanoseconds (ns)
com.wire.kalium.benchmarks.logic.CoreLogicBenchmark.createObjectInFiles📈 view plot
⚠️ NO THRESHOLD
688,070.34
com.wire.kalium.benchmarks.logic.CoreLogicBenchmark.createObjectInMemory📈 view plot
⚠️ NO THRESHOLD
340,774,610.96
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.messageInsertionBenchmark📈 view plot
⚠️ NO THRESHOLD
926,401,902.19
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.queryMessagesBenchmark📈 view plot
⚠️ NO THRESHOLD
21,503,906.92
🐰 View full continuous benchmarking report in Bencher

@MohamadJaara
Copy link
Member

@ohassine can you please fix the conflicts

…or-calling

# Conflicts:
#	logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt
Copy link

sonarcloud bot commented Oct 8, 2024

@ohassine ohassine added this pull request to the merge queue Oct 8, 2024
Merged via the queue into develop with commit fc3f3e3 Oct 8, 2024
22 checks passed
@ohassine ohassine deleted the user-server-time-for-calling branch October 8, 2024 14:01
MohamadJaara pushed a commit that referenced this pull request Oct 18, 2024
* fix: use server time for calling

* chore: address comments

* fix: get serverTime after websocket is connected

* chore: cleanup

* chore: broken unit test
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