kalium icon indicating copy to clipboard operation
kalium copied to clipboard

feat(async-notifications): ack events through the resusable websocket connection (WPB-16644)

Open yamilmedina opened this issue 6 months ago • 4 comments

TaskWPB-16644 [Android] New Incremental Sync - ACK events when consumed


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

We need to perform ACK through the websocket after receiving and processing events.

Solutions

  • Perform websocket /events hack for auth, using cookies instead of notifications (this endpoint won't work when consumable notifications
  • Make NotificationsAPI singleton, as we need to perform ack in the same connection.
  • When updating client capabilities, always declare legalhold and consumable-notifications as base
  • Perform ACK through the websocket connection

Testing

Test Coverage (Optional)

  • [x] I have added automated test to this contribution

PR Post Submission Checklist for internal contributors (Optional)

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

yamilmedina avatar Apr 29 '25 10:04 yamilmedina

Test Results

3 400 tests   3 387 ✅  5m 4s ⏱️     6 suites     13 💤     6 files        0 ❌

Results for commit e4939213.

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

github-actions[bot] avatar May 02 '25 09:05 github-actions[bot]

Datadog Report

Branch report: feat/newsync-doingacks Commit report: 1f32d62 Test service: kalium-jvm

:white_check_mark: 0 Failed, 3592 Passed, 109 Skipped, 54.23s Total Time

datadog-wireapp[bot] avatar May 02 '25 09:05 datadog-wireapp[bot]

Codecov Report

Attention: Patch coverage is 36.84211% with 72 lines in your changes missing coverage. Please review.

Please upload report for BASE (epic/new-incremental-sync@63653e1). Learn more about missing BASE report.

Files with missing lines Patch % Lines
.../network/api/v8/authenticated/NotificationApiV8.kt 22.22% 21 Missing :warning:
...henticated/notification/EventAcknowledgeRequest.kt 0.00% 19 Missing :warning:
...in/kotlin/com/wire/kalium/network/NetworkClient.kt 0.00% 11 Missing :warning:
...kalium/network/api/v8/authenticated/ClientApiV8.kt 0.00% 6 Missing :warning:
...lient/IsClientAsyncNotificationsCapableProvider.kt 0.00% 4 Missing :warning:
...ponses/ConsumableNotificationEventsResponseJson.kt 0.00% 2 Missing :warning:
...ted/notification/ConsumableNotificationResponse.kt 0.00% 2 Missing :warning:
...om/wire/kalium/network/api/model/ApiModelMapper.kt 0.00% 2 Missing :warning:
.../network/api/v0/authenticated/NotificationApiV0.kt 0.00% 2 Missing :warning:
...etworkContainer/AuthenticatedNetworkContainerV8.kt 0.00% 2 Missing :warning:
... and 1 more
Additional details and impacted files
@@                     Coverage Diff                      @@
##             epic/new-incremental-sync    #3432   +/-   ##
============================================================
  Coverage                             ?   50.39%           
  Complexity                           ?       41           
============================================================
  Files                                ?     1545           
  Lines                                ?    60166           
  Branches                             ?     5656           
============================================================
  Hits                                 ?    30318           
  Misses                               ?    27751           
  Partials                             ?     2097           
Files with missing lines Coverage Δ
.../com/wire/kalium/logic/data/client/ClientMapper.kt 47.17% <100.00%> (ø)
...in/com/wire/kalium/logic/data/event/EventMapper.kt 22.25% <100.00%> (ø)
...ire/kalium/logic/sync/incremental/EventGatherer.kt 76.82% <100.00%> (ø)
...re/kalium/logic/sync/incremental/EventProcessor.kt 76.74% <100.00%> (ø)
.../com/wire/kalium/logic/sync/slow/SlowSyncWorker.kt 96.77% <100.00%> (ø)
...base/authenticated/notification/NotificationApi.kt 18.18% <ø> (ø)
...om/wire/kalium/logic/data/event/EventRepository.kt 52.29% <88.88%> (ø)
...ponses/ConsumableNotificationEventsResponseJson.kt 0.00% <0.00%> (ø)
...ted/notification/ConsumableNotificationResponse.kt 0.00% <0.00%> (ø)
...om/wire/kalium/network/api/model/ApiModelMapper.kt 0.00% <0.00%> (ø)
... and 7 more

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 63653e1...e493921. Read the comment docs.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov-commenter avatar May 02 '25 12:05 codecov-commenter