Closed Bug 2073324 Opened 2 months ago Closed 16 days ago

[HNT] Private Browsing notification keeps coming back

Categories

(Firefox for Android :: Homepage, defect)

All
Android
defect

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- verified

People

(Reporter: tcampbell, Assigned: npoon)

References

(Blocks 3 open bugs)

Details

(Whiteboard: [fxdroid] [group5])

Attachments

(2 files, 1 external file)

In Private Browsing mode, if you swipe the notification to close tabs, the notification quickly comes back and suggests the action did not take. In reality the tabs were closed but a new private tab opened and a new notification appeared. It does not instill any confidence that we actually closed tabs / deleted data and appears like it might be a glitch.

This happens for straightforward and repeatable reasons if I am the app in private browsing mode, but I've also encountered it will entirely outside the app and the notification still reappears a could times (though not foreever). Unfortunately I don't have clear STR for this variant.

PrivateNotificationService.kt re-adds a private about:home tab and then calls refreshNotification() right after removePrivateTabs() when enableHomepageAsNewTab is set, so the private tab count never reaches zero and the stop-on-empty observer in AbstractPrivateNotificationService.kt never tears the notification down; those lines landed in bug 1962114. HomepageTabBinding.kt adds a private homepage tab on its own whenever the private list is empty and the activity is in private mode, which accounts for the reappearances with the app in the background.

Fix: Have the erase end the private session instead of recreating it: drop the addNewHomepageTab(private = true) and refreshNotification() calls and relaunch HomeActivity with PRIVATE_BROWSING_MODE = false, and limit HomepageTabBinding's implicit re-add to normal mode so the always-one-tab invariant is met by a normal homepage tab. PrivateNotificationServiceTest.kt asserts the current behavior and needs inverting alongside HomepageTabBindingTest.kt.

Note that I triaged from the description and the code: the attached screen recording is not something this tooling can view.

Suggested severity: S3. The private tabs really are deleted, so the harm is that the notification coming straight back reads as the erase having failed, and it is confined to builds with Homepage as a New Tab enabled.


If you'd like to provide feedback on this comment, please use the 👍 or 👎 reaction.
If you want to categorize your feedback you can add one of the following tags: ai-triage-wrong-file, ai-triage-wrong-cause, ai-triage-hallucination, ai-triage-out-of-scope, ai-triage-wrong-fix, ai-triage-shallow-fix.

Needinfo hackbot@mozilla.tld to have a patch generated for this bug, include any questions or directions as needed in your comment.

Severity: -- → S3
Whiteboard: [fxdroid] [group5]

This seems like an edge case because the user was on the (only) private browsing homepage when interacting with that notification and in homepage as new tab world, it is not possible to be left with no tabs in the current browsing mode. I'll confirm the desired behaviour here with product

Confirmed desired behaviour with product:

If the app is open in private mode, take them to the empty private tabs tray, same as closing the last tab from the tab strip. If the app is in the background, close the private tabs, switch back to normal mode, and don’t create a new private tab. The next launch then lands on their last normal tab and the notification stays gone. Either way, no new private tab after the erase.

Assignee: nobody → npoon
Status: NEW → ASSIGNED

(In reply to Nicholas Poon [:Nick] from comment #3)

Confirmed desired behaviour with product:

If the app is open in private mode, take them to the empty private tabs tray, same as closing the last tab from the tab strip. If the app is in the background, close the private tabs, switch back to normal mode, and don’t create a new private tab. The next launch then lands on their last normal tab and the notification stays gone. Either way, no new private tab after the erase.

This sounds like a nice behaviour to me.

If the app is in the background, close the private tabs, switch back to normal mode, and don’t create a new private tab. The next launch then lands on their last normal tab

I think this is a good behaviour for another reason, too:

If you swipe away the private tabs notification, the intent is probably to hide the fact that you were using private browsing at all. But the current behaviour of retaining the private mode status upon reopening the app reveals that you were just using private browsing (although not which sites you were privately browsing). So that's a tiny bit of information leakage which I think would be good to eliminate, aside from fixing this annoying persistent notification issue

It seems the concern I mentioned above is already documented under https://bugzilla.mozilla.org/show_bug.cgi?id=2067052 , which I think would also be fixed by such a change

PBM + foreground -> delete private tabs + navigate to empty private tabs tray
PBM + background -> delete private tabs + navigate to the most recent normal browsing mode tab or a new normal homepage if none exist
normal browsing mode -> delete private tabs

Blocks: 2094300
Blocks: 2094316

After this lands,
QA, can you please verify the fix? The cases that I tried were the following:

  • Click on the PBM notification on a PBM homepage
  • Click on the PBM notification on a PBM webpage
  • Click on the PBM notification on the PBM tabs tray
  • Click on the PBM notification when the app is backgrounded and in PBM
  • Click on the PBM notification in normal browsing mode homepage
  • Click on the PBM notification in normal browsing mode webpage
  • Click on the PBM notification in normal tabs tray
  • Click on the PBM notification when the app is backgrounded and in normal browsing mode

Please do test other cases that you may think of. Thank you

Flags: qe-verify+
Status: ASSIGNED → RESOLVED
Closed: 16 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch

Verified as fixed on the latest Nightly 162.0a1 from 18.11.2026 with Pixel 7 Pro (Android 17) and Xiaomi Pad5 (Android 13).

Duplicate of this bug: 2067052
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: