Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content

Issue 5166: Prevent crash at start

Sayantan Roychowdhury requested to merge 5166-crash_at_start into main

Description

Prevent App Lounge would crash at start in some rare cases.

Issue(s)

https://gitlab.e.foundation/e/backlog/-/issues/5166

Test environment

Gradle build against 5166-crash_at_start branch, install the apk into the device

Test procedures

This crash is somewhat related to https://gitlab.e.foundation/e/backlog/-/issues/4924
This crash happens very rarely and could not be reliably reproduced.
The best chance of getting this crash:

  1. Freshly install App Lounge.
  2. Accept TOS.
  3. Close App Lounge, force stop from App Info screen.
  4. Re-open app lounge. Now HomeFragment should call SignInFragment and here is the best chance where it might have crashed before this code change.

Technical details

This crash probably happens because navigation controller is called multiple times is quick succession from HomeFragment.onTosAccepted().
To prevent that, a function NavController.safeNavigate is added.
Source: https://nezspencer.medium.com/navigation-components-a-fix-for-navigation-action-cannot-be-found-in-the-current-destination-95b63e16152e

Also the code is wrapped in try-catch to be sure.

Screenshots

Check list

  • Self review
  • Test procedure explained
  • Tested on fresh install
  • Tested applied as an update
  • License
  • Internal documentation
  • User documentation
Edited by Sayantan Roychowdhury

Merge request reports

Loading