Closed Bug 1569653 Opened 6 years ago Closed 5 years ago

Add button to invalidate startup cache in about:support

Categories

(Toolkit :: General, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: flod, Assigned: priyanksingh8, Mentored)

References

Details

(Keywords: good-first-bug)

Attachments

(1 file)

Currently it's possible to run Firefox executable with -purgecaches, but there's no way to clear that cache from Firefox itself.

Command line options are not easy to discover for most users, and Safe Mode is just too scary.

We have cases where purging caches helps users (e.g. bug 1564998, bug 1520446). It would be nice to have that capability in about:support, at least as a stopgap solution.

Type: task → enhancement

This looks to be trivial. Just need to add a button that calls Services.appinfo.invalidateCachesOnRestart().

Dave, are you interested into mentoring this bug? it sounds like it could be a good-first-bug.

Flags: needinfo?(dtownsend)
Priority: -- → P3

Yeah ok

Mentor: dtownsend
Flags: needinfo?(dtownsend)
Keywords: good-first-bug

Hi there, I am a final year computer science student from the University of Toronto. I am interested in this bug. Can I work on this?

Flags: needinfo?(dtownsend)

Sorry for the delay, was sick for a few days last week. By all means please take a look.

The source code for about:support is here:

https://searchfox.org/mozilla-central/source/toolkit/content/aboutSupport.xhtml
https://searchfox.org/mozilla-central/source/toolkit/content/aboutSupport.js

Basically we want something like the safe mode restart button but restarts normally and calls the function in comment 1 first.

Assignee: nobody → xuelitan123
Flags: needinfo?(dtownsend)

thank you very much. I will start to work shortly

Hi Dave, about:support is a relatively large page. Where do you want the button be?

Flags: needinfo?(dtownsend)

I think right below the safe mode button should work.

Flod, do you have thoughts on wording here? Maybe something like:

Try clearing the Firefox cache

[Clear Firefox cache]

And then on click show a dialog:

Clear Firefox cache

This requires restarting Firefox. No settings will be lost.
[Cancel] [Restart]

Flags: needinfo?(dtownsend) → needinfo?(francesco.lodolo)

Yes, I was invisioning pretty much the same.

A couple of question:

  • Should we have ask UX to provide the copy for this?
  • Is "Firefox Cache" potentially confusing? I assumed this would remove only the UI cache. If we're removing all caches, including the navigation cache, then it's definitely OK.
Flags: needinfo?(francesco.lodolo)

