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

fix: commit bundles special api response handling (WPB-2229) #2296

Merged
merged 4 commits into from
Dec 8, 2023

Conversation

yamilmedina
Copy link
Contributor

@yamilmedina yamilmedina commented Dec 7, 2023


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

Commit bundles call, stopped handling stale messages and other 409 client based errors.

Causes (Optional)

While testing in real world, we realized that the /commit-bundles endpoints can return 409 with 2 different body

  • mls-stale-message and mls-client-mismatch with regular labeled body (label, message, status)
  • non_federating_backends with
{
  "non_federating_backends": [
    "example.com"
  ]
}

Solutions

Extend the special handling for 409 so we can allow commit bundles endpoint to always first try to handle status code based exceptions and if the parsing fails, handling it as federated errors.

Added more test coverage to bulletproof the endpoint handling.

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

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.

@yamilmedina yamilmedina requested review from typfel and a team December 7, 2023 15:13
@yamilmedina yamilmedina self-assigned this Dec 7, 2023
@yamilmedina yamilmedina requested review from alexandreferris, MohamadJaara, ohassine and saleniuk and removed request for a team December 7, 2023 15:13
Copy link
Contributor

github-actions bot commented Dec 7, 2023

Test Results

2 087 tests   - 605   2 045 ✔️  - 543   13s ⏱️ - 2m 19s
   394 suites  -   86        42 💤  -   62 
   394 files    -   86          0 ±    0 

Results for commit 404af3d. ± Comparison against base commit edee554.

This pull request removes 2692 and adds 2087 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 42 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.

@codecov-commenter
Copy link

Codecov Report

Merging #2296 (404af3d) into develop (edee554) will increase coverage by 0.00%.
The diff coverage is 92.30%.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #2296   +/-   ##
==========================================
  Coverage      58.55%   58.56%           
  Complexity        21       21           
==========================================
  Files           1093     1093           
  Lines          41541    41548    +7     
  Branches        3844     3844           
==========================================
+ Hits           24325    24331    +6     
- Misses         15589    15590    +1     
  Partials        1627     1627           
Files Coverage Δ
...tlin/com/wire/kalium/network/utils/NetworkUtils.kt 37.50% <92.30%> (+5.11%) ⬆️

... and 4 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 edee554...404af3d. Read the comment docs.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Dec 7, 2023

Datadog Report

All test runs cb10922 🔗

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 2045 42 8m 26.01s Link
kalium-jvm 0 0 0 2591 104 7m 23s Link

@yamilmedina yamilmedina added this pull request to the merge queue Dec 8, 2023
Merged via the queue into develop with commit 5d8695c Dec 8, 2023
17 checks passed
@yamilmedina yamilmedina deleted the fix/mls-commitbundle-fedreationerrors branch December 8, 2023 11:22
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