Closed Bug 370139 Opened 17 years ago Closed 17 years ago

Profile unusable after creating caldav calendar with incorrect file url

Categories

(Calendar :: Provider: CalDAV, defect)

defect
Not set
critical

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ssitter, Assigned: browning)

References

Details

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2pre) Gecko/20070211 Calendar/0.4a1

I have seen some reports of this in support forum/newsgroup by now:
 
Users try to create an ics calendar on local disc using a file url. But instead of 'iCalendar (ICS)' they selected 'CalDAV' in the new calendar wizard by mistake or unawareness. After restart of Sunbird all calendars are gone and it's not possible to remove the incorrect calendar -> profile is unusable.

Steps to Reproduce:
1. Start Sunbird/Lightning with clean profile
2. Create some new test calendars and events
3. Create a new calendar, select 'CalDAV' and enter an url that
   points to ics file on local disc (e.g. file:///C:/calendar.ics) 
4. Restart Sunbird/Lightning

Actual Results:
Existing events are not or only partly displayed. It is not possible to create new events or switch views. In the Calendars tab there are no calendars displayed 
--> It's not possible to remove the incorrect calendar 
--> profile is unusable

Errors in console:
Error: uncaught exception: [Exception... "Component returned failure code: 0x80004002 (NS_NOINTERFACE) [nsIWebDAVService.report]"  nsresult: "0x80004002 (NS_NOINTERFACE)"  location: "JS frame :: file:///D:/sunbird/components/calDavCalendar.js :: anonymous :: line 833"  data: no]

Error: currentView().selectedDay has no properties
Source File: chrome://calendar/content/calendar-item-editing.js Line: 58

Error: gCalendarWindow has no properties
Source File: chrome://calendar/content/calendar.xul Line: 1

Expected Results:

Entering an invalid url should not cause such a severe error. Either it should not be possible to create such a calendar at all or the error should be handled more carefully.
Flags: blocking-calendar0.5?
added runtime check for this to patch waiting on r2 in bug 355270. The calendar creation wizard should also prevent calendars from being created this way, of course.

The the patch in 355270 prevents the console error cited above, and allows the calendar to be deleted, but there remains an issue these bad 'caldav' calendars wedge the view in profiles that contain them (can't change month, for instance). It's caused by getItems() not returning anything, and straightforward enough to fix, but I hate to keep piling new stuff into that 355270 patch between r1 and r2, so that should probably be fixed in a separate patch after the current one goes in. I see the view-wedging issue as a separate bug as it can equally well be trigged by an offline caldav server.

Depends on: 355270
Retest using Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.3pre) Gecko/20070309 Calendar/0.5pre ID:2007030903

Following the steps from above I now get the following (expected) message in Error Console:

Error: Unable to get properties of resource file:///C:/calendar.ics
       (not a network resource?); setting read-only
Source File: file:///D:/sunbird/components/calDavCalendar.js
Line: 1109

But it is now possible to navigate views and to delete the faulty calendar.

-> FIXED by checkin for Bug 355270
Assignee: nobody → browning
Flags: blocking-calendar0.5?
OS: Windows XP → All
Hardware: PC → All
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.