Open Bug 1710143 Opened 3 years ago Updated 7 months ago

Remove the scheduled task for Background Update in the uninstaller without using the WDBA

Categories

(Toolkit :: Application Update, task, P3)

task

Tracking

()

ASSIGNED

People

(Reporter: bytesized, Assigned: nshukla)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [fidedi-ope])

Attachments

(2 files, 1 obsolete file)

I am currently in the process of implementing the removal of scheduled Background Update tasks. Because we have a deadline coming up, I am implementing this in a way that I can do quickly, leveraging existing, similar code in the WDBA.

However, it is likely that we will want to change this in the future. We might, for example, stop shipping the WDBA. I think, therefore, that we should consider changing this mechanism at a later time. I think it is quite likely that we will want to follow path number 3 or 4, suggested by :agashlin in Bug 1698593. I will reproduce these below:

  1. Write an NSIS plugin just for cleaning up scheduled tasks, similar to BitsUtils for removing BITS jobs.
  2. Write the whole task cleanup in NSIS. There is sample code, our usage would be even more involved as it would need to enumerate the tasks in the folder.
Priority: -- → P3
Whiteboard: [fidedi-ope]

I just had to look into how this worked because I forgot that we remove scheduled tasks via the WDBA. I suspect that this means that, when elevation is needed to uninstall Firefox, the WDBA probably also gets run elevated. This actually probably works out well for us because I suspect that otherwise we wouldn't be able to remove tasks added by other users.

But just in case anyone is ever thinking about fixing this bug by adding the removal code to BackgroundTask_uninstall.sys.mjs, keep in mind that the Launcher de-escalates permissions by default, which will likely prevent us from being able to remove tasks added by other users.

Blocks: 1838749
Assignee: nobody → nrishel
Status: NEW → ASSIGNED
Attachment #9344910 - Attachment description: WIP: Bug 1710143 - Uninstall all Firefox scheduled tasks without using WDBA r=nrishel,bytesized → Bug 1710143 - Uninstall all Firefox scheduled tasks without using WDBA r=nrishel,bytesized

(In reply to Robin Steuber (they/them) [:bytesized] from comment #1)

But just in case anyone is ever thinking about fixing this bug by adding the removal code to BackgroundTask_uninstall.sys.mjs, keep in mind that the Launcher de-escalates permissions by default, which will likely prevent us from being able to remove tasks added by other users.

Would we expect this to be a problem for FirstStartup too?

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

Would we expect this to be a problem for FirstStartup too?

I didn't know that this existed. I have kind of a lot of thoughts about it. The whole "First Startup" thing isn't even guaranteed to run. The flag that causes the "First Startup" behavior is added by the installer. So if you run the full installer and uncheck the box to start Firefox when the installer exits, it never runs at all. So if this is important, we probably shouldn't be doing it there in the first place.

Another thing to consider here is that our whole multi-user Background Update Task situation is currently kinda screwed up (Bug 1830071).

I'm also not fully sure why we are doing this at all. This only happens when we run Firefox. And when we run Firefox, we are also going to run maybeScheduleBackgroundUpdateTask(), which updates the task if its definition is out-of-date.

Assignee: nrishel → nshukla

The following patch is waiting for review from a reviewer who resigned from the review:

ID Title Author Reviewer Status
D186186 Bug 1710143 - Uninstall Firefox scheduled tasks without WDBA Try build r=nrishel nshukla nrishel: Resigned from review

:nshukla, could you please find another reviewer?

For more information, please visit BugBot documentation.

Flags: needinfo?(nshukla)
Attachment #9348941 - Attachment is obsolete: true

Revision D186186 has been abandoned.

Flags: needinfo?(nshukla)
Blocks: 1857601
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: