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 code update and delete events #1960

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

Conversation code update and delete events are not handled

Solutions

map and handle the events

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.

…eat/handle-code-update-and-delete-event

# Conflicts:
#	logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/guestroomlink/CanCreatePasswordProtectedLinksUseCase.kt
@MohamadJaara MohamadJaara force-pushed the feat/handle-code-update-and-delete-event branch from 3980597 to 2afac1a Compare August 5, 2023 16:37
@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2023

Unit Test Results

   419 files     419 suites   2m 5s ⏱️
2 230 tests 2 132 ✔️ 98 💤 0

Results for commit 241f2bc.

♻️ This comment has been updated with latest results.

Comment on lines +318 to +320
// TODO: set the correct value for is passwordProtected
it.data?.let { data -> conversationDAO.updateGuestRoomLink(conversationId.toDao(), data.uri, false) }
it.uri?.let { link -> conversationDAO.updateGuestRoomLink(conversationId.toDao(), link, false) }
Copy link
Member Author

Choose a reason for hiding this comment

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

The model returned from the remote request needs to be changed and will be part of the next PR

@datadog-wireapp
Copy link

datadog-wireapp bot commented Aug 5, 2023

Datadog Report

All test runs ed07c69 🔗

2 Total Test Services: 1 Failed, 0 with New Flaky, 1 Passed

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Wall Time Branch View
kalium-jvm 7 0 0 44 2 5m 24.13s Link
kalium-ios 0 0 0 1982 81 2m 21.04s Link

❌ Failed Tests (7)

This report shows up to 5 failed tests.

  • givenClient_whenCallingCertificateRequest_ReturnNonEmptyResult[jvm] - com.wire.kalium.cryptography.E2EIClientTest - Details

    Expand for error
     com.wire.crypto.E2eIdentityException$IdentityException: This order is expired
     
     com.wire.crypto.E2eIdentityException$IdentityException: This order is expired
     	at app//com.wire.crypto.FfiConverterTypeE2eIdentityError.read(CoreCrypto.kt:2963)
     	at app//com.wire.crypto.FfiConverterTypeE2eIdentityError.read(CoreCrypto.kt:2955)
     	at app//com.wire.crypto.FfiConverter$DefaultImpls.liftFromRustBuffer(CoreCrypto.kt:153)
     	at app//com.wire.crypto.FfiConverterRustBuffer$DefaultImpls.liftFromRustBuffer(CoreCrypto.kt:165)
     	at app//com.wire.crypto.FfiConverterTypeE2eIdentityError.liftFromRustBuffer(CoreCrypto.kt:2955)
     	at app//com.wire.crypto.FfiConverterTypeE2eIdentityError.liftFromRustBuffer(CoreCrypto.kt:2955)
     	at app//com.wire.crypto.FfiConverterRustBuffer$DefaultImpls.lift(CoreCrypto.kt:166)
     ...
    
  • givenClient_whenCallingCheckOrderRequest_ReturnNonEmptyResult[jvm] - com.wire.kalium.cryptography.E2EIClientTest - Details

    Expand for error
     com.wire.crypto.E2eIdentityException$IdentityException: This order is expired
     
     com.wire.crypto.E2eIdentityException$IdentityException: This order is expired
     	at app//com.wire.crypto.FfiConverterTypeE2eIdentityError.read(CoreCrypto.kt:2963)
     	at app//com.wire.crypto.FfiConverterTypeE2eIdentityError.read(CoreCrypto.kt:2955)
     	at app//com.wire.crypto.FfiConverter$DefaultImpls.liftFromRustBuffer(CoreCrypto.kt:153)
     	at app//com.wire.crypto.FfiConverterRustBuffer$DefaultImpls.liftFromRustBuffer(CoreCrypto.kt:165)
     	at app//com.wire.crypto.FfiConverterTypeE2eIdentityError.liftFromRustBuffer(CoreCrypto.kt:2955)
     	at app//com.wire.crypto.FfiConverterTypeE2eIdentityError.liftFromRustBuffer(CoreCrypto.kt:2955)
     	at app//com.wire.crypto.FfiConverterRustBuffer$DefaultImpls.lift(CoreCrypto.kt:166)
     ...
    
  • givenClient_whenCallingCreateDpopToken_ReturnNonEmptyResult[jvm] - com.wire.kalium.cryptography.E2EIClientTest - Details

    Expand for error
     com.wire.crypto.E2eIdentityException$IdentityException: This order is expired
     
     com.wire.crypto.E2eIdentityException$IdentityException: This order is expired
     	at app//com.wire.crypto.FfiConverterTypeE2eIdentityError.read(CoreCrypto.kt:2963)
     	at app//com.wire.crypto.FfiConverterTypeE2eIdentityError.read(CoreCrypto.kt:2955)
     	at app//com.wire.crypto.FfiConverter$DefaultImpls.liftFromRustBuffer(CoreCrypto.kt:153)
     	at app//com.wire.crypto.FfiConverterRustBuffer$DefaultImpls.liftFromRustBuffer(CoreCrypto.kt:165)
     	at app//com.wire.crypto.FfiConverterTypeE2eIdentityError.liftFromRustBuffer(CoreCrypto.kt:2955)
     	at app//com.wire.crypto.FfiConverterTypeE2eIdentityError.liftFromRustBuffer(CoreCrypto.kt:2955)
     	at app//com.wire.crypto.FfiConverterRustBuffer$DefaultImpls.lift(CoreCrypto.kt:166)
     ...
    
  • givenClient_whenCallingFinalizeRequest_ReturnNonEmptyResult[jvm] - com.wire.kalium.cryptography.E2EIClientTest - Details

    Expand for error
     com.wire.crypto.E2eIdentityException$IdentityException: This order is expired
     
     com.wire.crypto.E2eIdentityException$IdentityException: This order is expired
     	at app//com.wire.crypto.FfiConverterTypeE2eIdentityError.read(CoreCrypto.kt:2963)
     	at app//com.wire.crypto.FfiConverterTypeE2eIdentityError.read(CoreCrypto.kt:2955)
     	at app//com.wire.crypto.FfiConverter$DefaultImpls.liftFromRustBuffer(CoreCrypto.kt:153)
     	at app//com.wire.crypto.FfiConverterRustBuffer$DefaultImpls.liftFromRustBuffer(CoreCrypto.kt:165)
     	at app//com.wire.crypto.FfiConverterTypeE2eIdentityError.liftFromRustBuffer(CoreCrypto.kt:2955)
     	at app//com.wire.crypto.FfiConverterTypeE2eIdentityError.liftFromRustBuffer(CoreCrypto.kt:2955)
     	at app//com.wire.crypto.FfiConverterRustBuffer$DefaultImpls.lift(CoreCrypto.kt:166)
     ...
    
  • givenClient_whenCallingGetNewAuthzRequest_ReturnNonEmptyResult[jvm] - com.wire.kalium.cryptography.E2EIClientTest - Details

    Expand for error
     com.wire.crypto.E2eIdentityException$IdentityException: This order is expired
     
     com.wire.crypto.E2eIdentityException$IdentityException: This order is expired
     	at app//com.wire.crypto.FfiConverterTypeE2eIdentityError.read(CoreCrypto.kt:2963)
     	at app//com.wire.crypto.FfiConverterTypeE2eIdentityError.read(CoreCrypto.kt:2955)
     	at app//com.wire.crypto.FfiConverter$DefaultImpls.liftFromRustBuffer(CoreCrypto.kt:153)
     	at app//com.wire.crypto.FfiConverterRustBuffer$DefaultImpls.liftFromRustBuffer(CoreCrypto.kt:165)
     	at app//com.wire.crypto.FfiConverterTypeE2eIdentityError.liftFromRustBuffer(CoreCrypto.kt:2955)
     	at app//com.wire.crypto.FfiConverterTypeE2eIdentityError.liftFromRustBuffer(CoreCrypto.kt:2955)
     	at app//com.wire.crypto.FfiConverterRustBuffer$DefaultImpls.lift(CoreCrypto.kt:166)
     ...
    

