fenix icon indicating copy to clipboard operation
fenix copied to clipboard

[Bug] Desktop mode toggle stuck at enabled. Includes reliable steps to reproduce it.

Open TrianguloY opened this issue 5 years ago • 12 comments

This bug has been reported several times (https://github.com/mozilla-mobile/fenix/issues/14737, https://github.com/mozilla-mobile/fenix/issues/13202, https://github.com/mozilla-mobile/fenix/issues/11552 and other closed issues) however none of them had a reliable way to trigger the bug, and it was practically irreproducible on an emulator. Here I present steps to reproduce it reliably on an emulator, so to avoid having this comment lost on one of the previous issues (as it has been with others) I decided to open a new issue.

Steps to reproduce

  1. REQUIRED: make sure the background process limit from the android developer options is set as 'no background processes'.
  2. Open this github (doesn't work with all pages, does work with this github repository)
  3. Enable desktop mode for the tab
  4. Press the recent apps button
  5. Open Firefox again

bug

Expected behavior

The page should still be in desktop mode (or alternatively but not desired, go back to mobile mode with the desktop mode switch disabled)

Actual behavior

The page goes back to mobile mode but the desktop mode switch is kept enabled. Pressing it does nothing.

Device information

  • Android device: Emulator 30.0.26-6755297 --- 8.1 (Oreo) - API 27
  • Fenix version: debug 1.0.2039 (TrianguoY fork, master branch, no modifications) but can be reproduced in nightly since a few months ago at least.

┆Issue is synchronized with this Jira Task

TrianguloY avatar Sep 23 '20 17:09 TrianguloY

I found another set of steps to reproduce this issue:

  1. Open any website in a new tab.
  2. Open the main menu and request the desktop version of that website.
  3. Close the tab, and immediately tap on "Undo" in the "Tab closed" snackbar.
  4. The tab should restore itself, and opens the mobile version of the site.
  5. Open the main menu, and observe the desktop site toggle: it is in the enabled state, even when the website is not the desktop version. Tapping on it does not change the state.

SL-Lee avatar Sep 27 '20 08:09 SL-Lee

This is reproducible on sample browser also. Although the session reports it is in desktop mode, on session add the loaded version of the website is the mobile one. We can force a reload, but we lack the API to condition the reload. The true desktop/ mobile version check seems to depend on: https://bugzilla.mozilla.org/show_bug.cgi?id=1653296.

mcarare avatar Sep 29 '20 11:09 mcarare

With the second STR (https://github.com/mozilla-mobile/fenix/issues/15352#issuecomment-699603805) this is not reproducible anymore. On page restore the page loads the mobile version, and the switch is set accordingly. However, limiting background processes still reproduces the issue.

mcarare avatar Nov 19 '20 18:11 mcarare

At the moment we do not have any access to an API to check if the desktop version is loaded in a session. Also, considering the only reproducible STR involves limiting background processes (acts somewhat different than the system closing a process due to memory restrictions) this should not be a priority, and it is likely to be solved along with the implementation of other suggestions for desktop mode, like https://github.com/mozilla-mobile/fenix/issues/11552.

mcarare avatar Nov 24 '20 12:11 mcarare

@mcarare I was able to just reproduce it by opening the tab in desktop mode, opening a second heavy tab and navigating a minute or so there, and then switching back to the first tab. The tab was in mobile mode and the desktop switch was stuck on enabled. Version Nightly 201122 17:03 (Build #2015777163)

I may be wrong, please correct me otherwise by sharing an official documentation where it is explained, but the limit background processes toggle is exactly what android does, but instead of waiting to have low memory it just does it right away. On high end devices or emulators having low memory usually never happens, and that toggle serves to 'emulate' it.

Note that switching to another app and then reopening firefox doesn't seem to work. I haven't tested, but my theory is that only the tab process should be killed, not the whole app, for this bug to occur.

TrianguloY avatar Nov 24 '20 13:11 TrianguloY

See: https://github.com/mozilla-mobile/fenix/issues/17373 This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 23 '21 16:05 stale[bot]

Still happens on latest Firefox Nightly when a tab is unloaded for memory pressure - I still hit this pretty regularly.

The easiest way I know of to fix the issue is to close the tab and then do re-open tab. You can then re-enter desktop browsing mode.

samlh avatar May 23 '21 22:05 samlh

Firefox 89.1.1 Not reproducible on: Samsung Galaxy A20s (Android 10) Reproducible on: Samsung Galaxy J2 Prime (Android 6.0.1)

Tested with "No background processes" switch enabled, on Samsung Galaxy A20s page after resuming still was in desktop mode.

Nickoriginal avatar Jul 04 '21 17:07 Nickoriginal

See: https://github.com/mozilla-mobile/fenix/issues/17373 This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 31 '21 21:12 stale[bot]

I just tested the steps on a real device and they still reproduce the bug. This is NOT fixed. The alternate steps about closing and pressing undo, however, seem to be fixed.

TrianguloY avatar Dec 31 '21 22:12 TrianguloY

Someone ought to shoot @stale bot to make it dump core.

Noob729 avatar May 30 '22 23:05 Noob729

Just a reminder that this is still an issue on Firefox v104 and beyond annoying.

Screenshot_20220919-160654_Firefox

TheBrokenRail avatar Sep 19 '22 20:09 TheBrokenRail

Can we talk about the fact that this issue has been here since even fenix's stable release and it's still a thing in Firefox 105?

severtheskyline avatar Sep 25 '22 20:09 severtheskyline

Moved to bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1807153

Change performed by the Move to Bugzilla add-on.

csadilek avatar Dec 22 '22 20:12 csadilek