Closed Bug 351199 Opened 14 years ago Closed 13 years ago

CalDAV provider throws bogus exceptions

Categories

(Calendar :: Provider: CalDAV, defect)

x86
Linux
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: browning, Unassigned)

Details

Attachments

(1 file, 3 obsolete files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.6) Gecko/20060808 Fedora/1.5.0.6-2.fc5 Firefox/1.5.0.6 pango-text
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a1) Gecko/20060902 Calendar/0.3a2+

Sunbird's CalDAV provider throws:

Error: [Exception... "'Component does not have requested interface' when
calling method: [nsIInterfaceRequestor::getInterface]"  nsresult: "0x80004002
(NS_NOINTERFACE)"  location: "<unknown>"  data: no]

multiple times at startup and whever the CalDAV calendar is queried/modified. 

Reproducible: Always

Steps to Reproduce:
1. Start Sunbird with a profile containing a CalDAV calendar
2. Open Error Console

Actual Results:  
Error Console shows above-described error

Expected Results:  
There should be no errors in the Error Console

This started happening when bug 308567 was fixed. The exception do not appear to have any negative effect on the way Sunbird functions other than ugly spewage in the error console.
thanks to lilmatt for pointing out a simpler way of approaching this than I started with.
Attachment #236583 - Flags: second-review?(dmose)
Attachment #236583 - Flags: first-review?(jminta)
Attachment #236583 - Flags: second-review?(dmose) → second-review-
Comment on attachment 236583 [details] [diff] [review]
don't throw exception on nsIInterfaceRequestor impl

This doesn't seem like it's abusing the semantics of nsIInterfaceRequestor (and XPConnect, really).  I think the right way to fix this is to actually provide the interfaces that are being requested, even if we just stub out the relevant methods.
Attachment #236583 - Flags: first-review?(jminta)
(In reply to comment #2)
> (From update of attachment 236583 [details] [diff] [review] [edit])
> This doesn't seem like it's abusing the semantics of nsIInterfaceRequestor (and
> XPConnect, really). 

I really meant to write "This doesn't seem like it's fixing the problem as much as working around it by abusing the semantics"...
Attachment #236583 - Attachment is obsolete: true
Attached patch provide interfaces (obsolete) — Splinter Review
patch rev 2
Attachment #238320 - Flags: second-review?(dmose)
Attachment #238320 - Flags: first-review?(jminta)
Attachment #238320 - Attachment is obsolete: true
Attachment #238320 - Flags: second-review?(dmose)
Attachment #238320 - Flags: first-review?(jminta)
Attached patch check trunk/branch (obsolete) — Splinter Review
patch rev 3
tested with sunbird/trunk, lightning/branch_1.8
Attachment #238895 - Flags: second-review?(dmose)
Attachment #238895 - Flags: first-review?(mattwillis)
Comment on attachment 238895 [details] [diff] [review]
check trunk/branch

>Index: calendar/providers/caldav/calDavCalendar.js
>===================================================================
>+var appInfo = Components.classes["@mozilla.org/xre/app-info;1"].
>+                         getService(Components.interfaces.nsIXULAppInfo);
Nit: Move the . to the next line ( .getService...)


>@@ -775,6 +780,18 @@ calDavCalendar.prototype = {
>             return Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
>                              .getService(Components.interfaces.nsIWindowWatcher)
>                              .getNewPrompter(null);
>+        } else if (iid.equals(Components.interfaces.nsIProgressEventSink)) {
>+            return this;
>+        } else if (iid.equals(Components.interfaces.nsIDocShellTreeItem)) {
>+            return this;
>+        } else if (iid.equals(Components.interfaces.nsIAuthPromptProvider)) {
>+          return Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
Nit: Indent this line ^^^ 2 more spaces.
>+                             .getService(Components.interfaces.nsIWindowWatcher)
>+                             .getNewPrompter(null);
>+        } else if (!isOnBranch && iid.equals(Components.interfaces.nsIAuthPrompt2)) {
>+          return Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
Nit: Also, indent this line ^^^ 2 more spaces.


r=lilmatt with those fixed
Attachment #238895 - Flags: first-review?(mattwillis) → first-review+
Whiteboard: [patch in hand][needs review dmose]
patch rev 4 w/ r1 nits deloused
Attachment #239006 - Flags: second-review?(dmose)
Comment on attachment 239006 [details] [diff] [review]
corrections per r1

>+var appInfo = Components.classes["@mozilla.org/xre/app-info;1"]
>+                         .getService(Components.interfaces.nsIXULAppInfo);
Align those dots! :)
Attachment #238895 - Attachment is obsolete: true
Attachment #238895 - Flags: second-review?(dmose)
Comment on attachment 239006 [details] [diff] [review]
corrections per r1

Looks good; thanks for the patch!  r2=dmose
Attachment #239006 - Flags: second-review?(dmose) → second-review+
Patch checked in on MOZILLA_1_8_BRANCH and trunk.

-> FIXED
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: [patch in hand][needs review dmose]
You need to log in before you can comment on or make changes to this bug.