-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit ddb18f9
authored
Fix an issue with inaccessible Duck.ai fragment (#6850)
Task/Issue URL:
https://app.asana.com/1/137249556945/project/1208671518894266/task/1211468322303343?focus=true
### Description
Fixes an issue with inaccessible Duck.ai fragment that could happen
after failed fragment state transaction.
If the Duck.ai close transition finished after `onSaveInstanceState`,
the fragment container would be hidden but the fragment itself wouldn't.
This led to an invalid state where the app thought the fragment was
visible, preventing it from ever re-launching, but its container was
`gone`.
To resolve the issue, this PR:
1. Allows for lossy fragment transaction when closing Duck.ai. This
resolves any potential crashes that
#6839 attempted to fix.
2. Checks for fragment and its container state consistency when trying
to open Duck.ai. This prevents any state locks in rare cases where
activity is restored from saved state after being in Duck.ai mode.
### Steps to test this PR
The issue was mostly reproducible for me in `release` variant and with
Input Screen enabled, because on New Tab Page the Input Screen reopens
after closing Duck.ai fragment which has a higher likelihood of
canceling the transitions.
- [x] Enable Input Screen.
- [x] Open New Tab Page.
- [x] Open Input Screen.
- [x] Send a prompt to Duck.ai.
- [x] Go back and reopen the Input Screen.
- [x] Send another prompt to Duck.ai and verify it correctly opens.1 parent 4ae34fa commit ddb18f9Copy full SHA for ddb18f9
File tree
Expand file treeCollapse file tree
1 file changed
+138
-125
lines changedFilter options
- app/src/main/java/com/duckduckgo/app/browser
Expand file treeCollapse file tree
1 file changed
+138
-125
lines changed
0 commit comments