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 #4286

Closed david-livefront closed 2 weeks ago

david-livefront commented 2 weeks ago

šŸŽŸļø Tracking

PM-14805

šŸ“” Objective

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 2 weeks ago

Logo Checkmarx One ā€“ Scan Summary & Details ā€“ 7d7bfc84-b099-4771-bc41-dd87201a648e

No New Or Fixed Issues Found

codecov[bot] commented 2 weeks ago

Codecov Report

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

Project coverage is 89.01%. Comparing base (771e719) to head (82bd1be). Report is 3 commits behind head on main.

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 @@ ## main #4286 +/- ## ========================================== + Coverage 88.98% 89.01% +0.03% ========================================== Files 452 453 +1 Lines 38947 39059 +112 Branches 5479 5480 +1 ========================================== + Hits 34656 34768 +112 Misses 2369 2369 Partials 1922 1922 ```

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

david-livefront commented 2 weeks ago

Thanks @SaintPatrck & @dseverns-livefront