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

feat: handle reason for conversation.member-leave event [WPB-5877] #2307

Merged

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

handle reason for conversation.member-leave event

Solutions

user is left or removed

we delete the user id from the conversion members table memberDAO.deleteMembersByQualifiedID (conveId, List<UserID>)

insert a members left system message into the DB

user deleted

we mark the users as deleted userRepository.markUserAsDeletedAndRemoveFromGroupConversations(List<userId>)

insert a members left system message into the DB

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.

…tion-leave-evetn

# Conflicts:
#	logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/MessageContent.kt
#	logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/MessageMapper.kt
#	logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/PersistMessageUseCase.kt
Copy link
Contributor

github-actions bot commented Dec 15, 2023

Test Results

2 567 tests   - 190   2 489 ✔️  - 164   18s ⏱️ - 2m 9s
   446 suites  -   39        78 💤  -   26 
   446 files    -   39          0 ±    0 

Results for commit e13c9af. ± Comparison against base commit 4ace8cb.

This pull request removes 2757 and adds 2567 tests. Note that renamed tests count towards both.
PocIntegrationTest ‑ givenApiWhenGettingACMEDirectoriesThenReturnAsExpectedBasedOnNetworkState
PocIntegrationTest ‑ givenEmailAndPasswordWhenLoggingInThenRegisterClientAndLogout
com.wire.kalium.HttpClientConnectionSpecsTest ‑ givenTheHttpClientIsCreated_ThenEnsureOnlySupportedSpecsArePresent[jvm]
com.wire.kalium.api.base.authenticated.notification.AccessUpdateTest ‑ givenPayloadWithAccessRoleAndDeprecatedAccessRoleField_whenDecoding_thenDeprecatedFieldIsPreferred[jvm]
com.wire.kalium.api.base.authenticated.notification.AccessUpdateTest ‑ givenPayloadWithDeprecatedAccessRoleField_whenDecoding_thenSuccess[jvm]
com.wire.kalium.api.base.authenticated.notification.AccessUpdateTest ‑ givenPayload_whenDecoding_thenSuccess[jvm]
com.wire.kalium.api.common.ACMEApiTest ‑ givenNoLocationInHeader_whenCallingSendAcmeRequestApi_theResponseShouldBeConfigureCorrectly[jvm]
com.wire.kalium.api.common.ACMEApiTest ‑ givenNoNonce_whenCallingSendAcmeRequestApi_theResponseShouldBeMissingNonce[jvm]
com.wire.kalium.api.common.ACMEApiTest ‑ whenCallingGetACMEDirectoriesApi_theResponseShouldBeConfigureCorrectly[jvm]
com.wire.kalium.api.common.ACMEApiTest ‑ whenCallingGetACMENonceApi_theResponseShouldBeConfigureCorrectly[jvm]
…
com.wire.kalium.api.base.authenticated.notification.AccessUpdateTest ‑ givenPayloadWithAccessRoleAndDeprecatedAccessRoleField_whenDecoding_thenDeprecatedFieldIsPreferred[iosX64]
com.wire.kalium.api.base.authenticated.notification.AccessUpdateTest ‑ givenPayloadWithDeprecatedAccessRoleField_whenDecoding_thenSuccess[iosX64]
com.wire.kalium.api.base.authenticated.notification.AccessUpdateTest ‑ givenPayload_whenDecoding_thenSuccess[iosX64]
com.wire.kalium.api.common.ACMEApiTest ‑ givenNoLocationInHeader_whenCallingSendAcmeRequestApi_theResponseShouldBeConfigureCorrectly[iosX64]
com.wire.kalium.api.common.ACMEApiTest ‑ givenNoNonce_whenCallingSendAcmeRequestApi_theResponseShouldBeMissingNonce[iosX64]
com.wire.kalium.api.common.ACMEApiTest ‑ whenCallingGetACMEDirectoriesApi_theResponseShouldBeConfigureCorrectly[iosX64]
com.wire.kalium.api.common.ACMEApiTest ‑ whenCallingGetACMENonceApi_theResponseShouldBeConfigureCorrectly[iosX64]
com.wire.kalium.api.common.ACMEApiTest ‑ whenCallingSendAcmeRequestApi_theResponseShouldBeConfigureCorrectly[iosX64]
com.wire.kalium.api.common.ACMEApiTest ‑ whenCallingSendChallengeRequestApi_theResponseShouldBeConfigureCorrectly[iosX64]
com.wire.kalium.api.common.BackendMetaDataUtilTest ‑ givenAnEmptyAppSupportedVersionList_whenCalculateApiVersion_thenTheUnknownServerIsReturned[iosX64]
…
This pull request removes 104 skipped tests and adds 78 skipped tests. Note that renamed tests count towards both.
PocIntegrationTest ‑ givenApiWhenGettingACMEDirectoriesThenReturnAsExpectedBasedOnNetworkState
PocIntegrationTest ‑ givenEmailAndPasswordWhenLoggingInThenRegisterClientAndLogout
com.wire.kalium.api.common.ACMEApiTest ‑ whenCallingSendChallengeRequestApi_theResponseShouldBeConfigureCorrectly[jvm]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenAValidEmail_whenActivationEmailWIthCode_theRequestShouldBeConfiguredCorrectly[jvm]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenAValidEmail_whenRegisteringAccountWithEMail_theRequestShouldBeConfiguredCorrectly[jvm]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenAValidEmail_whenSendingActivationEmail_theRequestShouldBeConfiguredCorrectly[jvm]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenActivationCodeFail_thenErrorIsPropagated[jvm]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenRegistrationFail_whenRegisteringAccountWithEMMail_thenErrorIsPropagated[jvm]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenSendActivationCodeFail_thenErrorIsPropagated[jvm]
com.wire.kalium.cryptography.CryptoUtilsTest ‑ givenDummyText_whenEncryptedAndDecryptedWithAES256_returnsOriginalText[js, browser]
…
com.wire.kalium.api.common.ACMEApiTest ‑ whenCallingSendChallengeRequestApi_theResponseShouldBeConfigureCorrectly[iosX64]
com.wire.kalium.api.v0.message.QualifiedMessageApiV0Test ‑ givenAValid_whenSendingAMessage_theRequestShouldBeConfiguredCorrectly[iosX64]
com.wire.kalium.api.v0.message.QualifiedMessageApiV0Test ‑ givenDeletedUsersError_whenSendingAMessage_TheCorrectErrorIsPropagate[iosX64]
com.wire.kalium.api.v0.message.QualifiedMessageApiV0Test ‑ givenMissingUsersError_whenSendingAMessage_TheCorrectErrorIsPropagate[iosX64]
com.wire.kalium.api.v0.message.QualifiedMessageApiV0Test ‑ givenRedundantUsersError_whenSendingAMessage_TheCorrectErrorIsPropagate[iosX64]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenAValidEmail_whenActivationEmailWIthCode_theRequestShouldBeConfiguredCorrectly[iosX64]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenAValidEmail_whenRegisteringAccountWithEMail_theRequestShouldBeConfiguredCorrectly[iosX64]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenAValidEmail_whenSendingActivationEmail_theRequestShouldBeConfiguredCorrectly[iosX64]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenActivationCodeFail_thenErrorIsPropagated[iosX64]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenRegistrationFail_whenRegisteringAccountWithEMMail_thenErrorIsPropagated[iosX64]
…

