Closed
Bug 455132
Opened 17 years ago
Closed 17 years ago
Pasting event to switched off calendar deletes all original events
Categories
(Calendar :: Provider: ICS/WebDAV, defect)
Calendar
Provider: ICS/WebDAV
Tracking
(Not tracked)
RESOLVED
FIXED
0.9
People
(Reporter: ssitter, Assigned: Fallen)
Details
Attachments
(1 file, 2 obsolete files)
9.13 KB,
patch
|
dbo
:
review+
|
Details | Diff | Splinter Review |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.18pre) Gecko/2008091218 Sunbird/0.9
Steps to Reproduce:
1. Start Sunbird with a clean profile
2. Create a dummy event in the default storage calendar ('Home')
3. Open a local .ics file that contains events as a second calendar
4. From properties dialog switch on Cache for the ics calendar and restart
5. From properties dialog switch off the ics calendar and restart
6. Select the ics calendar entry in the calendar list
7. Select the dummy event from the Home calendar and copy it
8. Paste it to the switched off ics calendar
9. Call menu File -> Reload Remote Calendars
10. From properties dialog switch on the ics calendar
Actual Results:
after 3: original events are displayed (as expected)
after 5: original events are not displayed (as expected)
after 8: pasted event is shown in the switched off calendar
after 9: pasted event is not displayed anymore
after 10: only the pasted event is shown but the original events disappeared!
Expected Results:
after 8: no events are displayed
after 10: original events are displayed
Assignee | ||
Updated•17 years ago
|
Flags: blocking-calendar0.9?
Reporter | ||
Comment 1•17 years ago
|
||
I think there is overlap to the workflow in my other Bug 455214. Pasting shouldn't be possible if the selected calendar is switched off or read-only independent if it's cached or not.
If the calendar is cached, read-only and switched off the following error is logged to console:
Error: uncaught exception: [Exception... "'<error>' when calling method: [calICalendar::adoptItem]" nsresult: "0x804a0002 (<unknown>)" location: "JS frame :: file:///E://sunbird/js/calCachedCalendar.js :: anonymous :: line 396" data: no]
Comment 2•17 years ago
|
||
This should fix the bug, including some unit tests. However, the added tests show up that getNextOccurrence has bugs (in those cases). Since this is IMO a different bug, we should not fix it here.
Assignee: nobody → daniel.boelzle
Status: NEW → ASSIGNED
Attachment #338717 -
Flags: review?(philipp)
Comment 3•17 years ago
|
||
Comment on attachment 338717 [details] [diff] [review]
fix - v1
>- dates = dates.filter(function (d) {
>- if (aReturnRIDs) {
>- return d.rstart.compare(dateToRemove) != 0;
>- } else {
>- return d.compare(dateToRemove) != 0;
>- }
>- });
>+ dates = dates.filter(function (d) { return d.id.compare(dateToRemove) != 0; });
Just for reference: The core fix of this bug is to compare the RECURRENCE-ID, instead of the occurrence date here.
Updated•17 years ago
|
Flags: in-testsuite?
Flags: blocking-calendar0.9?
Flags: blocking-calendar0.9+
OS: Windows XP → All
Hardware: PC → All
Comment 4•17 years ago
|
||
Although I am pretty confident in this patch (all unit tests pass successfully, if I revert changes of bug 438964 comment #11), I am setting qawanted, because changes to calRecurrenceInfo.js are always good for regressions.
Keywords: qawanted
Updated•17 years ago
|
Attachment #338717 -
Attachment is obsolete: true
Attachment #338717 -
Flags: review?(philipp)
Comment 5•17 years ago
|
||
oops, worked on wrong bug :(
moving comments to bug 455133... sorry!
Assignee: daniel.boelzle → nobody
Status: ASSIGNED → NEW
Flags: in-testsuite?
Flags: blocking-calendar0.9?
Flags: blocking-calendar0.9+
Keywords: qawanted
Comment 6•17 years ago
|
||
I think this needs a fix, because it's unrelated to experimental caching and causes dataloss. Pasting on a switched off calendar must not be allowed.
Flags: blocking-calendar0.9? → blocking-calendar0.9+
Keywords: dataloss
Summary: Adding event to cached and switched off calendar deletes all original events → Pasting event to switched off calendar deletes all original events
Comment 7•17 years ago
|
||
- patch fixes paste
- fixes similar problem in undo/redo scenarios (e.g. switching off calendar, then doing undo/redo affecting the switched off calendar) by peeking the unod/redo transactions
While this works fine on Lightning, it still doesn't reliably work on Sunbird :/
Assignee | ||
Comment 8•17 years ago
|
||
Attachment #339051 -
Attachment is obsolete: true
Comment 9•17 years ago
|
||
Comment on attachment 339083 [details] [diff] [review]
WIP v2
r=dbo,philipp
Attachment #339083 -
Flags: review+
Comment 10•17 years ago
|
||
Peer review per IRC.
Checked in on HEAD, MOZILLA_1_8_BRANCH and SUNBIRD_0_9_BRANCH => FIXED.
Cross your fingers that this change doesn't cause regressions.
Updated•17 years ago
|
Assignee: nobody → philipp
You need to log in
before you can comment on or make changes to this bug.
Description
•