element-hq / element-x-android

Android Matrix messenger application using the Matrix Rust Sdk and Jetpack Compose
GNU Affero General Public License v3.0
1k stars 136 forks source link

Fix crash when session is deleted on another client #3515

Closed bmarty closed 5 days ago

bmarty commented 5 days ago

Content

Protect call of isNativeSlidingSyncSupported and isUsingNativeSlidingSync, which can fail if the client is closed due to the session being deleted from another client.

Easier fix than changing the result type of those method to Result<Boolean>, also because at some point all those methods will just be removed.

First commit is protecting debug build only.

Motivation and context

Fix several reported rageshake:

Screenshots / GIFs

Tests

Tested devices

Checklist

github-actions[bot] commented 5 days ago

:iphone: Scan the QR code below to install the build (arm64 only) for this PR. QR code If you can't scan the QR code you can install the build via this link: https://i.diawi.com/JGegqm

sonarcloud[bot] commented 5 days ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

codecov[bot] commented 5 days ago

Codecov Report

Attention: Patch coverage is 20.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 82.67%. Comparing base (5c7ac76) to head (fa3796d). Report is 7 commits behind head on develop.

Files with missing lines Patch % Lines
...ndroid/features/roomlist/impl/RoomListPresenter.kt 33.33% 0 Missing and 2 partials :warning:
...es/network/interceptors/FormattedJsonHttpLogger.kt 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #3515 +/- ## =========================================== - Coverage 82.67% 82.67% -0.01% =========================================== Files 1731 1731 Lines 40863 40867 +4 Branches 4971 4973 +2 =========================================== + Hits 33785 33786 +1 - Misses 5315 5317 +2 - Partials 1763 1764 +1 ```

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