bitwarden / android

Bitwarden mobile app for Android.
https://bitwarden.com
GNU General Public License v3.0
6.56k stars 821 forks source link

PM-14805: Use network result in all Retrofit API requests #4290

Closed david-livefront closed 1 week ago

david-livefront commented 1 week ago

🎟ī¸ Tracking

PM-14805

📔 Objective

This is a hotfix PR, the main PR has already been merged into main.

This PR adds a new class called NetworkResult to the app and uses it in place of Result for all network requests.

This is done to avoid a ClassCastException that can occur where the Result in unnecessarily boxed creating a Result<Result<T>>. This should not happen with the new NetworkResult.

We will continue to use the regular Result everywhere else in the app.

⏰ Reminders before review

đŸĻŽ Reviewer guidelines

github-actions[bot] commented 1 week ago

Logo Checkmarx One – Scan Summary & Details – 1efbc03f-409a-4ab4-a5b8-1d9e42c2443b

New Issues

Severity Issue Source File / Package Checkmarx Insight
MEDIUM Privacy_Violation /app/src/main/java/com/x8bit/bitwarden/data/tools/generator/repository/utils/GeneratorRepositoryExtensions.kt: 11 Attack Vector
MEDIUM Privacy_Violation /app/src/main/java/com/x8bit/bitwarden/data/autofill/manager/AutofillTotpManagerImpl.kt: 29 Attack Vector
MEDIUM Privacy_Violation /app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationViewModel.kt: 341 Attack Vector
MEDIUM Privacy_Violation /app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationViewModel.kt: 341 Attack Vector
MEDIUM Privacy_Violation /app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountViewModel.kt: 94 Attack Vector
MEDIUM Privacy_Violation /app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationViewModel.kt: 240 Attack Vector
MEDIUM Privacy_Violation /app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationViewModel.kt: 251 Attack Vector
MEDIUM Privacy_Violation /app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationViewModel.kt: 262 Attack Vector
MEDIUM Unpinned Actions Full Length Commit SHA /crowdin-pull.yml: 26 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
LOW Unpinned Actions Full Length Commit SHA /crowdin-pull.yml: 26 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
LOW Use_of_Hardcoded_Password /app/src/main/java/com/x8bit/bitwarden/data/autofill/util/HtmlInfoExtensions.kt: 20 Attack Vector
codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 98.04688% with 5 lines in your changes missing coverage. Please review.

Please upload report for BASE (release/hotfix-v2024.11.4@ef01f27). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...tform/datasource/network/core/NetworkResultCall.kt 73.33% 1 Missing and 3 partials :warning:
.../datasource/network/service/AccountsServiceImpl.kt 98.14% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## release/hotfix-v2024.11.4 #4290 +/- ## ============================================================ Coverage ? 88.98% ============================================================ Files ? 440 Lines ? 38253 Branches ? 5345 ============================================================ Hits ? 34039 Misses ? 2349 Partials ? 1865 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

david-livefront commented 1 week ago

Thanks @dseverns-livefront