Last Comment Bug 744833 - extensions.bootstrappedAddons gets out of sync when an addon's location changes
: extensions.bootstrappedAddons gets out of sync when an addon's location changes
Status: RESOLVED FIXED
:
Product: Toolkit
Classification: Components
Component: Add-ons Manager (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla15
Assigned To: Dave Townsend [:mossop]
:
Mentors:
: 762822 (view as bug list)
Depends on: 774990
Blocks: abp 655254
  Show dependency treegraph
 
Reported: 2012-04-12 10:26 PDT by Mike Kaply [:mkaply]
Modified: 2012-10-04 06:09 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch rev 1 (11.24 KB, patch)
2012-05-11 08:49 PDT, Dave Townsend [:mossop]
bmcbride: review+
Details | Diff | Splinter Review

Description Mike Kaply [:mkaply] 2012-04-12 10:26:43 PDT
Currently the preferences extensions.bootstrappedAddons and extensions.installCache hardcode paths to the add-ons. For example:

{
    "onepassword@agilebits.com": {
        "version": "3.9.4",
        "type": "extension",
        "descriptor": "H:\\.se\\browser\\profile\\extensions\\onepassword@agilebits.com"
    }
}

This means that if a profile is moved, the extension won't reload properly.

This can happen when changing network drives, loading from a flash drive, moving between operating systems, etc.

Operating system paths should not be in preferences.
Comment 1 Dave Townsend [:mossop] 2012-04-12 10:32:42 PDT
Have you actually seen this causing a problem? I thought we verified the paths and rebuilt when necessary already.
Comment 2 Dave Townsend [:mossop] 2012-04-12 10:38:32 PDT
The checking code was added in bug 619607
Comment 3 Mike Kaply [:mkaply] 2012-04-12 10:39:19 PDT
Yes. 

We have a product that is on a USB key.

When we switch between Mac and Windows, the restartless add-on is present, but not enabled properly. If you enable then disable it appears (toolbarbutton).
Comment 4 Mike Kaply [:mkaply] 2012-04-12 10:44:02 PDT
That bug seems to only deal with extensions.bootstrappedAddons.

What about extensions.installCache?
Comment 5 Dave Townsend [:mossop] 2012-04-12 10:46:39 PDT
(In reply to Michael Kaply (mkaply) from comment #3)
> Yes. 
> 
> We have a product that is on a USB key.
> 
> When we switch between Mac and Windows, the restartless add-on is present,
> but not enabled properly. If you enable then disable it appears
> (toolbarbutton).

You mean disable then enable?

This is odd, switching OS like that ought to cause a complete rebuild of the add-ons DB anyway so I'd fully expect everything to be right. What do you see in the error console if extensions.logging.enabled is on when you startup Firefox on the new OS?
Comment 6 Dave Townsend [:mossop] 2012-04-12 10:47:36 PDT
(In reply to Michael Kaply (mkaply) from comment #4)
> That bug seems to only deal with extensions.bootstrappedAddons.
> 
> What about extensions.installCache?

As soon as the directories for installed extensions change installCache gets rebuilt, it is there precisely to allow us to detect directory changes like this and is what triggers us to load up the database and apply any changes that have happened.
Comment 7 Mike Kaply [:mkaply] 2012-04-12 10:49:20 PDT
yep, installCache did get updated.

bootstrappedAddons is empty though ({})

If I disable and reenable and then restart, I get a bootstrappedAddons value with the correct apths.
Comment 8 Mike Kaply [:mkaply] 2012-04-12 10:58:37 PDT
It looks like the right things are happening on the console:

LOG addons.xpi: Add-on onepassword@agilebits.com moved to H:\.se\browser\profile\extensions\onepassword@agilebits.com

LOG addons.xpi: Updating database with changes to installed add-ons

LOG addons.xpi: Updating add-on states


And that add-on is enabled in add-ons manager, it's just not running.


To give more info on the bootstrappedAddons pref (maybe I just don't know what it is for).

After switching from Mac to Windows machine (or vice versa).
Pref has no value on start (and add-on doesn't work).
Disable and enable in add-ons manager, pref still has no value (but add-on now works)
Restart the browser
bootstrappedAddons is populated with information about the addon and the add-on works.
Comment 9 Mozilla RelEng Bot 2012-05-10 18:46:49 PDT
Try run for 985253068655 is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=985253068655
Results (out of 42 total builds):
    exception: 15
    success: 10
    warnings: 16
    failure: 1
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/dtownsend@mozilla.com-985253068655
Comment 10 Dave Townsend [:mossop] 2012-05-11 08:49:18 PDT
This is a regression from the fast path we added in bug 655254. It correctly updates the location of the add-on but doesn't rebuild the bootstrap entry when necessary.
Comment 11 Dave Townsend [:mossop] 2012-05-11 08:49:57 PDT
Created attachment 623163 [details] [diff] [review]
patch rev 1

This fixes it and adds a test for this case
Comment 13 Ed Morley [:emorley] 2012-05-15 06:49:32 PDT
https://hg.mozilla.org/mozilla-central/rev/ff13f7157159
Comment 14 Dave Townsend [:mossop] 2012-06-08 16:51:34 PDT
*** Bug 762822 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.