Closed Bug 1789390 Opened 2 years ago Closed 2 years ago

Windows notification is shown after invoking the background task 3 times and Firefox is uninstalled

Categories

(Toolkit Graveyard :: Notifications and Alerts, defect)

Desktop
Windows
defect

Tracking

(firefox-esr91 unaffected, firefox-esr102 unaffected, firefox104 unaffected, firefox105 unaffected, firefox106 verified)

VERIFIED FIXED
106 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox-esr102 --- unaffected
firefox104 --- unaffected
firefox105 --- unaffected
firefox106 --- verified

People

(Reporter: Gabi, Assigned: nrishel)

References

(Blocks 2 open bugs, Regression)

Details

(Keywords: regression, Whiteboard: [fidedi-notifications])

Attachments

(3 files)

Attached image notificationtoast.png

Note

  • Have the messaging-system.rsexperimentloader.collection_id pref set to nimbus-preview
  • Have nimbus.debug set to true
  • Background update task is present in Task scheduler

Affected versions

  • Nightly 106.0a1

Affected platforms

  • Windows 10 x64
  • Windows 11 x64

Steps to reproduce

  1. Install a older version of Nightly 106
  2. Launch Nightly with the default elevated profile
  3. Run the Background Update task inside the Task Scheduler
  4. Windows native notification is shown
  5. Invoke the task 3 times and click remind me later button on the notifications
  6. Uninstall Nightly
  7. Check that the background update task is deleted from the Task Scheduler
  8. Check if any other notifications are displayed

Expected result

  • Windows native notification is not displayed after invoking the background task 3 times and uninstalling Firefox

Actual result

  • Windows native notification is shown after invoking the background task and Firefox is uninstalled

  • FirefoxToast- followed by the background task number is shown on the notification

  • See the attached screenshot

Regression range

  • New feature

Additional notes

  • Issue is not 100% reproducible
  • Issue was reproduced also after invoking the background task one time and uninstalling Firefox, usually the notifications are shown after ~5 minutes
Blocks: 1789394

Gabi -- excellent catch! I always appreciate QA doing such good work.

I'm surprised this isn't 100% reproducible, 'cuz to me it should be. We:

  • create a notification
  • snooze it
  • uninstall Firefox (and nothing here cleans up old notifications)
  • Windows brings it back some time in the future

Now, what is to be done? Clearly we need to remove any notifications created by this Firefox at uninstall time. We can enumerate notifications with Firefox's notificiation AUMID fairly easily. The important question that I see is whether we should do that in default-browser-agent.exe (potentially duplicating some code) or do it in firefox.exe --backgroundtask <some cleanup name> (risking some locking issues if Firefox doesn't exit cleanly, etc).

I'm going to mark this as a regression from Bug 1781929, even though it's not really specific to that ticket: it's really part of the general program to start using native notifications on Windows in Firefox.

nrishel: can you take this ticket? We'd look to address this in the Nightly 106 cycle, so landing before September 15.

Flags: needinfo?(nrishel)
Regressed by: 1781929
Whiteboard: [fidedi-notifications]

Set release status flags based on info from the regressing bug 1781929

Ah! Yep, this would be a problem.

Given the suggested fixes, I'm assuming we already invoke wdba on uninstall, but we don't do the same for Firefox? What's the general concern on Firefox not exiting cleanly?

Assignee: nobody → nrishel
Flags: needinfo?(nrishel)
Flags: needinfo?(nalexander)

(In reply to Nick Rishel [:nrishel] from comment #3)

Ah! Yep, this would be a problem.

Given the suggested fixes, I'm assuming we already invoke wdba on uninstall,

Correct: see default-browser-agent.exe uninstall.

but we don't do the same for Firefox? What's the general concern on Firefox not exiting cleanly?

Also correct. My concern is vague: if Firefox is in a truly bad state, then it could be that it gets wedged, etc, and blocks the uninstallation process from succeeding. (Just as if Firefox was still running.) I'm not sure if that's worth worrying about.

It would certainly be easiest to just add some "clean up all notifications with the AUMID you generate" call to nsIWindowsAlertsService.idl and then invoke it from a new task.

Flags: needinfo?(nalexander)

Non-MSIX notifications are not removed when Firefox is uninstalled. To handled this we've added a new Uninstall background task and extended nsIWindowsAlertService to deregister notifications on uninstall.

Attachment #9293399 - Attachment description: WIP: Bug 1789390 - Remove scheduled and Action Center notifications during uninstall. r=nalexander → Bug 1789390 - Remove scheduled and Action Center notifications during uninstall. r=nalexander
Pushed by nrishel@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6fcec3502cb2
Pre: Comment cleanup. r=nalexander
https://hg.mozilla.org/integration/autoland/rev/4cec525d92f4
Remove scheduled and Action Center notifications during uninstall. r=nalexander

Backed out for causing bc failures regarding unreferenced file on BackgroundTask_uninstall.jsm.

Push with failures

Failure log

Backout link

Flags: needinfo?(nrishel)

(In reply to Iulian Moraru from comment #8)

Backed out for causing bc failures regarding unreferenced file on BackgroundTask_uninstall.jsm.

Push with failures

Failure log

Backout link

Gah, I forgot about this. In the relevant test, all toolkit/-level BackgroundTask_*.jsm task files are ignored. We need to do that for app (browser/)-level task files as well, like:

  gExceptionPaths.push("resource://app/modules/backgroundtasks/");
Pushed by nrishel@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d851e34b7e5c
Pre: Comment cleanup. r=nalexander
https://hg.mozilla.org/integration/autoland/rev/1d6c2d531eb4
Remove scheduled and Action Center notifications during uninstall. r=nalexander
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch
Flags: needinfo?(nrishel)
Flags: qe-verify+

Issues is verified as fixed in Firefox 106.0b4 with Windows 10x64 and Windows 111x64.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: