Closed Bug 435166 Opened 16 years ago Closed 16 years ago

better error handling for repeating tasks without start date [NS_ERROR_INVALID_POINTER in calRecurrenceInfo.js]

Categories

(Calendar :: Internal Components, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: ssitter, Assigned: gekacheka)

References

Details

Attachments

(3 files)

Attached file testcase
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.15pre) Gecko/2008052120 Calendar/0.9pre

Sunbird/Lightning fails on repeating tasks without a start date set like the attached one. Currently it's possible to create such tasks with Sunbird/Lightning itself, see Bug 432966. But the task attached (from Bug 421668) seems to be created with ReminderFox.

I'd request a better error handling for such tasks that doesn't prevent Sunbird/Lightning from working. For example the task could be ignored or treated as non-repeating.

The following errors are shown in Error Console:

Error: Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [calIRecurrenceItem.getOccurrences]
Source file: file:///[...]/sunbird/js/calRecurrenceInfo.js Line: 409

Error: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [calIRecurrenceItem.getOccurrences]"  nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)"  location: "JS frame :: file:///[...]/sunbird/js/calRecurrenceInfo.js :: anonymous :: line 409"  data: no] STACK: 1: [file:///[...]/sunbird/js/calUtils.js:1666] notifyFunc
2: [null:0] null
3: [file:///[...]/sunbird/js/calUtils.js:1669] calListenerBag_notify
4: [file:///[...]/sunbird/components/calCompositeCalendar.js:73] anonymous
5: [null:0] null
Source file: file:///[...]/sunbird/js/calUtils.js  Line: 1666

Error: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [calIRecurrenceItem.getOccurrences]"  nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)"  location: "JS frame :: file:///[...]/sunbird/js/calRecurrenceInfo.js :: anonymous :: line 409"  data: no] STACK: 1: [file:///[...]/sunbird/js/calUtils.js:1666] notifyFunc
2: [null:0] null
3: [file:///[...]/sunbird/js/calUtils.js:1669] calListenerBag_notify
4: [file:///[...]/sunbird/js/calStorageCalendar.js:452] anonymous
5: [file:///[...]/sunbird/js/calStorageCalendar.js:393] anonymous
Source file: file:///[...]/sunbird/js/calUtils.js  Line: 1666

Error: Assert failed: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [calIRecurrenceItem.getOccurrences]"  nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)"  location: "JS frame :: file:///[...]/sunbird/js/calRecurrenceInfo.js :: anonymous :: line 409"  data: no]
1: [file:///[...]/sunbird/js/calUtils.js:1410] ASSERT
2: [file:///[...]/sunbird/components/calCompositeCalendar.js:425] anonymous
3: [null:0] null
4: [chrome://calendar/content/calendar-task-tree.xml:896] anonymous
5: [chrome://calendar/content/calendar-task-tree.xml:981] popRefreshQueue
Source file: file:///[...]/sunbird/js/calUtils.js  Line: 1414
Flags: wanted-calendar0.9+
Summary: better error handling for repeating tasks without start date → better error handling for repeating tasks without start date [NS_ERROR_INVALID_POINTER in calRecurrenceInfo.js]
(patch -l -p 1 -i file.patch)

calRecurrenceInfo.calculateDates: If a task has no start or due date (so item.recurrenceStartDate == null), then ignore any recurrence rules and return [] for no occurrence dates. 

(The sogo1 demo account at http://sogo-demo.inverse.ca/ seems to have many of these tasks.  This patch eliminates the errors using that account.)
Attachment #339668 - Flags: review?(daniel.boelzle)
Assignee: nobody → gekacheka
Status: NEW → ASSIGNED
Flags: in-testsuite?
OS: Windows XP → All
Hardware: PC → All
Comment on attachment 339668 [details] [diff] [review]
[checked in] v1 patch: todo with rrule but no start or due date has no occurence dates

The patch looks good; r=dbo.

I get further unhandled exceptions opening such a task:

Error: startDate is null
Source File: chrome://calendar/content/calendar-task-view.js
Line: 146

We should probably fix this one in this bug, too.
Attachment #339668 - Flags: review?(daniel.boelzle) → review+
(patch -l -p 1 -i file.patch)

With this patch, task view no longer produces an error when selecting a task with recurrence info but no start or due date.   It now requires that the task have a recurrenceStartDate (i.e,. start or due date) as well as recurrenceInfo before it attempts to compute repeat details.
Attachment #340818 - Flags: review?(daniel.boelzle)
IMO the rule should be shown in the event dialog (even though it cannot be expanded due to the missing DTSTART), because it's actually present and part of the data. What do you think?
Flags: wanted-calendar0.9+ → wanted-calendar1.0+
in reply to comment 5:

There's a tradeoff between showing the disabled rule saved in the event, and confusing users into thinking the rule is in effect even though it is not because there is no start date.  Maybe one approach would be to show the rule (in drop-down and in detail string), relative to the current setting of the start date picker, but show the drop-down and the detail string disabled to indicate they are not in effect.  (To edit the saved rule, the user would have to enable a start date, edit the recurrence rule, then disable the start date again.)

(FYI, I'll be away and won't get to this in the near future.)
Attachment #340818 - Flags: review?(daniel.boelzle) → review+
Comment on attachment 340818 [details] [diff] [review]
[checked in] part 2 patch v1: make Task View select omit repeat details if no start or due

Yes, it's a trade-off. The patch improves the current situation; r=dbo.

I think we need to figure out generally how to present invalid data (like recurring tasks without DTSTART, stale TZIDs, ...).
Attachment #339668 - Attachment description: v1 patch: todo with rrule but no start or due date has no occurence dates → [checked in] v1 patch: todo with rrule but no start or due date has no occurence dates
Comment on attachment 340818 [details] [diff] [review]
[checked in] part 2 patch v1: make Task View select omit repeat details if no start or due

Pushed to comm-central: http://hg.mozilla.org/comm-central/rev/afdbefbf1c38
Attachment #340818 - Attachment description: part 2 patch v1: make Task View select omit repeat details if no start or due → [checked in] part 2 patch v1: make Task View select omit repeat details if no start or due
Target Milestone: --- → 1.0
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
checkd in nightly build 20081015052201 -> VERIFIED.
Status: RESOLVED → VERIFIED
Target Milestone: 1.0 → 1.0b1
Flags: in-testsuite?
You need to log in before you can comment on or make changes to this bug.