(In reply to Francesco Lodolo [:flod] from comment #9)

Yes, I was invisioning pretty much the same.

A couple of question:

  • Should we have ask UX to provide the copy for this?

Yeah let's see if they have thoughts.

  • Is "Firefox Cache" potentially confusing? I assumed this would remove only the UI cache. If we're removing all caches, including the navigation cache, then it's definitely OK.

It is! But I was struggling to think of anything better. UI cache sounds good though.

(In reply to Dave Townsend [:mossop] (he/him) from comment #10)

(In reply to Francesco Lodolo [:flod] from comment #9)

Yes, I was invisioning pretty much the same.

A couple of question:

  • Should we have ask UX to provide the copy for this?

Yeah let's see if they have thoughts.

  • Is "Firefox Cache" potentially confusing? I assumed this would remove only the UI cache. If we're removing all caches, including the navigation cache, then it's definitely OK.

It is! But I was struggling to think of anything better. UI cache sounds good though.

Does "It is!" refer to Firefox Cache being confusing or to removing all caches vs the UI cache?

Flags: needinfo?(dtownsend)

(In reply to mheubusch from comment #11)

(In reply to Dave Townsend [:mossop] (he/him) from comment #10)

(In reply to Francesco Lodolo [:flod] from comment #9)

Yes, I was invisioning pretty much the same.

A couple of question:

  • Should we have ask UX to provide the copy for this?

Yeah let's see if they have thoughts.

  • Is "Firefox Cache" potentially confusing? I assumed this would remove only the UI cache. If we're removing all caches, including the navigation cache, then it's definitely OK.

It is! But I was struggling to think of anything better. UI cache sounds good though.

Does "It is!" refer to Firefox Cache being confusing or to removing all caches vs the UI cache?

"Firefox Cache" because there are multiple caches and I was only imagining clearing the startup cache. There is nothing to stop us clearing the network cache too though.

Flags: needinfo?(dtownsend)

If only startup cache is cleared, I recommend:

Try clearing the start up cache

[Clear start up cache . . .]

And then on click show a dialog:
Clear startup cache

Restart <shortname> to clear startup cache. This will not change your settings or remove extensions you’ve added to <shortname>.
[Cancel] [Restart]

Fyi -<shortname> is the parameter for the version - Firefox, Nightly, Beta - but I forgot how to notate that.

Joni - FYI that this new feature is being added to about:support - in a perfect world I would rework the entire box and how we advise users on the severity of these different actions and link to an article in SUMO - but NI'ing you in case you might still want to add info about this to SUMO in the meantime. Cheers!

Flags: needinfo?(jsavage)

I will follow the format:
Try clearing the start up cache

[Clear start up cache . . .]

And then on click show a dialog:
Clear startup cache

Restart <shortname> to clear startup cache. This will not change your settings or remove extensions you’ve added to <shortname>.
[Cancel] [Restart]

I assume we should use startup consistently, and that "start up" is incorrect in the first two sentences (hopefully Michelle will correct if that's wrong).

Stumbled upon another Reddit post with half-translated Firefox. Any chance we can prioritize this?

Hi Dave, Can I take up this issue?
Thanks :)
Aarushi

Flags: needinfo?(dtownsend)

By all means

Assignee: xuelitan123 → aarushivij
Flags: needinfo?(dtownsend)

@aarushivij
Are you still working on this bug?

Flags: needinfo?(aarushivij)

Reassigning for lack of replies. Also clearing NI for Joni in the meantime.

Assignee: aarushivij → nobody
Flags: needinfo?(jsavage)
Flags: needinfo?(aarushivij)

Would like to take up this issue.

Flags: needinfo?(francesco.lodolo)

Not really the right person (see the Mentor field), but feel free to work on this ;-)

Assignee: nobody → priyanksingh8
Flags: needinfo?(francesco.lodolo)

Hi Dave, could you guide me through the process as what results are we expecting as I it is unclear from look at previous comments.

Flags: needinfo?(dtownsend)

In about:support there are two buttons at the top, "Refresh Firefox" and "Restart with Add-ons Disabled".

We want to add a third button there as specified in comment 13. The code to show the dialog should be similar to that here: https://searchfox.org/mozilla-central/rev/9aa7bebfd169bc2ead00ef596498a406e56bbb85/browser/components/BrowserGlue.jsm#1364 except the restart should be a normal one and not into safe mode and before restarting we should call Services.appinfo.invalidateCachesOnRestart().

Flags: needinfo?(dtownsend)
Status: NEW → ASSIGNED

I am quite unclear as how to show dialog, maybe Services.prompt.confirmEx function does the job and I am unable to understand
how gBrowserBundle is used in https://searchfox.org/mozilla-central/rev/9aa7bebfd169bc2ead00ef596498a406e56bbb85/browser/components/BrowserGlue.jsm#1366. Also where could I find implementation of Services.jsm so that I may get idea about methods used in it.

Flags: needinfo?(dtownsend)

(In reply to Priyank Singh from comment #28)

I am quite unclear as how to show dialog, maybe Services.prompt.confirmEx function does the job and I am unable to understand
how gBrowserBundle is used in https://searchfox.org/mozilla-central/rev/9aa7bebfd169bc2ead00ef596498a406e56bbb85/browser/components/BrowserGlue.jsm#1366. Also where could I find implementation of Services.jsm so that I may get idea about methods used in it.

gBrowserBundle is a string bundle object. Though now I think about it we will need to use fluent to do the localization here instead. document.l10n.formatValue or document.l10n.formatValues are asynchronous methods that will get you strings out of the localization files. There are some examples of its use in aboutSupport.js.

Services.jsm is implemented here but is probably not of interest here, it just exposes a bunch of services that are implemented elsewhere. In this case you want the implementation of Services.prompt which is an XPCOM object that implements the nsIPromptService interface.

Flags: needinfo?(dtownsend)

(In reply to mheubusch from comment #14)

Fyi -<shortname> is the parameter for the version - Firefox, Nightly, Beta - but I forgot how to notate that.

How to use <shortname> here?
Also what function do I have to call to restart firefox?

Flags: needinfo?(dtownsend)

(In reply to Priyank Singh from comment #30)

(In reply to mheubusch from comment #14)

Fyi -<shortname> is the parameter for the version - Firefox, Nightly, Beta - but I forgot how to notate that.

How to use <shortname> here?

You use { -brand-short-name } in the string.

Also what function do I have to call to restart firefox?

You will want to use Services.startup.quit

Flags: needinfo?(dtownsend)

I could see that I have to pass Ci.nsIAppStartup.eRestart as a variable to restart, what is Ci here?

Flags: needinfo?(dtownsend)

Also how { -brand-short-name } is evaluated?

The reason I am asking so many questions is I need to get proper understanding how the code is working for a first timer, I could have pasted the code from docs but I don't want to :)

(In reply to Priyank Singh from comment #32)

I could see that I have to pass Ci.nsIAppStartup.eRestart as a variable to restart, what is Ci here?

It is the Components.interfaces object.

(In reply to Priyank Singh from comment #33)

Also how { -brand-short-name } is evaluated?

The reason I am asking so many questions is I need to get proper understanding how the code is working for a first timer, I could have pasted the code from docs but I don't want to :)

It includes another localized string in the result, in this case this one: https://searchfox.org/mozilla-central/rev/d9d492eda787a6eda66016e6f8398ee759f7bc25/browser/branding/nightly/locales/en-US/brand.ftl#16

Flags: needinfo?(dtownsend)

I pushed the patch, could you review it?

Flags: needinfo?(dtownsend)

The review request in phabricator is enough, no need to needinfo me as well.

Flags: needinfo?(dtownsend)

Has the patch been through any try runs (I don't know if you have access or not)?

Flags: needinfo?(priyanksingh8)

No, I haven't used treeherder before, however I have level 1 access. When I tried running ./mach try empty I am getting error has Permission denied (public key) here is the paste bin. Does it require some configuration before running or what, also I think push-to-try and firefoxtree extensions are enabled.

Flags: needinfo?(priyanksingh8) → needinfo?(dtownsend)

Mercurial access for my account was disabled, filed a bug for the same.
https://bugzilla.mozilla.org/show_bug.cgi?id=1642574

Flags: needinfo?(dtownsend)

I think we must mark this as resolved or is the bug still open?

Flags: needinfo?(francesco.lodolo)

This bug is still open, the patch didn't land yet. As far as I can tell, Dave is waiting for a try push.

P.S. Once again, not the mentor for this bug ;-)

Flags: needinfo?(francesco.lodolo)

Yes I'd like to see it go through at least the lint checks on try before I push it to central. Looks like your account is restored but if you're still having problems let me know and I'll do it.

Do you need help pushing this to try?

Flags: needinfo?(priyanksingh8)

I have pushed my patch to try [here] lint checks are passed.(https://treeherder.mozilla.org/#/jobs?repo=try&revision=79bcf50fed05aca3a5c7562b54052bd931edd886)

But I am unable to trigger new jobs in treeherder, filed a bug regarding the taskcluster issue. Won't be able to trigger jobs until the issue is resolved, also I was unable to determine which jobs to among so many jobs. Could you do that for me if any job is required to be triggered for this patch to be tested.

Flags: needinfo?(priyanksingh8) → needinfo?(dtownsend)

I think the lint jobs are all that are needed here. Unfortunately about:support doesn't have great tests.

Flags: needinfo?(dtownsend)
Pushed by dtownsend@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a63a27cde0b2 Added button to invalidate startup cache and restart in about:support r=mossop,fluent-reviewers,flod
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79

Thanks for the patch!

(In reply to mheubusch from comment #15)

Joni - FYI that this new feature is being added to about:support - in a perfect world I would rework the entire box and how we advise users on the severity of these different actions and link to an article in SUMO - but NI'ing you in case you might still want to add info about this to SUMO in the meantime. Cheers!

(In reply to Francesco Lodolo [:flod] from comment #23)

Reassigning for lack of replies. Also clearing NI for Joni in the meantime.

Adding back Need-Info for Joni, in case a new SUMO article is needed.

I also set up a Needs Change entry for the https://support.mozilla.org/en-US/kb/use-troubleshooting-information-page-fix-firefox article.

Flags: needinfo?(jsavage)

I added a new Try clearing the startup cache section to the https://support.mozilla.org/en-US/kb/use-troubleshooting-information-page-fix-firefox article for fx79.

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

Attachment

General

Creator:
Created:
Updated:
Size: