-
Notifications
You must be signed in to change notification settings - Fork 16
During user/normandy "end study" signal, the add-on context is destroyed before endStudy handling is able to run #232
Comments
In general, you cannot. If an extension is uninstalled while it is disabled (which can happen if the user disables and then uninstalls, or if the user uninstalls while in safe mode or smoething), then we cannot run code from inside the extension during uninstall. What sort of cleanup do you need to run? |
|
There's an existing API that ought to cover the survey issue (I commented separately over on issue #194) |
@aswan In a bundled Web Extensions Experiment, the onShutdown handler is not (EDIT: reliably) available after add-on uninstall. Any chance we can have a browser.runtime.onUninstall.addListener, which get's metadata about the uninstall reason (user, normandy)? |
I don't understand what you mean by "not available after add-on uninstall". That method will be called whenever an enabled extension is uninstalled. But like I said in my first comment on this issue, you're not going to be able to reliably catch uninstalls from a bundled experiment if the extension is disabled when it is uninstalled. The addon manager also doesn't have metadata about where an uninstall was initiated from. If you want something specific to happen when Normandy uninstalls an extension, can you put the logic for doing that directly into Normandy? |
@aswan, I will attempt to clarify. ENDINGS There are several cases of study addon ending that should have effects.
Issues around this:
Possible solutions (based in my ignorance, and incomplete understanding of how Extensions.jsm actually works):
|
I don't understand what the checkboxes (some checked and some unchecked) in @gregglind's comment mean. To the extent that I understand the issues here (and I'm finding hard to follow since there are a whole bunch of open issues on github, many of which reference multiple overlapping topics), I think this is all solvable without any of the large fundamental changes proposed above. First, as Gregg mentioned I think we should not show Shield studies in about:addons. We should of course be very clear about this since we're not trying to do anything sneaky. Perhaps a banner or something informing users of about:studies would help. The idea though is that we happen to use extensions for a number of things in the browser. We have system extensions that users don't ever manage directly, about:addons for the things that they choose to install (ie from AMO) and about:studies for things that are installed as part of Shield/Normandy/Pioneer/whatever. This would also mean that Shield studies won't have to resort to hacks for things like avoiding the "Undo uninstall" interface in about:addons. Now, as for sending final telemetry and showing surveys that depend on the manner in which the study ended, if Normandy is the place where the information about how a study ended is readily available, why not do all those things there rather than trying to get that information into the extension and fight all the gnarly lifecycle issues that arise when you try to make an extension run some code at the moment it is being uninstalled? Normandy can (if it doesn't already) use the AddonManager listener interface to find out when an extension that it installed is disabled or uninstalled. I guess that if one of those events occurs and it isn't happening as a result of something Normanday initiated itself, it can assume that the user is disabling/removing the extension themselves. |
(Checkboxes were meant to show things that correntada work as expected).
Moving the problem over to about:studies still has the same problem of user
disabling the study not letting the study cleanup.
Normandy currently knows almost nothing about studies, but augmenting that
might another option to explore.
Perhaps Normandy could send warning to the study (via Global observer), and
give the study a minute or 5 to shutdown, and to attempt to uninstall
itself. Then hit it with the big hammer.
None of his helps the “user uninstalled it” case, if the responses to that
are happening in the addon, unless that action also has a brief “give me 30
seconds” timeout. That would move the complication to about:studies.
…On Wed, Jul 11, 2018 at 2:13 PM aswan ***@***.***> wrote:
I don't understand what the checkboxes (some checked and some unchecked)
in @gregglind <https://github.com/gregglind>'s comment mean. To the
extent that I understand the issues here (and I'm finding hard to follow
since there are a whole bunch of open issues on github, many of which
reference multiple overlapping topics), I think this is all solvable
without any of the large fundamental changes proposed above.
First, as Gregg mentioned I think we should not show Shield studies in
about:addons. We should of course be very clear about this since we're not
trying to do anything sneaky. Perhaps a banner or something informing users
of about:studies would help. The idea though is that we happen to use
extensions for a number of things in the browser. We have system extensions
that users don't ever manage directly, about:addons for the things that
they choose to install (ie from AMO) and about:studies for things that are
installed as part of Shield/Normandy/Pioneer/whatever. This would also mean
that Shield studies won't have to resort to hacks for things like avoiding
the "Undo uninstall" interface in about:addons.
Now, as for sending final telemetry and showing surveys that depend on the
manner in which the study ended, if Normandy is the place where the
information about how a study ended is readily available, why not do all
those things there rather than trying to get that information into the
extension and fight all the gnarly lifecycle issues that arise when you try
to make an extension run some code at the moment it is being uninstalled?
Normandy can (if it doesn't already) use the AddonManager listener
interface to find out when an extension that it installed is disabled or
uninstalled. I guess that if one of those events occurs and it isn't
happening as a result of something Normanday initiated itself, it can
assume that the user is disabling/removing the extension themselves.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#232 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKAjwwcGA4wezXa4_MwXFH9Nng8l85Wks5uFk5ZgaJpZM4VC7ow>
.
|
Separately: what’s the proposed mechanism you like for “hide it from
about:addons”
They show up in telemetry (and get filtered by id by analysts). I suggest
that same plan for this, barring nothing subtler.
…On Wed, Jul 11, 2018 at 2:23 PM Gregg Lind ***@***.***> wrote:
(Checkboxes were meant to show things that correntada work as expected).
Moving the problem over to about:studies still has the same problem of
user disabling the study not letting the study cleanup.
Normandy currently knows almost nothing about studies, but augmenting that
might another option to explore.
Perhaps Normandy could send warning to the study (via Global observer),
and give the study a minute or 5 to shutdown, and to attempt to uninstall
itself. Then hit it with the big hammer.
None of his helps the “user uninstalled it” case, if the responses to that
are happening in the addon, unless that action also has a brief “give me 30
seconds” timeout. That would move the complication to about:studies.
On Wed, Jul 11, 2018 at 2:13 PM aswan ***@***.***> wrote:
> I don't understand what the checkboxes (some checked and some unchecked)
> in @gregglind <https://github.com/gregglind>'s comment mean. To the
> extent that I understand the issues here (and I'm finding hard to follow
> since there are a whole bunch of open issues on github, many of which
> reference multiple overlapping topics), I think this is all solvable
> without any of the large fundamental changes proposed above.
>
> First, as Gregg mentioned I think we should not show Shield studies in
> about:addons. We should of course be very clear about this since we're not
> trying to do anything sneaky. Perhaps a banner or something informing users
> of about:studies would help. The idea though is that we happen to use
> extensions for a number of things in the browser. We have system extensions
> that users don't ever manage directly, about:addons for the things that
> they choose to install (ie from AMO) and about:studies for things that are
> installed as part of Shield/Normandy/Pioneer/whatever. This would also mean
> that Shield studies won't have to resort to hacks for things like avoiding
> the "Undo uninstall" interface in about:addons.
>
> Now, as for sending final telemetry and showing surveys that depend on
> the manner in which the study ended, if Normandy is the place where the
> information about how a study ended is readily available, why not do all
> those things there rather than trying to get that information into the
> extension and fight all the gnarly lifecycle issues that arise when you try
> to make an extension run some code at the moment it is being uninstalled?
> Normandy can (if it doesn't already) use the AddonManager listener
> interface to find out when an extension that it installed is disabled or
> uninstalled. I guess that if one of those events occurs and it isn't
> happening as a result of something Normanday initiated itself, it can
> assume that the user is disabling/removing the extension themselves.
>
> —
> You are receiving this because you were mentioned.
>
>
> Reply to this email directly, view it on GitHub
> <#232 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAKAjwwcGA4wezXa4_MwXFH9Nng8l85Wks5uFk5ZgaJpZM4VC7ow>
> .
>
|
Additional possible solutions: Any other suggestions? EDIT: Seems we were all replying at the same time. I have updated this comment after re-reading the recent comments above. |
Not necessarily, if about:studies doesn't directly allow users to disable it as it would an ordinary add-on, but merely send a signal/event for the study to know that user-disable just happened (and then after a specific timeout hit it with a big hammer if it still isn't disabled - as proposed for the Normandy approach and the "soft uninstall") |
"cleanup" means clearing prefs? If studies only show up in about:studies and there's no disable button there, this shouldn't be an issue. Even if a user does manage to disable an extension, you'll still get into onShutdown() with shutdownReason set to ADDON_DISABLE, and can handle that the same way you handle uninstall. I guess there's still safe mode to think about. If that's an issue, perhaps you'll be better off landing the preferences portion of this in central so that the code isn't tied to an individual extension, then you have access to all the extension api lifecycle events.
I'm pretty strongly opposed to "give me 30 seconds". All the complication here seems to be about wanting an extension to continue to run code after the action of uninstalling it has begun, which is in direct opposition to explicit design decisions made for webextensions. From my vantage point, the ideal solution is to have anything that needs to happen for even a moment after an uninstall has begun to be outside of individual extensions. That could be in something like Normanday or in the implementation of (privileged) extension APIs that exist in-tree.
Off the top of my head, how about a "hidden" property in the manifest that we only honor for extensions with privileged signatures. |
I like where this is going. :) Summary of converging solution path to solve both the lifecycle and UX issues related to the actual fact that studies are study add-ons made and shipped by Mozilla and not add-ons made and installed by users:
Extending
We don't necessarily want any logic to happen after add-on uninstall, only when we know that the study should end and before actual uninstallation. I am agnostic the actual implementation of how Firefox uninstalls add-ons related to studies that have ended, as long as we can run the cleanup/endStudy logic. Having this taken care of by in-tree APIs seems like the best way. See proposed solutions 6,7,8,10 above. |
I think this is all reflected in the Engineering plan at #246. closing this to focus discussion there. |
This is the underlying issue behind #194, but there are broader implications than missing out on firing survey URLs. Most importantly, add-on cleanup is skipped, leaving the client possibly with study-related preference/UX side effects post study.
[Steps to reproduce]:
example/small-study
)about:addons
and uninstall/disable the add-on[Expected result]:
[Actual result]:
[Notes]:
The text was updated successfully, but these errors were encountered: