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: harden ClientCapabilityDTO for api v7 [WPB-14882] #3151

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from

Conversation

MohamadJaara
Copy link
Member

@MohamadJaara MohamadJaara commented Dec 6, 2024

StoryWPB-14882 [Android] harden ClientCapabilityDTO for api v7


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

make the ClientCapability accept any unknown values

Causes (Optional)

in the migration from 1pi 6 to 7 there may be a new values there

Solutions

harden the serilizer to accept unknown values

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.

Copy link
Member

@vitorhugods vitorhugods left a comment

Choose a reason for hiding this comment

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

Would be nice to write a test for this serialiser.

@MohamadJaara MohamadJaara changed the title feat: harden ClientCapabilityDTO for api v7 feat: harden ClientCapabilityDTO for api v7 [WPB-14882] Dec 6, 2024
Copy link
Contributor

github-actions bot commented Dec 6, 2024

Test Results

0 tests   - 3 341   0 ✅  - 3 234   0s ⏱️ - 5m 43s
0 suites  -   572   0 💤  -   107 
0 files    -   572   0 ❌ ±    0 

Results for commit f56f1ce. ± Comparison against base commit 5396afa.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Dec 6, 2024

@datadog-wireapp
Copy link

datadog-wireapp bot commented Dec 6, 2024

Datadog Report

Branch report: feat/harden-ClientCapabilityDTO-for-api-v7
Commit report: d407949
Test service: kalium-jvm

❌ 2 Failed (0 Known Flaky), 296 Passed, 12 Skipped, 15.12s Total Time

❌ Failed Tests (2)

  • givenAValidRegisterClientRequest_whenCallingTheRegisterClientEndpoint_theRequestShouldBeConfiguredCorrectly[jvm] - com.wire.kalium.api.v0.user.client.ClientApiV0Test - Details

    Expand for error
     java.lang.AssertionError: expected:<ClientDTO(cookie=sldkfmdeklmwldwlek23kl44mntiuepfojfndkjd, registrationTime=2021-05-12T10:52:02.671Z, lastActive=2021-05-12T10:52:02.671Z, model=model, clientId=defkrr8e7grgsoufhg8, type=permanent, deviceType=phone, capabilities=[LegalHoldImplicitConsent], label=label, mlsPublicKeys=null)> but was:<ClientDTO(cookie=sldkfmdeklmwldwlek23kl44mntiuepfojfndkjd, registrationTime=2021-05-12T10:52:02.671Z, lastActive=2021-05-12T10:52:02.671Z, model=model, clientId=defkrr8e7grgsoufhg8, type=permanent, deviceType=phone, capabilities=[Unknown(name=LegalHoldImplicitConsent)], label=label, mlsPublicKeys=null)>
     
     java.lang.AssertionError: expected:<ClientDTO(cookie=sldkfmdeklmwldwlek23kl44mntiuepfojfndkjd, registrationTime=2021-05-12T10:52:02.671Z, lastActive=2021-05-12T10:52:02.671Z, model=model, clientId=defkrr8e7grgsoufhg8, type=permanent, deviceType=phone, capabilities=[LegalHoldImplicitConsent], label=label, mlsPublicKeys=null)> but was:<ClientDTO(cookie=sldkfmdeklmwldwlek23kl44mntiuepfojfndkjd, registrationTime=2021-05-12T10:52:02.671Z, lastActive=2021-05-12T10:52:02.671Z, model=model, clientId=defkrr8e7grgsoufhg8, type=permanent, deviceType=phone, capabilities=[Unknown(name=LegalHoldImplicitConsent)], label=label, mlsPublicKeys=null)>
     	at org.junit.Assert.fail(Assert.java:89)
     	at org.junit.Assert.failNotEquals(Assert.java:835)
     	at org.junit.Assert.assertEquals(Assert.java:120)
     	at kotlin.test.junit.JUnitAsserter.assertEquals(JUnitSupport.kt:32)
     	at kotlin.test.AssertionsKt__AssertionsKt.assertEquals(Assertions.kt:63)
     	at kotlin.test.AssertionsKt.assertEquals(Unknown Source)
     	at kotlin.test.AssertionsKt__AssertionsKt.assertEquals$default(Assertions.kt:62)
     ...
    
  • givenAValidRegisterClientRequest_whenCallingTheRegisterClientEndpointWithOldFormat_theRequestShouldBeConfiguredCorrectly[jvm] - com.wire.kalium.api.v0.user.client.ClientApiV0Test - Details

    Expand for error
     java.lang.AssertionError: expected:<ClientDTO(cookie=sldkfmdeklmwldwlek23kl44mntiuepfojfndkjd, registrationTime=2021-05-12T10:52:02.671Z, lastActive=2021-05-12T10:52:02.671Z, model=model, clientId=defkrr8e7grgsoufhg8, type=permanent, deviceType=phone, capabilities=[LegalHoldImplicitConsent], label=label, mlsPublicKeys=null)> but was:<ClientDTO(cookie=sldkfmdeklmwldwlek23kl44mntiuepfojfndkjd, registrationTime=2021-05-12T10:52:02.671Z, lastActive=2021-05-12T10:52:02.671Z, model=model, clientId=defkrr8e7grgsoufhg8, type=permanent, deviceType=phone, capabilities=[Unknown(name=LegalHoldImplicitConsent)], label=label, mlsPublicKeys=null)>
     
     java.lang.AssertionError: expected:<ClientDTO(cookie=sldkfmdeklmwldwlek23kl44mntiuepfojfndkjd, registrationTime=2021-05-12T10:52:02.671Z, lastActive=2021-05-12T10:52:02.671Z, model=model, clientId=defkrr8e7grgsoufhg8, type=permanent, deviceType=phone, capabilities=[LegalHoldImplicitConsent], label=label, mlsPublicKeys=null)> but was:<ClientDTO(cookie=sldkfmdeklmwldwlek23kl44mntiuepfojfndkjd, registrationTime=2021-05-12T10:52:02.671Z, lastActive=2021-05-12T10:52:02.671Z, model=model, clientId=defkrr8e7grgsoufhg8, type=permanent, deviceType=phone, capabilities=[Unknown(name=LegalHoldImplicitConsent)], label=label, mlsPublicKeys=null)>
     	at org.junit.Assert.fail(Assert.java:89)
     	at org.junit.Assert.failNotEquals(Assert.java:835)
     	at org.junit.Assert.assertEquals(Assert.java:120)
     	at kotlin.test.junit.JUnitAsserter.assertEquals(JUnitSupport.kt:32)
     	at kotlin.test.AssertionsKt__AssertionsKt.assertEquals(Assertions.kt:63)
     	at kotlin.test.AssertionsKt.assertEquals(Unknown Source)
     	at kotlin.test.AssertionsKt__AssertionsKt.assertEquals$default(Assertions.kt:62)
     ...
    

@yamilmedina yamilmedina enabled auto-merge December 6, 2024 22:49
@yamilmedina yamilmedina changed the base branch from develop to release/candidate December 9, 2024 10:20
@yamilmedina yamilmedina self-requested a review December 12, 2024 14:51
Copy link
Contributor

@yamilmedina yamilmedina left a comment

Choose a reason for hiding this comment

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

The tests are failing, and sounds a good idea to have for v8.
The code freeze v7 is more clear now and new types will show up only in v8+

Then we can do the usual new API response support we do. @vitorhugods @MohamadJaara what do you think?

Created a PR in the meantime, with tests for retro compat endpoint.
#3173

@MohamadJaara MohamadJaara changed the base branch from release/candidate to develop December 16, 2024 09:38
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.

6 participants