Closed Bug 567319 Opened 16 years ago Closed 16 years ago

Bootstrapped add-ons don't get started after a restart

Categories

(Toolkit :: Add-ons Manager, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.9.3a5
Tracking Status
blocking2.0 --- alpha5+

People

(Reporter: mossop, Assigned: mossop)

References

Details

(Whiteboard: [AddonsRewrite])

Attachments

(1 file, 1 obsolete file)

Once installed, restarting Firefox renders these add-ons unused. The add-ons manager is currently shutdown by the xpcom-shutdown topic at which point it stashes the list of bootstrapped add-ons into a pref, but it turns out that the preferences service is useless by this point. Bug 566485 broke this because we used to set the pref in quit-application-granted.
Attached patch conservative patch rev 1 (obsolete) — — Splinter Review
I think it might be more sensible to do the add-ons manager shutdown in profile-before-change. This is when the profile is still technically "available" so shutting down our DB and things at this stage makes a lot of sense. And setting prefs there works. However we could do with fixing this quickly for Jetpack so here is a conservative fix that solves the problem by partly backing out bug 566485 and adding additional saves of the preference when we exit early during startup.
Assignee: nobody → dtownsend
Status: NEW → ASSIGNED
Attachment #446674 - Flags: review?(robert.bugzilla)
Dave, I assume everything is covered by the automated test?
Flags: in-testsuite?
Flags: in-litmus?
OS: Mac OS X → All
Hardware: x86 → All
Whiteboard: [AddonsRewrite]
Might this bug have an effect on Bug 554279 - Restarting Firefox resets the toolbar customizations?
No, (In reply to comment #3) > Might this bug have an effect on Bug 554279 - Restarting Firefox resets the > toolbar customizations? No
Comment on attachment 446674 [details] [diff] [review] conservative patch rev 1 >diff --git a/toolkit/mozapps/extensions/XPIProvider.jsm b/toolkit/mozapps/extensions/XPIProvider.jsm >--- a/toolkit/mozapps/extensions/XPIProvider.jsm >+++ b/toolkit/mozapps/extensions/XPIProvider.jsm >... >@@ -2275,29 +2279,61 @@ var XPIProvider = { > }; > > const FIELDS_ADDON = "internal_id, id, location, version, type, internalName, " + > "updateURL, updateKey, optionsURL, aboutURL, iconURL, " + > "defaultLocale, visible, active, userDisabled, appDisabled, " + > "pendingUninstall, descriptor, installDate, updateDate, " + > "applyBackgroundUpdates, bootstrap"; > >+function logSQLError(aError, aErrorString) { >+ ERROR("SQL error " + aError + ": " + aErrorString); >+} >+ > // A helper function to simply log any errors that occur during async statements. nit: here and below please make the comments into doc comments for each function > function asyncErrorLogger(aError) { >- ERROR("SQL error " + aError.result + ": " + aError.message); >+ logSQLError(aError.result, aError.message); >+} >+ >+// A helper function to log any errors that occur during synchronous statement >+// execution >+function executeStatement(aStatement) { >+ try { >+ aStatement.execute(); >+ } >+ catch (e) { >+ logSQLError(XPIDatabase.connection.lastError, >+ XPIDatabase.connection.lastErrorString); >+ throw e; >+ } >+} >+ >+// A helper function to log any errors that occur while stepping a synchronous >+// statement >+function stepStatement(aStatement) { >+ try { >+ return aStatement.executeStep(); >+ } >+ catch (e) { >+ logSQLError(XPIDatabase.connection.lastError, >+ XPIDatabase.connection.lastErrorString); >+ throw e; >+ } > } r=me as long as sdwilsh is fine with the method you used to verify the connection to the database can be opened.
Attachment #446674 - Flags: review?(robert.bugzilla) → review+
Robert, Dave emailed today to say that this patch is the wrong one, and since his connection while traveling is intermittent he won't be able to post the right one until Sunday or Monday. (Not sure why he didn't post here.) Just in case you were planning on landing it for him.
Comment on attachment 446674 [details] [diff] [review] conservative patch rev 1 No worries... I had a feeling that might be the case from the irc conversation Thursday night and decided not to chance it.
Attachment #446674 - Attachment is obsolete: true
Attachment #446674 - Flags: review+
Sadly mobile phones do not make for good bugzilla clients, but here is the proper patch that should solve the issue.
Attachment #447098 - Flags: review?(robert.bugzilla)
Comment on attachment 447098 [details] [diff] [review] conservative patch for realz Dave, is there a way to simulate this condition in an xpcshell test?
(In reply to comment #10) > (From update of attachment 447098 [details] [diff] [review]) > Dave, is there a way to simulate this condition in an xpcshell test? I could implement a fake prefs service and have it forget any data set after we start shutting down the add-ons manager, that is probably only useful for this particular patch though. If we were to go further and switch to doing the add-ons manager shutdown in profile-before-change I don't think there would be a useful way to test that automatically.
Attachment #447098 - Flags: review?(robert.bugzilla) → review+
Landed: http://hg.mozilla.org/mozilla-central/rev/e7175f0b4dc2 I think a manual test is the surest course of action here since our automated test harness is imperfect.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Flags: in-testsuite? → in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a5
Dave, could you please specify which exact steps we would need for a Litmus test to verify the fix?
(In reply to comment #13) > Dave, could you please specify which exact steps we would need for a Litmus > test to verify the fix? 1. Install a restartless add-on (Any of atul's would suffice). 2. Verify that it has done what it was meant to without needing a restart. 3. Restart Firefox. 4. Verify that it is still doing what it is meant to.
Verified fixed with Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.3a6pre) Gecko/20100617 Minefield/3.7a6pre
Status: RESOLVED → VERIFIED
Flags: in-litmus? → in-litmus?(vlad.maniac)
Flags: in-litmus?(vlad.maniac) → in-litmus+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: