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 crash when session is deleted on another client #3515

Merged
merged 2 commits into from
Sep 23, 2024

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Sep 23, 2024

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

  • Delete the current session from another client and observe that the app is not crashing anymore.

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 23
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • Pull request includes a sign off
  • You've made a self review of your PR

@bmarty bmarty requested a review from a team as a code owner September 23, 2024 07:41
@bmarty bmarty requested review from jmartinesp and removed request for a team September 23, 2024 07:41
Copy link
Contributor

📱 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

Copy link

sonarcloud bot commented Sep 23, 2024

Copy link

codecov bot commented Sep 23, 2024

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 ⚠️
...es/network/interceptors/FormattedJsonHttpLogger.kt 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bmarty bmarty added the PR-Bugfix For bug fix label Sep 23, 2024
Copy link
Member

@jmartinesp jmartinesp left a comment

Choose a reason for hiding this comment

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

Thanks! I didn't take into account scope cancellation when I said this couldn't fail 😓 .

@bmarty bmarty added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Sep 23, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Sep 23, 2024
@bmarty bmarty merged commit 280f738 into develop Sep 23, 2024
33 of 34 checks passed
@bmarty bmarty deleted the feature/bma/fixRageshakeCrash branch September 23, 2024 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Bugfix For bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants