Closed Bug 329373 Opened 18 years ago Closed 18 years ago

Lightning fails to create new local ICS file (sunbird succeeds)

Categories

(Calendar :: Lightning Only, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gekacheka, Unassigned)

References

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1
Build Identifier: Lightning 20060303, Thunderbird 1.5 20051201

Lightning does not create a new ics file.  It does not alert the user that creation has failed, and the calendar name appears in the list of calendars, but no file appears in the file system, and events created in the new ics calendar don't appear.

Sunbird succeeds for this same operation.

Lightning does succeed in opening and adding to an existing ics file.

Reproducible: Always

Steps to Reproduce:

1. Lightning: calendars tab, new calendar
2. select "(*) remote", click "next"
3. enter nonexisting file url, such as "file:///c:/temp/icsTest345.ics", click next
4. click next (keep name)
4a. "Your calendar has been created" appears in dialog
4b. "icsTest45" appears in in calendar list
4c. Error appears in javascript console (see below)

5. click finish (dismiss dialog)
6. click checkmark next to calendar "icsTest345", so calendar is selected and visible.
7. create event, say by dragging region in day view.
  event disappears, does not appear in day view.
  (if created in 'home' calendar, does appear)
8. create todo.
  todo does not appear in todo list.
  (if created in 'home' calendar, does appear)


Actual Results:  

After step 4:

  Error: loader.request has no properties
  Source File: file:///...components/calICSCalendar.js
  Line: 184


Expected Results:  

After step 4:  expect no error.

  (When there is an error, it should report error to user, and probably should      
   not show calendar in calendar list (since can't add anything to it).)





Error occurs in calICSCalendar.onStreamComplete
http://lxr.mozilla.org/mozilla/source/calendar/providers/ics/calICSCalendar.js#178

loader.request is null (evaluated "loader.request" after stopped in venkman; the venkman stack browser doesn't show any properties, maybe because it is not a javascript object)

The nsIStreamLoader.request property may be "null after the request has finished loading"
http://www.xulplanet.com/references/xpcomref/ifaces/nsIStreamLoader.html

This explains why the error is thrown, but not why it doesn't appear in sunbird.
*** Bug 329371 has been marked as a duplicate of this bug. ***
(patch -l -p 2 -i file.patch)

First problem was that loader.request can be null in onStreamComplete because the load has completed.  Suggested fix is to save the channel in inBeforeGet and use the saved channel in onAfterGet.

Second problem was that parseICS throws an error when it tries to parse an empty string, and that causes the calendar to be marked read-only.  Suggested fix is to avoid trying to parse the string if it is empty (new file).

Seems to work: with these changes, Lightning can create local ics file:// calendar and add events to it without errors, and they appear in file.
Attachment #214049 - Flags: first-review?(mvl)
I've tested this patch, and it works for me.  I don't think this is quite a 0.1 blocker, but it seems low-enough risk that I'd be ok with it landing tonight so that it can make 0.1.  mvl, what do you think?
Is this patch tested with webdav?
Comment on attachment 214049 [details] [diff] [review]
suggested patch: don't get channel from loader.request; skip parse on empty file

ok, patch looks good.
r=mvl
Attachment #214049 - Flags: first-review?(mvl) → first-review+
Landed; thanks for the patch!
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: