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: e2ei endpoint is called even when the feature is disabled #2508

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

it can happen that e2ei endpoint is called with empty URL when it is disabled

Solutions

small refactor to make sure it cann't be called when it is not enabled

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.

@@ -22,7 +22,7 @@ import kotlinx.datetime.Instant

data class E2EISettings(
val isRequired: Boolean,
val discoverUrl: String,
val discoverUrl: String?,
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 url can be null even when the feature is enabled 😢

}
}
}
}

override fun discoveryUrl(): Either<CoreFailure, String> =
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 idea of this function is to have a central place where the errors with e2ei url are caught

@@ -203,7 +203,7 @@ data class TeamSettingsSelfDeletionStatusEntity(
@Serializable
data class E2EISettingsEntity(
@SerialName("status") val status: Boolean,
@SerialName("discoverUrl") val discoverUrl: String,
@SerialName("discoverUrl") val discoverUrl: String?,
Copy link
Member Author

Choose a reason for hiding this comment

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

according to swagger this URL can be null

Copy link
Contributor

github-actions bot commented Feb 17, 2024

Test Results

2 797 tests   2 668 ✔️  32s ⏱️
   483 suites     129 💤
   483 files           0

Results for commit b1163e3.

♻️ This comment has been updated with latest results.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Feb 17, 2024

Datadog Report

All test runs 9648e11 🔗

2 Total Test Services: 0 Failed, 2 Passed

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Wall Time Test Service View
kalium-ios 0 0 0 2668 129 11m 39.14s Link
kalium-jvm 0 0 0 2793 123 8m 58.04s Link

@codecov-commenter
Copy link

codecov-commenter commented Feb 17, 2024

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

❗ No coverage uploaded for pull request base (release/candidate@a6c31af). Click here to learn what that means.

Additional details and impacted files
@@                 Coverage Diff                  @@
##             release/candidate    #2508   +/-   ##
====================================================
  Coverage                     ?   58.39%           
  Complexity                   ?       21           
====================================================
  Files                        ?     1171           
  Lines                        ?    45336           
  Branches                     ?     4292           
====================================================
  Hits                         ?    26472           
  Misses                       ?    16940           
  Partials                     ?     1924           
Files Coverage Δ
...onMain/kotlin/com/wire/kalium/logic/CoreFailure.kt 20.00% <ø> (ø)
...om/wire/kalium/logic/configuration/E2EISettings.kt 83.33% <100.00%> (ø)
...ium/logic/data/featureConfig/FeatureConfigModel.kt 100.00% <100.00%> (ø)
...feature/featureConfig/handler/E2EIConfigHandler.kt 100.00% <100.00%> (ø)
...henticated/featureConfigs/FeatureConfigResponse.kt 83.52% <100.00%> (ø)
...ire/kalium/persistence/config/UserConfigStorage.kt 72.87% <100.00%> (ø)
...feature/featureConfig/SyncFeatureConfigsUseCase.kt 85.29% <50.00%> (ø)
...c/data/e2ei/CertificateRevocationListRepository.kt 70.96% <33.33%> (ø)
.../com/wire/kalium/logic/data/e2ei/E2EIRepository.kt 79.67% <90.47%> (ø)
...um/logic/data/featureConfig/FeatureConfigMapper.kt 69.47% <50.00%> (ø)

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 a6c31af...b1163e3. Read the comment docs.

@MohamadJaara MohamadJaara requested review from mchenani, borichellow and ohassine and removed request for mchenani and borichellow February 19, 2024 08:09
@MohamadJaara MohamadJaara merged commit 03380f8 into release/candidate Feb 19, 2024
17 checks passed
@MohamadJaara MohamadJaara deleted the fix/e2ei-url-is-mapped-to-empty-string-when-missing branch February 19, 2024 09:15
github-actions bot pushed a commit that referenced this pull request Feb 19, 2024
* fix: e2ei endpoint is called even when the feature is disabled

* detekt

* revert unwanted change

* revert unwanted change
github-merge-queue bot pushed a commit that referenced this pull request Feb 21, 2024
#2511)

* fix: e2ei endpoint is called even when the feature is disabled

* detekt

* revert unwanted change

* revert unwanted change

Co-authored-by: Mohamad Jaara <[email protected]>
Co-authored-by: Mojtaba Chenani <[email protected]>
jschumacher-wire pushed a commit that referenced this pull request Mar 6, 2024
#2511)

* fix: e2ei endpoint is called even when the feature is disabled

* detekt

* revert unwanted change

* revert unwanted change

Co-authored-by: Mohamad Jaara <[email protected]>
Co-authored-by: Mojtaba Chenani <[email protected]>
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