kalium icon indicating copy to clipboard operation
kalium copied to clipboard

fix: use server time for calling (WPB-10979)

Open ohassine opened this issue 1 year ago • 6 comments

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


PR Submission Checklist for internal contributors

  • The PR Title

    • [x] conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • [x] contains a reference JIRA issue number like SQPIT-764
    • [x] answers the question: If merged, this PR will: ... ³
  • The PR Description

    • [x] 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.

ohassine avatar Sep 17 '24 10:09 ohassine

Test Results

3 219 tests  +3   3 113 :white_check_mark: +3   4m 41s :stopwatch: +50s   552 suites ±0     106 :zzz: ±0    552 files   ±0       0 :x: ±0 

Results for commit 261f579c. ± Comparison against base commit 75b92ab8.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar Sep 17 '24 10:09 github-actions[bot]

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 :warning:
.../network/api/v0/authenticated/NotificationApiV0.kt 0.00% 2 Missing and 1 partial :warning:
.../network/api/v3/authenticated/NotificationApiV3.kt 0.00% 0 Missing and 1 partial :warning:
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%) :arrow_up:
...ire/kalium/logic/sync/incremental/EventGatherer.kt 80.00% <100.00%> (+1.51%) :arrow_up:
...base/authenticated/notification/NotificationApi.kt 20.00% <ø> (ø)
.../network/api/v3/authenticated/NotificationApiV3.kt 83.33% <0.00%> (-8.34%) :arrow_down:
.../network/api/v0/authenticated/NotificationApiV0.kt 49.23% <0.00%> (-3.16%) :arrow_down:
...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.

codecov-commenter avatar Sep 17 '24 11:09 codecov-commenter

Datadog Report

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

:white_check_mark: 0 Failed, 3113 Passed, 106 Skipped, 20.43s Total Time

datadog-wireapp[bot] avatar Sep 17 '24 11:09 datadog-wireapp[bot]

🐰 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

github-actions[bot] avatar Sep 26 '24 12:09 github-actions[bot]

@ohassine can you please fix the conflicts

MohamadJaara avatar Oct 01 '24 13:10 MohamadJaara