@MohamadJaara MohamadJaara requested review from a team and typfel and removed request for a team August 7, 2023 08:14
Copy link
Contributor

@alexandreferris alexandreferris left a comment

Choose a reason for hiding this comment

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

Great work! Just some small comments

MohamadJaara and others added 3 commits August 7, 2023 10:55
…r/conversation/CodeDeletedHandler.kt

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>
…r/conversation/CodeUpdateHandlerTest.kt

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>
@MohamadJaara MohamadJaara merged commit abd6cdf into feat/create-password-protected-invite-code/epic Aug 7, 2023
12 checks passed
@MohamadJaara MohamadJaara deleted the feat/handle-code-update-and-delete-event branch August 7, 2023 09:53
github-merge-queue bot pushed a commit that referenced this pull request Aug 18, 2023
* feat: add use case to decide if a user can create password protected invite links [WPB-1531] (#1950)

* CanCreatePasswordProtectedLinksUseCase

* docs

* detekt

* test

* Update logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/guestroomlink/CanCreatePasswordProtectedLinksUseCase.kt

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>

---------

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>
Co-authored-by: Oussama Hassine <oussama.has100@gmail.com>

* feat: handle code update and delete events (#1960)

* CanCreatePasswordProtectedLinksUseCase

* docs

* detekt

* test

* feat: handle code update and delete event

* test

* code delete code

* inject handler

* detekt

* add fake value for is password protected

* add has password to event DTO

* missing any

* fix test

* detekt

* db migration

* typo in db migration

* Update logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/conversation/CodeDeletedHandler.kt

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>

* Update logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/conversation/CodeUpdateHandlerTest.kt

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>

* file name

* fix(tests): fix e2ei mock order timing

---------

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>
Co-authored-by: Mojtaba Chenani <chenani@outlook.com>

* feat: create password protected conv invite link (#1982)

* CanCreatePasswordProtectedLinksUseCase

* docs

* detekt

* test

* feat: handle code update and delete event

* test

* code delete code

* inject handler

* detekt

* add fake value for is password protected

* add has password to event DTO

* missing any

* fix test

* detekt

* db migration

* typo in db migration

* Update logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/conversation/CodeDeletedHandler.kt

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>

* Update logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/conversation/CodeUpdateHandlerTest.kt

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>

* file name

* fix(tests): fix e2ei mock order timing

* support api v4 for password protected invite links

* fix: unresolved reference

* fix merge issues

* feat: generate password protected guest link

* add test

* detekt

* fix test

---------

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>
Co-authored-by: Mojtaba Chenani <chenani@outlook.com>

* feat: propagate if a guest link is password protected (#1985)

* CanCreatePasswordProtectedLinksUseCase

* docs

* detekt

* test

* feat: handle code update and delete event

* test

* code delete code

* inject handler

* detekt

* add fake value for is password protected

* add has password to event DTO

* missing any

* fix test

* detekt

* db migration

* typo in db migration

* Update logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/conversation/CodeDeletedHandler.kt

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>

* Update logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/conversation/CodeUpdateHandlerTest.kt

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>

* file name

* fix(tests): fix e2ei mock order timing

* support api v4 for password protected invite links

* fix: unresolved reference

* fix merge issues

* feat: generate password protected guest link

* add test

* detekt

* fix test

* feat: propagate if a guest link is password protected

---------

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>
Co-authored-by: Mojtaba Chenani <chenani@outlook.com>

* merge issue

---------

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>
Co-authored-by: Oussama Hassine <oussama.has100@gmail.com>
Co-authored-by: Mojtaba Chenani <chenani@outlook.com>
github-merge-queue bot pushed a commit that referenced this pull request Aug 25, 2023
* feat: add use case to decide if a user can create password protected invite links [WPB-1531] (#1950)

* CanCreatePasswordProtectedLinksUseCase

* docs

* detekt

* test

* Update logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/guestroomlink/CanCreatePasswordProtectedLinksUseCase.kt

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>

---------

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>
Co-authored-by: Oussama Hassine <oussama.has100@gmail.com>

* feat: handle code update and delete events (#1960)

* CanCreatePasswordProtectedLinksUseCase

* docs

* detekt

* test

* feat: handle code update and delete event

* test

* code delete code

* inject handler

* detekt

* add fake value for is password protected

* add has password to event DTO

* missing any

* fix test

* detekt

* db migration

* typo in db migration

* Update logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/conversation/CodeDeletedHandler.kt

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>

* Update logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/conversation/CodeUpdateHandlerTest.kt

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>

* file name

* fix(tests): fix e2ei mock order timing

---------

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>
Co-authored-by: Mojtaba Chenani <chenani@outlook.com>

* feat: create password protected conv invite link (#1982)

* CanCreatePasswordProtectedLinksUseCase

* docs

* detekt

* test

* feat: handle code update and delete event

* test

* code delete code

* inject handler

* detekt

* add fake value for is password protected

* add has password to event DTO

* missing any

* fix test

* detekt

* db migration

* typo in db migration

* Update logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/conversation/CodeDeletedHandler.kt

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>

* Update logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/conversation/CodeUpdateHandlerTest.kt

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>

* file name

* fix(tests): fix e2ei mock order timing

* support api v4 for password protected invite links

* fix: unresolved reference

* fix merge issues

* feat: generate password protected guest link

* add test

* detekt

* fix test

---------

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>
Co-authored-by: Mojtaba Chenani <chenani@outlook.com>

* feat: propagate if a guest link is password protected (#1985)

* CanCreatePasswordProtectedLinksUseCase

* docs

* detekt

* test

* feat: handle code update and delete event

* test

* code delete code

* inject handler

* detekt

* add fake value for is password protected

* add has password to event DTO

* missing any

* fix test

* detekt

* db migration

* typo in db migration

* Update logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/conversation/CodeDeletedHandler.kt

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>

* Update logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/conversation/CodeUpdateHandlerTest.kt

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>

* file name

* fix(tests): fix e2ei mock order timing

* support api v4 for password protected invite links

* fix: unresolved reference

* fix merge issues

* feat: generate password protected guest link

* add test

* detekt

* fix test

* feat: propagate if a guest link is password protected

---------

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>
Co-authored-by: Mojtaba Chenani <chenani@outlook.com>

* merge issue

* feat: implement cert pinning

* detekt

* detekt

* feat: add cert pinning config

* detekt

* fix CLI and test service

* test

* address PR comments

* add cert pinning config as val instead of fun

---------

Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>
Co-authored-by: Oussama Hassine <oussama.has100@gmail.com>
Co-authored-by: Mojtaba Chenani <chenani@outlook.com>
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.

3 participants