Open Bug 1861459 Opened 2 years ago Updated 1 year ago

[lib-state] Remove `BrowsingModeManager` and track Private Browsing Mode in the `AppStore` exclusively

Categories

(Firefox for Android :: Homepage, enhancement, P3)

All
Android
enhancement

Tracking

()

ASSIGNED

People

(Reporter: matt-tighe, Assigned: matt-tighe)

References

(Blocks 3 open bugs)

Details

(Whiteboard: [fxdroid][group1])

Attachments

(4 files, 7 obsolete files)

59 bytes, text/x-github-pull-request
Details | Review
5.55 MB, video/mp4
Details
59 bytes, text/x-github-pull-request
Details | Review
59 bytes, text/x-github-pull-request
Details | Review

The BrowsingModeManager is a utility class that tracks changes to the Private Browsing Mode.

Utility classes like this do not follow architecture best practices. Instead of tracking this state in a one-off class, it should be tracked in the Store.

Remove BrowsingModeManager and replace its usages with State reads from the AppStore as well as Actions that update the AppStore.

Depends on: 1861455
Whiteboard: [fxdroid]
Blocks: 1857657
See Also: → 1867689
Blocks: 1872945

For QA:

This is a fairly large refactor of most things related to private browsing mode. I thought it might make it easier on your end to be able to do a large smoke test of these changes, rather than address them individually. Hope that was an okay assumption. There should be no change in functionality from what previously existed.

I tried to make a list of the areas this patch touches. It may not be completely exhaustive, so it would be great to add anything from existing test suites that relate to private browsing mode.

Mode retained across app sessions
Mode inherited from a deep link
Window is in secure mode while in private mode if setting is enabled
PBM button
New tabs from long-press on tab counter
New tabs from tabs tray
Tabs tray opens in correct mode from Home Screen and browser screen
Long-press top site to open in PBM
Opening tabs from bookmarks
Opening tabs from history
Opening tabs from history groups
Opening recently closed private tab
Addons report button and settings open tabs in private mode if app is in private mode
Reader mode gets themed differently
Recent tabs section visibility and recent bookmarks count metrics not reported in private mode
Standard homepage view metric not incremented when in private mode
Wallpapers onboarding not shown in private mode
Search suggestions not shown in private mode if settings is enabled

Flags: qe-verify+
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 123 Branch

Hi,
I've tried covering all the points mentioned in comment 1 to be tested by going through the steps on some of the test cases we have that cover the mentioned scenarios.
No issues were found.
Build tested Nightly 123.0a1 (from 2024-01-10).
Device used for testing: Samsung Galaxy S23 Ultra (Android 14).
Marking the ticket as verified for 123.

Flags: qe-verify+
Regressions: 1874078
Regressions: 1875187

I've encountered this issue:

  1. Open the private browsing homescreen on Fenix nightly 123.0a1.
  2. Send the app in the background and kill it (remove also from recently used apps).
  3. Re-open Fenix. Observe the homescreen.

Actual result: Firefox for Android opens in normal browsing mode.
Not reproducible on Beta 122.0b9, nor on RC 122.0 with the same Google Pixel 6 (Android 14) device.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 123 Branch → ---
Status: REOPENED → RESOLVED
Closed: 1 year ago1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 124 Branch
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Whiteboard: [fxdroid] → [fxdroid][group1]
See Also: → 1888747
Blocks: 1889002
Attachment #9394030 - Attachment is obsolete: true
Attachment #9394029 - Attachment is obsolete: true
Attachment #9394028 - Attachment is obsolete: true
Attachment #9394027 - Attachment is obsolete: true
Attachment #9394026 - Attachment is obsolete: true
Attachment #9394025 - Attachment is obsolete: true
Attachment #9394024 - Attachment is obsolete: true
Status: REOPENED → ASSIGNED
Target Milestone: 124 Branch → ---
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: