element-hq / element-hq/element-android
[Crash] Crash when putting the app into background while retrieving server configuration
- Dominant language
- Kotlin
- Stars
- 3.7k
- Forks
- 917
- PR merge metrics
- No merged PRs in 30d
Description
### Steps to reproduce
1. Start the create account flow
2. Open the screen to edit the homeserver
3. Click on NEXT you can keep `matrix.org`
4. While loading, put the app into background
### Outcome
#### What did you expect?
No crash, and putting the app back to foreground should restore the state.
#### What happened instead?
Crash running this code:
```kotlin
OnboardingViewEvents.OnHomeserverEdited -> {
supportFragmentManager.popBackStack( // Crash here
FRAGMENT_EDIT_HOMESERVER_TAG,
FragmentManager.POP_BACK_STACK_INCLUSIVE
)
ensureEditServerBackstack()
}
```
Stacktrace:
```
java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
at androidx.fragment.app.FragmentManager.checkStateLoss(FragmentManager.java:1610)
at androidx.fragment.app.FragmentManager.enqueueAction(FragmentManager.java:1650)
at androidx.fragment.app.FragmentManager.popBackStack(FragmentManager.java:795)
at im.vector.app.features.onboarding.ftueauth.FtueAuthVariant.handleOnboardingViewEvents(FtueAuthVariant.kt:235)
```
### Your phone model
Any
### Operating system version
Any
### Application version and app store
1.5.2 and probably older
### Homeserver
NA
### Will you send logs?
No
### Are you willing to provide a PR?
No
Contributor guide
Assessment
This issue has not been assessed yet.