Back navigation gets broken on HistoryFragment when device theme has changed.
Categories
(Firefox for Android :: History, defect, P2)
Tracking
()
People
(Reporter: kaya, Assigned: npoon)
References
(Depends on 1 open bug, Regression)
Details
(Keywords: regression, Whiteboard: [fxdroid][group4])
Attachments
(2 files)
Steps to reproduce
- Navigate to History from Settings
- Go to device settings and change device theme (does not matter if it is to dark or to light)
- Come back to app and back press on History fragment.
Expected behavior
After back pressing on History fragment, we should navigate back to Home page.
Actual behavior
Back pressing causes a bug in the back stack entry, ending up taking app to the background. Because of the broken back stack, the user will never be able to go back to home page and continue browsing, only way would be killing&restarting the app.
| Reporter | ||
Updated•1 year ago
|
| Reporter | ||
Comment 1•1 year ago
|
||
Linking a potential regression cause. Needs confirmation.
Comment 2•1 year ago
|
||
Set release status flags based on info from the regressing bug 1842250
| Reporter | ||
Comment 3•1 year ago
|
||
I have a quick fix for this:
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/library/history/HistoryFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/library/history/HistoryFragment.kt
index 5de7644db371a..d0ac86bc93cd8 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/library/history/HistoryFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/library/history/HistoryFragment.kt
@@ -368,8 +368,12 @@ class HistoryFragment : LibraryPageFragment<History>(), UserInteractionHandler,
override fun onBackPressed(): Boolean {
// The state needs to be updated accordingly if Edit mode is active
- historyStore.dispatch(HistoryFragmentAction.BackPressed)
- return true
+ return if (historyStore.state.mode is HistoryFragmentState.Mode.Editing) {
+ historyStore.dispatch(HistoryFragmentAction.BackPressed)
+ true
+ } else {
+ false
+ }
}
override fun onDestroyView() {
But it may also be related to the order of backstack entries when app is resumed after the device theme has changed. It is worth checking out to have a better understanding of the root cause. I checked the backstack entries over adb and looks like the HomeFragment and HistoryFragment's order get switched. I'll unassign and clear the regression tags for now and come back when I'm not busy if this is not picked by then. Clearing severity as well.
| Reporter | ||
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Comment 4•1 year ago
|
||
While looking into it, also found that on theme change, other actions like opening recentlly closed and opening an item does not work. Also, trying to delete an item results in a crash.
Updated•1 year ago
|
Comment 5•1 year ago
|
||
:matt-tighe, since you are the author of the regressor, bug 1842250, could you take a look?
For more information, please visit BugBot documentation.
Comment 6•1 year ago
|
||
Set release status flags based on info from the regressing bug 1842250
Updated•1 year ago
|
Updated•1 year ago
|
| Assignee | ||
Comment 7•1 year ago
|
||
As discussed with Rahul offline, this issue is quite impactful as it not only impacts the back navigation but the entire history screen. After coming back to the app after a device theme change (step 3 in the STR), the whole history page practically does not work, with the exception only being share. To fully address the issue, it is best to do a history refactor. However, before that happens, there is no obvious way to address all of these problems. Thus, I have opened separate issues for every broken element in history after this theme change. I have linked them in the "See Also" section of this bug.
As a result, I think kaya's suggestion is indeed correct and can be used to close this ticket. All other issues with history can be fixed in the follow up bugs
| Assignee | ||
Comment 8•1 year ago
|
||
Updated•1 year ago
|
Comment 10•1 year ago
|
||
| bugherder | ||
Comment 11•1 year ago
|
||
The patch landed in nightly and beta is affected.
:npoon, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox132towontfix.
For more information, please visit BugBot documentation.
| Assignee | ||
Comment 12•1 year ago
|
||
Requesting QA to verify that the bug has been resolved before requesting uplift
Comment 13•1 year ago
|
||
Just for clarity, we're building the final Beta of the cycle on Friday before next week's RC. If the plan is to uplift this, we'll need the request pretty soon.
Comment 14•1 year ago
|
||
Verified as fixed in the latest Nightly 13.0a1 from 10/18 with Google Pixel 8 Pro (Android 14), OPPO A15s (Android 10)
and Lenovo Yoga Tab 11 (Android 12).
Updated•1 year ago
|
| Assignee | ||
Comment 15•1 year ago
|
||
Thanks for verifying, Delia! And thank you Ryan for the information! In that case, let's just keep this fix in 133 and let it ride the trains normally until release. This issue has been present for quite some time now so I think it's fine to leave it. It was also important to get verification before uplifting to make sure that history didn't break after the changes made.
Description
•