Remove runBlocking call to restore sessions when the app starts#6193
Remove runBlocking call to restore sessions when the app starts#6193jmartinesp merged 6 commits intodevelopfrom
runBlocking call to restore sessions when the app starts#6193Conversation
|
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6193 +/- ##
===========================================
- Coverage 81.42% 81.42% -0.01%
===========================================
Files 2570 2571 +1
Lines 69799 69802 +3
Branches 8950 8950
===========================================
Hits 56833 56833
- Misses 9645 9649 +4
+ Partials 3321 3320 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3224995 to
0e64d9c
Compare
|
FWIW I've been using a release version with the latest changes of this branch for the past couple of days and I've had no issues with restoration either when coming back to the app through the launcher, or when using incoming share or opening notifications. |
|
I've been using this for a week in a day-to-day scenario and had no issues, so it seems fine to merge this if we're comfortable with the changes. |
| /** | ||
| * Restore the saved state for navigation in the current backstack. | ||
| * | ||
| * **WARNING:** this is an unsafe operation abusing the internals of the Appyx library, but it's the only way allow async state |
There was a problem hiding this comment.
Maybe add a this warning in a comment above the line where Appyx version is set (here) too? Else I am pretty sure we may miss to check this during the next Appyx lib upgrade (if there is any)
Sadly, to do this we need to manually handle restoring the state from Appyx using internal values. At least it doesn't seem like they're going to change any time soon (or ever). This should take care of a few ANRs, although it may make loading the initial state a bit slower
It was added twice because previously both instances logged a different message
… to its own file
f0a0042 to
13a48e4
Compare
|



Content
This should take care of a few ANRs, although it may make loading the initial state a bit slower (not that I noticed that myself).
This is touching the most critical part of the app, so we need to be extra careful when testing it.
Motivation and context
This
runBlockingwas a constant source of ANR issues. With this maybe the ANR rate will drop significantly.Tests
adb shell am kill io.element.android.x.debug. The logs in AS should display the app has been killed.I also tried this 'kill the app, then open it' flow with a share intent, so it seems like it can work on different scenarios and not just the base 'app opened' scenario.
Tested devices
Checklist