♻️ This comment has been updated with latest results.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Dec 15, 2023

Datadog Report

All test runs d86a8f6 🔗

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 2489 78 4m 51.09s Link
kalium-jvm 0 0 0 2657 104 7m 42s Link

@codecov-commenter
Copy link

codecov-commenter commented Dec 17, 2023

Codecov Report

Merging #2307 (e13c9af) into develop (4ace8cb) will decrease coverage by 0.04%.
The diff coverage is 47.14%.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #2307      +/-   ##
=============================================
- Coverage      58.59%   58.55%   -0.04%     
  Complexity        21       21              
=============================================
  Files           1102     1103       +1     
  Lines          42319    42420     +101     
  Branches        3960     3975      +15     
=============================================
+ Hits           24797    24841      +44     
- Misses         15766    15815      +49     
- Partials        1756     1764       +8     
Files Coverage Δ
...n/kotlin/com/wire/kalium/logic/data/event/Event.kt 78.50% <100.00%> (+0.03%) ⬆️
...re/kalium/logic/sync/receiver/TeamEventReceiver.kt 74.41% <ø> (ø)
...se/authenticated/conversation/ConversationEvent.kt 41.66% <100.00%> (+1.66%) ⬆️
.../kotlin/com/wire/kalium/persistence/dao/UserDAO.kt 91.50% <ø> (ø)
...kalium/logic/data/message/PersistMessageUseCase.kt 0.00% <0.00%> (ø)
...in/com/wire/kalium/logic/data/event/EventMapper.kt 21.26% <57.14%> (+0.44%) ⬆️
...c/receiver/conversation/MemberLeaveEventHandler.kt 95.08% <92.85%> (-4.92%) ⬇️
...base/authenticated/notification/EventContentDTO.kt 54.72% <63.63%> (ø)
...authenticated/notification/MemberLeaveReasonDTO.kt 55.55% <55.55%> (ø)
...re/kalium/persistence/dao/message/MessageEntity.kt 72.97% <12.50%> (-1.44%) ⬇️
... and 5 more

... 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 4ace8cb...e13c9af. Read the comment docs.

@MohamadJaara MohamadJaara requested review from a team, typfel, alexandreferris, mchenani, ohassine and saleniuk and removed request for a team December 17, 2023 16:26
@MohamadJaara MohamadJaara added this pull request to the merge queue Dec 18, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 18, 2023
@MohamadJaara MohamadJaara added this pull request to the merge queue Dec 18, 2023
Merged via the queue into develop with commit 97c7296 Dec 18, 2023
17 checks passed
@MohamadJaara MohamadJaara deleted the feat/support-new-reason-value-on-conversation-leave-evetn branch December 18, 2023 13:05
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.

4 participants