Closed Bug 304357 Opened 19 years ago Closed 19 years ago

InstallTrigger status callbacks always report failure (-210: user cancelled)

Categories

(Toolkit :: Add-ons Manager, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dveditz, Assigned: robert.strong.bugs)

References

Details

(Keywords: regression)

Attachments

(1 file, 2 obsolete files)

The checkin for bug 296566 changed the extension manager to first cancel an
existing nsXPInstallManager and then create a new one. Web pages that have a
trigger callback function to help direct users in case of error are now broken,
as they will now always get the USER_CANCELLED (-210) return code.

I know sites use this because I got a raft of complaints about the error code
returned when we added install site whitelisting.

Killing the install manager and starting a new one has also complicated my
attempt to add install hashes (bug 302284), though since we may also want them
for updates (which call InitManagerFromChrome) that's not why this bug should be
fixed.
Flags: blocking1.8b4?
Summary: InstallTrigger status callbacks always report -210 → InstallTrigger status callbacks always report failure (-210: user cancelled)
Blocks: 302284
Attached patch patch (obsolete) — Splinter Review
I tested updates and InstallTrigger installs from a web page successfully but
this needs more testing before review. Daniel, can you try it out?
For clarity, updates initiated by the EM are still handled using
InitManagerFromChrome and installs from a web page are handled in the manner
before the patch for bug 296566 landed. In regards to update I don't think this
is a problem for bug 302284 since there is no method to add a hash - at least
not yet.
heh, that's very nearly identical to the patch I just finished testing. I forgot
to update the uuid though, so I'll go with yours.
Here's steps to repro:

1: go to https://addons.mozilla.org (or other whitelisted site)
2: in the location bar enter the following
javascript:InstallTrigger.install({'foo':'http://www.mozilla.org/foo.xpi'},function(u,s){alert(u+'\n'+s);});void(0)
3: click "InstallNow" button

Expected result: status -207 (download error, bogus .xpi)
Actual result: status -210 (install cancelled)

Or you could use a valid package url in which case the expected status would be 0.
Comment on attachment 192425 [details] [diff] [review]
patch

Thanks Daniel
Attachment #192425 - Flags: review?(benjamin)
Assignee: bugs → rob_strong
Comment on attachment 192425 [details] [diff] [review]
patch

Forgot to update the comment in the interface.
Attachment #192425 - Attachment is obsolete: true
Attachment #192425 - Flags: review?(benjamin)
Attached patch patch w/ commented interface (obsolete) — Splinter Review
Attachment #192432 - Flags: review?(benjamin)
Comment on attachment 192425 [details] [diff] [review]
patch

sr=dveditz
Seeking r= from ben

Should copy the @param comment in the .idl file
Attachment #192425 - Flags: superreview+
Attachment #192425 - Flags: review?(bugs)
Comment on attachment 192432 [details] [diff] [review]
patch w/ commented interface

sr=dveditz
Attachment #192432 - Flags: superreview+
Comment on attachment 192425 [details] [diff] [review]
patch

>+    if (fromChrome) {
>+      // Cancel the existing xpimgr...
>+      gOS.notifyObservers(txn, "xpinstall-progress", "cancel");

Is this necessary anymore now that we're not trying to cancel the web page
xpimgr?

r=ben@mozilla.org
Attachment #192425 - Flags: review?(bugs) → review+
Ben is correct... the xpinstall cancel is no longer needed.
Attachment #192432 - Attachment is obsolete: true
Attachment #192449 - Flags: review?(benjamin)
Attachment #192432 - Flags: review?(benjamin)
Benjamin - this has ben gave this an r+ and dveditz gave this an sr+. Can I get
an  a+ from you when you review it?
Attachment #192449 - Flags: review?(benjamin) → approval1.8b4+
Carried over Ben's r+ and dveditz's sr+

Fixed for 1.8b4
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Flags: blocking1.8b4?
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: