Projects
Wiki     Timeline     Roadmap     Browse Source     View Tickets     New Ticket     Search

Ticket #26 (closed Defect: Software changed)

Opened 4 years ago

Last modified 3 years ago

Todo Alarm Creation Fails

Reported by: wsanchez@… Owned by: cdaboo@…
Priority: 4: Nice to have Milestone: CalendarServer-1.0
Component: Calendar Server Severity: Other
Keywords: Cc:

Description

2006/07/20 3:48 PM David Reid: * SUMMARY Attempting to add an alarm for a Todo item stored on the calendar server causes an exception

* STEPS TO REPRODUCE

  1. Create a todo
  2. Click due date
  3. Add an alarm

* RESULTS iCal claims to add an alarm but displays an error notice next to the calendar name and the server log shows the following exception

2006/07/20 15:47 PDT [-] Traceback (most recent call last):
	  File "/usr/share/caldavd/lib/python/twisted/web2/stream.py", line 407, in _read
	    self._gotData(result)
	  File "/usr/share/caldavd/lib/python/twisted/web2/stream.py", line 418, in _gotData
	    result.callback(None)
	  File "/usr/share/caldavd/lib/python/twisted/internet/defer.py", line 229, in callback
	    self._startRunCallbacks(result)
	  File "/usr/share/caldavd/lib/python/twisted/internet/defer.py", line 294, in _startRunCallbacks
	    self._runCallbacks()
	--- <exception caught here> ---
	  File "/usr/share/caldavd/lib/python/twisted/internet/defer.py", line 307, in _runCallbacks
	    self.result = callback(self.result, *args, **kw)
	  File "/usr/share/caldavd/lib/python/twistedcaldav/method/put_common.py", line 473, in doIndexing
	    result = doDestinationIndex(calendar)
	  File "/usr/share/caldavd/lib/python/twistedcaldav/method/put_common.py", line 407, in doDestinationIndex
	    destination_index.addResource(destination.fp.basename(), caltoindex)
	  File "/usr/share/caldavd/lib/python/twistedcaldav/index.py", line 196, in addResource
	    self._add_to_db(name, calendar)
	  File "/usr/share/caldavd/lib/python/twistedcaldav/index.py", line 520, in _add_to_db
	    instances = calendar.expandTimeRanges(expand_max)
	  File "/usr/share/caldavd/lib/python/twistedcaldav/ical.py", line 652, in expandTimeRanges
	    return self.expandSetTimeRanges(componentSet, limit)
	  File "/usr/share/caldavd/lib/python/twistedcaldav/ical.py", line 669, in expandSetTimeRanges
	    instances.expandTimeRanges(componentSet, limit)
	  File "/usr/share/caldavd/lib/python/twistedcaldav/instance.py", line 133, in expandTimeRanges
	    self._addMasterToDoComponent(component, limit)
	  File "/usr/share/caldavd/lib/python/twistedcaldav/instance.py", line 233, in _addMasterToDoComponent
	    duration = due - start
	exceptions.TypeError: unsupported operand type(s) for -: 'datetime.date' and 'datetime.datetime'

* REGRESSION This only happens for ToDos; alarms on events work fine.

Change History

Changed 4 years ago by wsanchez@…

2006/07/21 9:09 AM Cyrus Daboo: We currently make the assumption that DTSTART/DTEND (in a VEVENT) or DTSTART/DUE (in a VTODO) have the same value types (e.g. they are both VALUE=DATE-TIME or VALUE=DATA). It turns out that may not always be the case as 2445 does not have a restriction like that (well it does restrict DTEND to DATE if DTSTART is DATE but that is all).

I am guessing, without having seen the iCal component itself, that iCal uses different value types for the VTODO's DUE and DTSTART properties and that is raising the exception.

What we need to do is spot the different data types and do appropriate 'promotion' when attempt any arithmetic on the datetime values.

2006/07/21 11:03 AM Cyrus Daboo: We also need to take into account the possibility of DTSTART/DTEND or DTSTART/DUE both being value type DATE-TIME, but using different time variants for each (UTC, local, floating). Unfortunately we will not be able to handle the case of one being floating time and the other not as we currently assume they both are floating or not. Fixing that involves major changes to instance expansion and indexing.

For now fix will coerce floating to the other type. This ought to be fine given that this case should not really occur in practice.

Changed 4 years ago by wsanchez@…

  • owner changed from wsanchez@… to cdaboo@…

Cyrus, I think you already fixed this?

Changed 4 years ago by cdaboo@…

  • status changed from new to closed
  • resolution set to fixed

Yes this is fixed and a bunch of CalDAVTester tests exist.

Changed 3 years ago by wsanchez@…

  • milestone changed from Preview 1 to Version One

Milestone Preview 1 deleted

Note: See TracTickets for help on using tickets.