Android
Android copied to clipboard
Android crash: Exception kotlin.UninitializedPropertyAccessException: lateinit property listener has not been initialized
Task/Issue URL: https://app.asana.com/0/488551667048375/1203023500295199/f
Description
Updated to use dismissNow() instead of dismiss() for App Enjoyment dialog.
Steps to test this PR
See the crash:
- [ ] Enable Don't keep activities. This can be reproduced without this, however it involves more steps and it's not 100% reproducible.
- [ ] Checkout the develop branch. Comment out the below lines in order to make sure the App Enjoyment dialog is displayed once when opening the app. https://github.com/duckduckgo/Android/blob/develop/app/src/main/java/com/duckduckgo/app/global/rating/ShowInitialPromptDecider.kt#L33-L36 https://github.com/duckduckgo/Android/blob/develop/app/src/main/java/com/duckduckgo/app/global/rating/PromptTypeDecider.kt#L45-L47 https://github.com/duckduckgo/Android/blob/develop/app/src/main/java/com/duckduckgo/app/global/rating/PromptTypeDecider.kt#L54-L57
- [ ] Fresh install the app after making the above code changes.
- [ ] Open the app, tap on "Let's Do It!", dismiss the default browser prompt.
- [ ] Notice the App Enjoyment dialog, don't touch it.
- [ ] Put the app in background / foreground at least 3 times.
- [ ] Tap on "IT NEEDS WORK"
- [ ] Tap on "NO THANKS"
- [ ] Do this until there are no dialogs (the dialog appears multiple times).
- [ ] See the app crashing.
Test the fix:
- [ ] Enable Don't keep activities. This can be reproduced without this, however it involves more steps and it's not 100% reproducible.
- [ ] Checkout this branch. Comment out the below lines in order to make sure the App Enjoyment dialog is displayed once when opening the app. https://github.com/duckduckgo/Android/blob/develop/app/src/main/java/com/duckduckgo/app/global/rating/ShowInitialPromptDecider.kt#L33-L36 https://github.com/duckduckgo/Android/blob/develop/app/src/main/java/com/duckduckgo/app/global/rating/PromptTypeDecider.kt#L45-L47 https://github.com/duckduckgo/Android/blob/develop/app/src/main/java/com/duckduckgo/app/global/rating/PromptTypeDecider.kt#L54-L57
- [ ] Fresh install the app after making the above code changes.
- [ ] Open the app, tap on "Let's Do It!", dismiss the default browser prompt.
- [ ] Notice the App Enjoyment dialog, don't touch it.
- [ ] Put the app in background / foreground at least 3 times.
- [ ] Tap on "IT NEEDS WORK"
- [ ] Tap on "NO THANKS"
- [ ] Do this until there are no dialogs (the dialog appears twice).
- [ ] See the app is NOT crashing.